<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[209939] trunk/Source/WebCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/209939">209939</a></dd>
<dt>Author</dt> <dd>weinig@apple.com</dd>
<dt>Date</dt> <dd>2016-12-16 14:29:19 -0800 (Fri, 16 Dec 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>[Bindings] Remove use of Dictionary/ArrayValue in CDMSessionClearKey
https://bugs.webkit.org/show_bug.cgi?id=165961
Reviewed by Darin Adler.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
Remove ArrayValue.h/cpp
* bindings/js/ArrayValue.cpp: Removed.
* bindings/js/ArrayValue.h: Removed.
* bindings/js/Dictionary.cpp:
* bindings/js/Dictionary.h:
Remove support for ArrayValue.
* Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
(WebCore::CDMSessionClearKey::update):
Replace use of Dictionary/ArrayValue with direct JSObject functions. This
should really be replaced with a JSON parser that does not require round
tripping through JavaScript objects.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmedialegacyLegacyCDMSessionClearKeycpp">trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorebindingsjsDictionarycpp">trunk/Source/WebCore/bindings/js/Dictionary.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsDictionaryh">trunk/Source/WebCore/bindings/js/Dictionary.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSBindingsAllInOnecpp">trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorebindingsjsArrayValuecpp">trunk/Source/WebCore/bindings/js/ArrayValue.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsArrayValueh">trunk/Source/WebCore/bindings/js/ArrayValue.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (209938 => 209939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2016-12-16 22:26:09 UTC (rev 209938)
+++ trunk/Source/WebCore/CMakeLists.txt        2016-12-16 22:29:19 UTC (rev 209939)
</span><span class="lines">@@ -1071,7 +1071,6 @@
</span><span class="cx"> bindings/generic/ActiveDOMCallback.cpp
</span><span class="cx"> bindings/generic/RuntimeEnabledFeatures.cpp
</span><span class="cx">
</span><del>- bindings/js/ArrayValue.cpp
</del><span class="cx"> bindings/js/CachedModuleScript.cpp
</span><span class="cx"> bindings/js/CachedModuleScriptLoader.cpp
</span><span class="cx"> bindings/js/CallbackFunction.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (209938 => 209939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-12-16 22:26:09 UTC (rev 209938)
+++ trunk/Source/WebCore/ChangeLog        2016-12-16 22:29:19 UTC (rev 209939)
</span><span class="lines">@@ -1,3 +1,28 @@
</span><ins>+2016-12-16 Sam Weinig <sam@webkit.org>
+
+ [Bindings] Remove use of Dictionary/ArrayValue in CDMSessionClearKey
+ https://bugs.webkit.org/show_bug.cgi?id=165961
+
+ Reviewed by Darin Adler.
+
+ * CMakeLists.txt:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/JSBindingsAllInOne.cpp:
+ Remove ArrayValue.h/cpp
+
+ * bindings/js/ArrayValue.cpp: Removed.
+ * bindings/js/ArrayValue.h: Removed.
+
+ * bindings/js/Dictionary.cpp:
+ * bindings/js/Dictionary.h:
+ Remove support for ArrayValue.
+
+ * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
+ (WebCore::CDMSessionClearKey::update):
+ Replace use of Dictionary/ArrayValue with direct JSObject functions. This
+ should really be replaced with a JSON parser that does not require round
+ tripping through JavaScript objects.
+
</ins><span class="cx"> 2016-12-13 Jer Noble <jer.noble@apple.com>
</span><span class="cx">
</span><span class="cx"> Move existing CDM* implementations into modules/encryptedmedia/legacy
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmedialegacyLegacyCDMSessionClearKeycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp (209938 => 209939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp        2016-12-16 22:26:09 UTC (rev 209938)
+++ trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp        2016-12-16 22:29:19 UTC (rev 209939)
</span><span class="lines">@@ -26,8 +26,6 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "LegacyCDMSessionClearKey.h"
</span><span class="cx">
</span><del>-#include "ArrayValue.h"
-#include "Dictionary.h"
</del><span class="cx"> #include "JSMainThreadExecState.h"
</span><span class="cx"> #include "Logging.h"
</span><span class="cx"> #include "TextEncoding.h"
</span><span class="lines">@@ -99,66 +97,86 @@
</span><span class="cx"> ASSERT(rawKeysData);
</span><span class="cx">
</span><span class="cx"> do {
</span><del>- String rawKeysString = String::fromUTF8(rawKeysData->data(), rawKeysData->length());
</del><ins>+ auto rawKeysString = String::fromUTF8(rawKeysData->data(), rawKeysData->length());
</ins><span class="cx"> if (rawKeysString.isEmpty()) {
</span><span class="cx"> LOG(Media, "CDMSessionClearKey::update(%p) - failed: empty message", this);
</span><span class="cx"> continue;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- VM& vm = clearKeyVM();
</del><ins>+ auto& vm = clearKeyVM();
</ins><span class="cx"> JSLockHolder lock(vm);
</span><span class="cx"> auto scope = DECLARE_THROW_SCOPE(vm);
</span><del>- JSGlobalObject* globalObject = JSGlobalObject::create(vm, JSGlobalObject::createStructure(vm, jsNull()));
- ExecState* exec = globalObject->globalExec();
</del><ins>+ auto* globalObject = JSGlobalObject::create(vm, JSGlobalObject::createStructure(vm, jsNull()));
+ auto& state = *globalObject->globalExec();
</ins><span class="cx">
</span><del>- JSLockHolder locker(clearKeyVM());
- JSValue keysDataObject = JSONParse(exec, rawKeysString);
- if (scope.exception() || !keysDataObject) {
</del><ins>+ auto keysDataValue = JSONParse(&state, rawKeysString);
+ if (scope.exception() || !keysDataValue.isObject()) {
</ins><span class="cx"> LOG(Media, "CDMSessionClearKey::update(%p) - failed: invalid JSON", this);
</span><span class="cx"> break;
</span><span class="cx"> }
</span><del>- Dictionary keysDataDictionary(exec, keysDataObject);
- ArrayValue keysArray;
- size_t length;
- if (!keysDataDictionary.get("keys", keysArray) || keysArray.isUndefinedOrNull() || !keysArray.length(length) || !length) {
</del><ins>+
+ auto keysArrayValue = asObject(keysDataValue)->get(&state, Identifier::fromString(&state, "keys"));
+ if (scope.exception() || !isJSArray(keysArrayValue)) {
</ins><span class="cx"> LOG(Media, "CDMSessionClearKey::update(%p) - failed: keys array missing or empty", this);
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ auto keysArray = asArray(keysArrayValue);
+ auto length = keysArray->length();
+ if (!length) {
+ LOG(Media, "CDMSessionClearKey::update(%p) - failed: keys array missing or empty", this);
+ break;
+ }
+
</ins><span class="cx"> bool foundValidKey = false;
</span><del>- for (size_t i = 0; i < length; ++i) {
- Dictionary keyDictionary;
- if (!keysArray.get(i, keyDictionary) || keyDictionary.isUndefinedOrNull()) {
</del><ins>+ for (unsigned i = 0; i < length; ++i) {
+ auto keyValue = keysArray->getIndex(&state, i);
+
+ if (scope.exception() || !keyValue.isObject()) {
</ins><span class="cx"> LOG(Media, "CDMSessionClearKey::update(%p) - failed: null keyDictionary", this);
</span><span class="cx"> continue;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- String algorithm;
- if (!keyDictionary.get("alg", algorithm) || !equalLettersIgnoringASCIICase(algorithm, "a128kw")) {
</del><ins>+ auto keyObject = asObject(keyValue);
+
+ auto getStringProperty = [&scope, &state, &keyObject](const char* name) -> String {
+ auto value = keyObject->get(&state, Identifier::fromString(&state, name));
+ if (scope.exception() || !value.isString())
+ return { };
+
+ auto string = asString(value)->value(&state);
+ if (scope.exception())
+ return { };
+
+ return string;
+ };
+
+ auto algorithm = getStringProperty("alg");
+ if (!equalLettersIgnoringASCIICase(algorithm, "a128kw")) {
</ins><span class="cx"> LOG(Media, "CDMSessionClearKey::update(%p) - failed: algorithm unsupported", this);
</span><span class="cx"> continue;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- String keyType;
- if (!keyDictionary.get("kty", keyType) || !equalLettersIgnoringASCIICase(keyType, "oct")) {
</del><ins>+ auto keyType = getStringProperty("kty");
+ if (!equalLettersIgnoringASCIICase(keyType, "oct")) {
</ins><span class="cx"> LOG(Media, "CDMSessionClearKey::update(%p) - failed: keyType unsupported", this);
</span><span class="cx"> continue;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- String keyId;
- if (!keyDictionary.get("kid", keyId) || keyId.isEmpty()) {
</del><ins>+ auto keyId = getStringProperty("kid");
+ if (keyId.isEmpty()) {
</ins><span class="cx"> LOG(Media, "CDMSessionClearKey::update(%p) - failed: keyId missing or empty", this);
</span><span class="cx"> continue;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- String rawKeyData;
- if (!keyDictionary.get("k", rawKeyData) || rawKeyData.isEmpty()) {
</del><ins>+ auto rawKeyData = getStringProperty("k");
+ if (rawKeyData.isEmpty()) {
</ins><span class="cx"> LOG(Media, "CDMSessionClearKey::update(%p) - failed: key missing or empty", this);
</span><span class="cx"> continue;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> Vector<uint8_t> keyData;
</span><del>- if (!base64Decode(rawKeyData, keyData) || keyData.isEmpty()) {
</del><ins>+ if (!base64Decode(rawKeyData, keyData) || keyData.isEmpty()) {
</ins><span class="cx"> LOG(Media, "CDMSessionClearKey::update(%p) - failed: unable to base64 decode key", this);
</span><span class="cx"> continue;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (209938 => 209939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-12-16 22:26:09 UTC (rev 209938)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-12-16 22:29:19 UTC (rev 209939)
</span><span class="lines">@@ -1817,8 +1817,6 @@
</span><span class="cx">                 49AE2D97134EE5F90072920A /* CalculationValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 49AE2D95134EE5F90072920A /* CalculationValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 49AF2D6914435D050016A784 /* DisplayRefreshMonitor.h in Headers */ = {isa = PBXBuildFile; fileRef = 49AF2D6814435D050016A784 /* DisplayRefreshMonitor.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 49AF2D6C14435D210016A784 /* DisplayRefreshMonitorMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49AF2D6B14435D210016A784 /* DisplayRefreshMonitorMac.cpp */; };
</span><del>-                49B3760C15C6C6840059131D /* ArrayValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49B3760A15C6C6840059131D /* ArrayValue.cpp */; };
-                49B3760D15C6C6840059131D /* ArrayValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 49B3760B15C6C6840059131D /* ArrayValue.h */; };
</del><span class="cx">                 49C7B9931042D2D30009D447 /* JSWebGLBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49C7B9801042D2D30009D447 /* JSWebGLBuffer.cpp */; };
</span><span class="cx">                 49C7B9941042D2D30009D447 /* JSWebGLBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 49C7B9811042D2D30009D447 /* JSWebGLBuffer.h */; };
</span><span class="cx">                 49C7B9971042D2D30009D447 /* JSWebGLFramebuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49C7B9841042D2D30009D447 /* JSWebGLFramebuffer.cpp */; };
</span><span class="lines">@@ -9015,8 +9013,6 @@
</span><span class="cx">                 49AE2D95134EE5F90072920A /* CalculationValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CalculationValue.h; sourceTree = "<group>"; };
</span><span class="cx">                 49AF2D6814435D050016A784 /* DisplayRefreshMonitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DisplayRefreshMonitor.h; sourceTree = "<group>"; };
</span><span class="cx">                 49AF2D6B14435D210016A784 /* DisplayRefreshMonitorMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DisplayRefreshMonitorMac.cpp; sourceTree = "<group>"; };
</span><del>-                49B3760A15C6C6840059131D /* ArrayValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ArrayValue.cpp; sourceTree = "<group>"; };
-                49B3760B15C6C6840059131D /* ArrayValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArrayValue.h; sourceTree = "<group>"; };
</del><span class="cx">                 49C7B9801042D2D30009D447 /* JSWebGLBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebGLBuffer.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 49C7B9811042D2D30009D447 /* JSWebGLBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebGLBuffer.h; sourceTree = "<group>"; };
</span><span class="cx">                 49C7B9841042D2D30009D447 /* JSWebGLFramebuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebGLFramebuffer.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -21930,8 +21926,6 @@
</span><span class="cx">                                 BCCE58B41061E925008FB35A /* Constructors */,
</span><span class="cx">                                 BC4EDEF70C08F414007EDD49 /* Custom */,
</span><span class="cx">                                 14DFB33F0A7DF7630018F769 /* Derived Sources */,
</span><del>-                                49B3760A15C6C6840059131D /* ArrayValue.cpp */,
-                                49B3760B15C6C6840059131D /* ArrayValue.h */,
</del><span class="cx">                                 2DFA488E1DB541C200362B99 /* BufferSource.h */,
</span><span class="cx">                                 E307DEC91D81E46E00141CAF /* CachedModuleScript.cpp */,
</span><span class="cx">                                 E307DECA1D81E46E00141CAF /* CachedModuleScript.h */,
</span><span class="lines">@@ -24864,7 +24858,6 @@
</span><span class="cx">                                 512DD8FD0D91E6AF000F89EE /* ArchiveFactory.h in Headers */,
</span><span class="cx">                                 512DD8FC0D91E6AF000F89EE /* ArchiveResource.h in Headers */,
</span><span class="cx">                                 512DD8F80D91E6AF000F89EE /* ArchiveResourceCollection.h in Headers */,
</span><del>-                                49B3760D15C6C6840059131D /* ArrayValue.h in Headers */,
</del><span class="cx">                                 FD5686CA13AC180200B69C68 /* AsyncAudioDecoder.h in Headers */,
</span><span class="cx">                                 E1CDE9221501916900862CC5 /* AsyncFileStream.h in Headers */,
</span><span class="cx">                                 0FFD4D6118651FA300512F6E /* AsyncScrollingCoordinator.h in Headers */,
</span><span class="lines">@@ -28752,7 +28745,6 @@
</span><span class="cx">                                 512DD8FA0D91E6AF000F89EE /* ArchiveFactory.cpp in Sources */,
</span><span class="cx">                                 512DD8FB0D91E6AF000F89EE /* ArchiveResource.cpp in Sources */,
</span><span class="cx">                                 512DD8F70D91E6AF000F89EE /* ArchiveResourceCollection.cpp in Sources */,
</span><del>-                                49B3760C15C6C6840059131D /* ArrayValue.cpp in Sources */,
</del><span class="cx">                                 FD5686C913AC180200B69C68 /* AsyncAudioDecoder.cpp in Sources */,
</span><span class="cx">                                 E1CDE92015018ED000862CC5 /* AsyncFileStream.cpp in Sources */,
</span><span class="cx">                                 0FFD4D6018651FA300512F6E /* AsyncScrollingCoordinator.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsArrayValuecpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/bindings/js/ArrayValue.cpp (209938 => 209939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/ArrayValue.cpp        2016-12-16 22:26:09 UTC (rev 209938)
+++ trunk/Source/WebCore/bindings/js/ArrayValue.cpp        2016-12-16 22:29:19 UTC (rev 209939)
</span><span class="lines">@@ -1,102 +0,0 @@
</span><del>-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- * Copyright (C) 2016 Apple Inc. All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "ArrayValue.h"
-
-#include "Dictionary.h"
-#include <runtime/JSArray.h>
-
-using namespace JSC;
-
-namespace WebCore {
-
-ArrayValue::ArrayValue()
- : m_exec(0)
-{
-}
-
-ArrayValue::ArrayValue(JSC::ExecState* exec, JSC::JSValue value)
- : m_exec(exec)
-{
- if (!value.isUndefinedOrNull() && isJSArray(value))
- m_value = value;
-}
-
-ArrayValue& ArrayValue::operator=(const ArrayValue& other)
-{
- m_exec = other.m_exec;
- m_value = other.m_value;
- return *this;
-}
-
-bool ArrayValue::isUndefinedOrNull() const
-{
- return m_value.isEmpty() || m_value.isUndefinedOrNull();
-}
-
-bool ArrayValue::length(size_t& length) const
-{
- if (isUndefinedOrNull())
- return false;
-
- JSArray* array = asArray(m_value);
- length = array->length();
- return true;
-}
-
-bool ArrayValue::get(size_t index, Dictionary& value) const
-{
- if (isUndefinedOrNull())
- return false;
-
- JSValue indexedValue = asArray(m_value)->getIndex(m_exec, index);
- if (indexedValue.isUndefinedOrNull() || !indexedValue.isObject())
- return false;
-
- value = Dictionary(m_exec, indexedValue);
- return true;
-}
-
-bool ArrayValue::get(size_t index, String& value) const
-{
- VM& vm = m_exec->vm();
- auto scope = DECLARE_THROW_SCOPE(vm);
-
- if (isUndefinedOrNull())
- return false;
-
- JSValue indexedValue = asArray(m_value)->getIndex(m_exec, index);
- if (indexedValue.isUndefinedOrNull() || !indexedValue.isString())
- return false;
-
- value = asString(indexedValue)->value(m_exec);
- RETURN_IF_EXCEPTION(scope, false);
-
- return true;
-}
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsjsArrayValueh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/bindings/js/ArrayValue.h (209938 => 209939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/ArrayValue.h        2016-12-16 22:26:09 UTC (rev 209938)
+++ trunk/Source/WebCore/bindings/js/ArrayValue.h        2016-12-16 22:29:19 UTC (rev 209939)
</span><span class="lines">@@ -1,52 +0,0 @@
</span><del>-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include <interpreter/CallFrame.h>
-
-namespace WebCore {
-
-class Dictionary;
-
-class ArrayValue {
-public:
- ArrayValue();
- ArrayValue(JSC::ExecState*, JSC::JSValue);
-
- ArrayValue& operator=(const ArrayValue&);
-
- bool isUndefinedOrNull() const;
-
- bool length(size_t&) const;
- bool get(size_t index, Dictionary&) const;
- bool get(size_t index, String&) const;
-
-private:
- JSC::ExecState* m_exec;
- JSC::JSValue m_value;
-};
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsjsDictionarycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/Dictionary.cpp (209938 => 209939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/Dictionary.cpp        2016-12-16 22:26:09 UTC (rev 209938)
+++ trunk/Source/WebCore/bindings/js/Dictionary.cpp        2016-12-16 22:29:19 UTC (rev 209939)
</span><span class="lines">@@ -26,7 +26,6 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "Dictionary.h"
</span><span class="cx">
</span><del>-#include "ArrayValue.h"
</del><span class="cx"> #include "JSDOMConvert.h"
</span><span class="cx">
</span><span class="cx"> using namespace JSC;
</span><span class="lines">@@ -125,11 +124,4 @@
</span><span class="cx"> result = Dictionary(&state, value);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void Dictionary::convertValue(ExecState& state, JSValue value, ArrayValue& result)
-{
- if (value.isUndefinedOrNull())
- return;
- result = ArrayValue(&state, value);
</del><span class="cx"> }
</span><del>-
-}
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsjsDictionaryh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/Dictionary.h (209938 => 209939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/Dictionary.h        2016-12-16 22:26:09 UTC (rev 209938)
+++ trunk/Source/WebCore/bindings/js/Dictionary.h        2016-12-16 22:29:19 UTC (rev 209939)
</span><span class="lines">@@ -42,8 +42,6 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-class ArrayValue;
-
</del><span class="cx"> class Dictionary {
</span><span class="cx"> public:
</span><span class="cx"> Dictionary();
</span><span class="lines">@@ -85,7 +83,6 @@
</span><span class="cx"> static void convertValue(JSC::ExecState&, JSC::JSValue, String& result);
</span><span class="cx"> static void convertValue(JSC::ExecState&, JSC::JSValue, Vector<String>& result);
</span><span class="cx"> static void convertValue(JSC::ExecState&, JSC::JSValue, Dictionary& result);
</span><del>- static void convertValue(JSC::ExecState&, JSC::JSValue, ArrayValue& result);
</del><span class="cx">
</span><span class="cx"> JSC::ExecState* m_state { nullptr };
</span><span class="cx"> JSC::Strong<JSC::JSObject> m_initializerObject;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSBindingsAllInOnecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp (209938 => 209939)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp        2016-12-16 22:26:09 UTC (rev 209938)
+++ trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp        2016-12-16 22:29:19 UTC (rev 209939)
</span><span class="lines">@@ -25,7 +25,6 @@
</span><span class="cx">
</span><span class="cx"> // This all-in-one cpp file cuts down on template bloat to allow us to build our Windows release build.
</span><span class="cx">
</span><del>-#include "ArrayValue.cpp"
</del><span class="cx"> #include "CachedModuleScript.cpp"
</span><span class="cx"> #include "CachedModuleScriptLoader.cpp"
</span><span class="cx"> #include "CallbackFunction.cpp"
</span></span></pre>
</div>
</div>
</body>
</html>