<!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>[210323] 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/210323">210323</a></dd>
<dt>Author</dt> <dd>darin@apple.com</dd>
<dt>Date</dt> <dd>2017-01-05 00:46:10 -0800 (Thu, 05 Jan 2017)</dd>
</dl>
<h3>Log Message</h3>
<pre>Remove PassRefPtr use from "bindings/scripts", "svg", "testing", and "workers"
https://bugs.webkit.org/show_bug.cgi?id=166718
Reviewed by Alex Christensen.
* bindings/scripts/test/JS/JSFloat64Array.cpp: Removed. Stale unused test
result expectation file.
* bindings/scripts/test/JS/JSFloat64Array.h: Ditto.
* svg/SVGElement.cpp:
(WebCore::SVGElement::removeEventListener): Fix comment that incorrectly
mentions PassRefPtr.
* testing/Internals.cpp:
(WebCore::Internals::computedStyleIncludingVisitedInfo): Return Ref instead
of RefPtr.
(WebCore::Internals::serializeObject): Ditto.
(WebCore::Internals::deserializeBuffer): Ditto.
(WebCore::Internals::observeGC): Streamlined code a bit.
* testing/Internals.h: Updated for above changes.
* testing/Internals.idl: Marked various function results as nullable.
* workers/DedicatedWorkerThread.cpp:
(WebCore::DedicatedWorkerThread::createWorkerGlobalScope): Take a RefPtr&&
instead of a PassRefPtr.
* workers/DedicatedWorkerThread.h: Updated for above change.
* workers/Worker.cpp:
(WebCore::Worker::Worker): Passs a reference to WorkerGlobalScopeProxy::create.
(WebCore::Worker::~Worker): Updated since m_contentProxy is a reference.
(WebCore::Worker::postMessage): Ditto.
(WebCore::Worker::terminate): Ditto.
(WebCore::Worker::hasPendingActivity): Ditto.
(WebCore::Worker::notifyNetworkStateChange): Ditto.
(WebCore::Worker::notifyFinished): Ditto.
* workers/Worker.h: Made m_contextProxy a reference rather than a pointer.
* workers/WorkerGlobalScopeProxy.h: Reduced includes. Made destructor
protected instead of public since this class destroys itself.
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerGlobalScopeProxy::create): Take and return a reference.
(WebCore::WorkerMessagingProxy::WorkerMessagingProxy): Moved most initialization
to the calass definition. Take a reference instead of a pointer.
(WebCore::WorkerMessagingProxy::startWorkerGlobalScope): Use auto.
(WebCore::WorkerMessagingProxy::workerThreadCreated): Take a reference
rather than a PassRefPtr.
* workers/WorkerMessagingProxy.h: Updated for above changes.
(WebCore::WorkerMessagingProxy::askedToTerminate): Deleted.
(WebCore::WorkerMessagingProxy::workerObject): Deleted.
* workers/WorkerThread.h: Take a RefPtr&& instead of a PassRefPtr.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoresvgSVGElementcpp">trunk/Source/WebCore/svg/SVGElement.cpp</a></li>
<li><a href="#trunkSourceWebCoretestingInternalscpp">trunk/Source/WebCore/testing/Internals.cpp</a></li>
<li><a href="#trunkSourceWebCoretestingInternalsh">trunk/Source/WebCore/testing/Internals.h</a></li>
<li><a href="#trunkSourceWebCoretestingInternalsidl">trunk/Source/WebCore/testing/Internals.idl</a></li>
<li><a href="#trunkSourceWebCoreworkersDedicatedWorkerThreadcpp">trunk/Source/WebCore/workers/DedicatedWorkerThread.cpp</a></li>
<li><a href="#trunkSourceWebCoreworkersDedicatedWorkerThreadh">trunk/Source/WebCore/workers/DedicatedWorkerThread.h</a></li>
<li><a href="#trunkSourceWebCoreworkersWorkercpp">trunk/Source/WebCore/workers/Worker.cpp</a></li>
<li><a href="#trunkSourceWebCoreworkersWorkerh">trunk/Source/WebCore/workers/Worker.h</a></li>
<li><a href="#trunkSourceWebCoreworkersWorkerGlobalScopeProxyh">trunk/Source/WebCore/workers/WorkerGlobalScopeProxy.h</a></li>
<li><a href="#trunkSourceWebCoreworkersWorkerMessagingProxycpp">trunk/Source/WebCore/workers/WorkerMessagingProxy.cpp</a></li>
<li><a href="#trunkSourceWebCoreworkersWorkerMessagingProxyh">trunk/Source/WebCore/workers/WorkerMessagingProxy.h</a></li>
<li><a href="#trunkSourceWebCoreworkersWorkerThreadh">trunk/Source/WebCore/workers/WorkerThread.h</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSFloat64Arraycpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSFloat64Array.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSFloat64Arrayh">trunk/Source/WebCore/bindings/scripts/test/JS/JSFloat64Array.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (210322 => 210323)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-01-05 08:08:11 UTC (rev 210322)
+++ trunk/Source/WebCore/ChangeLog        2017-01-05 08:46:10 UTC (rev 210323)
</span><span class="lines">@@ -1,3 +1,58 @@
</span><ins>+2017-01-05 Darin Adler <darin@apple.com>
+
+ Remove PassRefPtr use from "bindings/scripts", "svg", "testing", and "workers"
+ https://bugs.webkit.org/show_bug.cgi?id=166718
+
+ Reviewed by Alex Christensen.
+
+ * bindings/scripts/test/JS/JSFloat64Array.cpp: Removed. Stale unused test
+ result expectation file.
+ * bindings/scripts/test/JS/JSFloat64Array.h: Ditto.
+
+ * svg/SVGElement.cpp:
+ (WebCore::SVGElement::removeEventListener): Fix comment that incorrectly
+ mentions PassRefPtr.
+
+ * testing/Internals.cpp:
+ (WebCore::Internals::computedStyleIncludingVisitedInfo): Return Ref instead
+ of RefPtr.
+ (WebCore::Internals::serializeObject): Ditto.
+ (WebCore::Internals::deserializeBuffer): Ditto.
+ (WebCore::Internals::observeGC): Streamlined code a bit.
+ * testing/Internals.h: Updated for above changes.
+ * testing/Internals.idl: Marked various function results as nullable.
+
+ * workers/DedicatedWorkerThread.cpp:
+ (WebCore::DedicatedWorkerThread::createWorkerGlobalScope): Take a RefPtr&&
+ instead of a PassRefPtr.
+ * workers/DedicatedWorkerThread.h: Updated for above change.
+
+ * workers/Worker.cpp:
+ (WebCore::Worker::Worker): Passs a reference to WorkerGlobalScopeProxy::create.
+ (WebCore::Worker::~Worker): Updated since m_contentProxy is a reference.
+ (WebCore::Worker::postMessage): Ditto.
+ (WebCore::Worker::terminate): Ditto.
+ (WebCore::Worker::hasPendingActivity): Ditto.
+ (WebCore::Worker::notifyNetworkStateChange): Ditto.
+ (WebCore::Worker::notifyFinished): Ditto.
+ * workers/Worker.h: Made m_contextProxy a reference rather than a pointer.
+
+ * workers/WorkerGlobalScopeProxy.h: Reduced includes. Made destructor
+ protected instead of public since this class destroys itself.
+
+ * workers/WorkerMessagingProxy.cpp:
+ (WebCore::WorkerGlobalScopeProxy::create): Take and return a reference.
+ (WebCore::WorkerMessagingProxy::WorkerMessagingProxy): Moved most initialization
+ to the calass definition. Take a reference instead of a pointer.
+ (WebCore::WorkerMessagingProxy::startWorkerGlobalScope): Use auto.
+ (WebCore::WorkerMessagingProxy::workerThreadCreated): Take a reference
+ rather than a PassRefPtr.
+ * workers/WorkerMessagingProxy.h: Updated for above changes.
+ (WebCore::WorkerMessagingProxy::askedToTerminate): Deleted.
+ (WebCore::WorkerMessagingProxy::workerObject): Deleted.
+
+ * workers/WorkerThread.h: Take a RefPtr&& instead of a PassRefPtr.
+
</ins><span class="cx"> 2017-01-04 Carlos Garcia Campos <cgarcia@igalia.com>
</span><span class="cx">
</span><span class="cx"> Unreviewed. Addressing post-review comments after r21005.
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSFloat64Arraycpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/bindings/scripts/test/JS/JSFloat64Array.cpp (210322 => 210323)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSFloat64Array.cpp        2017-01-05 08:08:11 UTC (rev 210322)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSFloat64Array.cpp        2017-01-05 08:46:10 UTC (rev 210323)
</span><span class="lines">@@ -1,294 +0,0 @@
</span><del>-/*
- This file is part of the WebKit open source project.
- This file has been generated by generate-bindings.pl. DO NOT MODIFY!
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- along with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "config.h"
-#include "JSFloat64Array.h"
-
-#include "ExceptionCode.h"
-#include "JSArrayBufferViewHelper.h"
-#include "JSDOMBinding.h"
-#include "JSFloat32Array.h"
-#include "JSInt32Array.h"
-#include <runtime/Error.h>
-#include <runtime/Float64Array.h>
-#include <runtime/Int32Array.h>
-#include <runtime/PropertyNameArray.h>
-#include <wtf/GetPtr.h>
-
-using namespace JSC;
-
-namespace WebCore {
-
-/* Hash table */
-
-static const HashTableValue JSFloat64ArrayTableValues[] =
-{
- { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsFloat64ArrayConstructor), (intptr_t)0, NoIntrinsic },
- { 0, 0, 0, 0, NoIntrinsic }
-};
-
-static const HashTable JSFloat64ArrayTable = { 2, 1, JSFloat64ArrayTableValues, 0 };
-/* Hash table for constructor */
-
-static const HashTableValue JSFloat64ArrayConstructorTableValues[] =
-{
- { 0, 0, 0, 0, NoIntrinsic }
-};
-
-static const HashTable JSFloat64ArrayConstructorTable = { 1, 0, JSFloat64ArrayConstructorTableValues, 0 };
-EncodedJSValue JSC_HOST_CALL JSFloat64ArrayConstructor::constructJSFloat64Array(ExecState* exec)
-{
- JSFloat64ArrayConstructor* jsConstructor = jsCast<JSFloat64ArrayConstructor*>(exec->jsCallee());
- RefPtr<Float64Array> array = constructArrayBufferView<Float64Array, double>(exec);
- if (!array.get())
- // Exception has already been thrown.
- return JSValue::encode(JSValue());
- return JSValue::encode(asObject(toJS(exec, jsConstructor->globalObject(), array.get())));
-}
-
-JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, Float64Array* object)
-{
- return toJSArrayBufferView<JSFloat64Array>(exec, globalObject, object);
-}
-
-void JSFloat64Array::indexSetter(JSC::ExecState* exec, unsigned index, JSC::JSValue value)
-{
- impl()->set(index, value.toNumber(exec));
-}
-
-static const HashTable* getJSFloat64ArrayConstructorTable(ExecState* exec)
-{
- return getHashTableForGlobalData(exec->vm(), &JSFloat64ArrayConstructorTable);
-}
-
-const ClassInfo JSFloat64ArrayConstructor::s_info = { "Float64ArrayConstructor", &Base::s_info, 0, getJSFloat64ArrayConstructorTable, CREATE_METHOD_TABLE(JSFloat64ArrayConstructor) };
-
-JSFloat64ArrayConstructor::JSFloat64ArrayConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
- : DOMConstructorObject(structure, globalObject)
-{
-}
-
-void JSFloat64ArrayConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
-{
- Base::finishCreation(exec->vm());
- ASSERT(inherits(info()));
- putDirect(exec->vm(), exec->propertyNames().prototype, JSFloat64ArrayPrototype::self(exec, globalObject), DontDelete | ReadOnly);
- putDirect(exec->vm(), exec->propertyNames().length, jsNumber(1), ReadOnly | DontDelete | DontEnum);
-}
-
-bool JSFloat64ArrayConstructor::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
-{
- return getStaticValueSlot<JSFloat64ArrayConstructor, JSDOMWrapper>(exec, getJSFloat64ArrayConstructorTable(exec), jsCast<JSFloat64ArrayConstructor*>(object), propertyName, slot);
-}
-
-bool JSFloat64ArrayConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor)
-{
- return getStaticValueDescriptor<JSFloat64ArrayConstructor, JSDOMWrapper>(exec, getJSFloat64ArrayConstructorTable(exec), jsCast<JSFloat64ArrayConstructor*>(object), propertyName, descriptor);
-}
-
-ConstructType JSFloat64ArrayConstructor::getConstructData(JSCell*, ConstructData& constructData)
-{
- constructData.native.function = constructJSFloat64Array;
- return ConstructType::Host;
-}
-
-/* Hash table for prototype */
-
-static const HashTableValue JSFloat64ArrayPrototypeTableValues[] =
-{
- { "foo", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsFloat64ArrayPrototypeFunctionFoo), (intptr_t)1, NoIntrinsic },
- { "set", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsFloat64ArrayPrototypeFunctionSet), (intptr_t)0, NoIntrinsic },
- { 0, 0, 0, 0, NoIntrinsic }
-};
-
-static const HashTable JSFloat64ArrayPrototypeTable = { 4, 3, JSFloat64ArrayPrototypeTableValues, 0 };
-static const HashTable* getJSFloat64ArrayPrototypeTable(ExecState* exec)
-{
- return getHashTableForGlobalData(exec->vm(), &JSFloat64ArrayPrototypeTable);
-}
-
-const ClassInfo JSFloat64ArrayPrototype::s_info = { "Float64ArrayPrototype", &Base::s_info, 0, getJSFloat64ArrayPrototypeTable, CREATE_METHOD_TABLE(JSFloat64ArrayPrototype) };
-
-JSObject* JSFloat64ArrayPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
-{
- return getDOMPrototype<JSFloat64Array>(exec, globalObject);
-}
-
-bool JSFloat64ArrayPrototype::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
-{
- JSFloat64ArrayPrototype* thisObject = jsCast<JSFloat64ArrayPrototype*>(object);
- return getStaticFunctionSlot<JSObject>(exec, getJSFloat64ArrayPrototypeTable(exec), thisObject, propertyName, slot);
-}
-
-bool JSFloat64ArrayPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor)
-{
- JSFloat64ArrayPrototype* thisObject = jsCast<JSFloat64ArrayPrototype*>(object);
- return getStaticFunctionDescriptor<JSObject>(exec, getJSFloat64ArrayPrototypeTable(exec), thisObject, propertyName, descriptor);
-}
-
-static const HashTable* getJSFloat64ArrayTable(ExecState* exec)
-{
- return getHashTableForGlobalData(exec->vm(), &JSFloat64ArrayTable);
-}
-
-const ClassInfo JSFloat64Array::s_info = { "Float64Array", &Base::s_info, 0, getJSFloat64ArrayTable , CREATE_METHOD_TABLE(JSFloat64Array) };
-
-JSFloat64Array::JSFloat64Array(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<Float64Array> impl)
- : JSArrayBufferView(structure, globalObject, impl)
-{
-}
-
-void JSFloat64Array::finishCreation(VM& vm)
-{
- Base::finishCreation(vm);
- TypedArrayDescriptor descriptor(JSFloat64Array::info(), OBJECT_OFFSETOF(JSFloat64Array, m_storage), OBJECT_OFFSETOF(JSFloat64Array, m_storageLength));
- vm.registerTypedArrayDescriptor(impl(), descriptor);
- m_storage = impl()->data();
- m_storageLength = impl()->length();
- ASSERT(inherits(info()));
-}
-
-JSObject* JSFloat64Array::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
-{
- return JSFloat64ArrayPrototype::create(exec->vm(), globalObject, JSFloat64ArrayPrototype::createStructure(exec->vm(), globalObject, JSArrayBufferViewPrototype::self(exec, globalObject)));
-}
-
-bool JSFloat64Array::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
-{
- JSFloat64Array* thisObject = jsCast<JSFloat64Array*>(object);
- ASSERT_GC_OBJECT_INHERITS(thisObject, info());
- std::optional<uint32_t> index = parseIndex(propertyName);
- if (index && index.value() < static_cast<Float64Array*>(thisObject->impl())->length()) {
- slot.setValue(thisObject, thisObject->getByIndex(exec, index.value()));
- return true;
- }
- return getStaticValueSlot<JSFloat64Array, Base>(exec, getJSFloat64ArrayTable(exec), thisObject, propertyName, slot);
-}
-
-bool JSFloat64Array::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor)
-{
- JSFloat64Array* thisObject = jsCast<JSFloat64Array*>(object);
- ASSERT_GC_OBJECT_INHERITS(thisObject, info());
- std::optional<uint32_t> index = parseIndex(propertyName);
- if (index && index.value() < static_cast<Float64Array*>(thisObject->impl())->length()) {
- descriptor.setDescriptor(thisObject->getByIndex(exec, index.value()), DontDelete);
- return true;
- }
- return getStaticValueDescriptor<JSFloat64Array, Base>(exec, getJSFloat64ArrayTable(exec), thisObject, propertyName, descriptor);
-}
-
-bool JSFloat64Array::getOwnPropertySlotByIndex(JSObject* object, ExecState* exec, unsigned index, PropertySlot& slot)
-{
- JSFloat64Array* thisObject = jsCast<JSFloat64Array*>(object);
- ASSERT_GC_OBJECT_INHERITS(thisObject, info());
- if (index < static_cast<Float64Array*>(thisObject->impl())->length()) {
- slot.setValue(thisObject, thisObject->getByIndex(exec, index));
- return true;
- }
- return Base::getOwnPropertySlotByIndex(thisObject, exec, index, slot);
-}
-
-JSValue jsFloat64ArrayConstructor(ExecState* exec, JSValue slotBase, PropertyName)
-{
- JSFloat64Array* domObject = jsCast<JSFloat64Array*>(asObject(slotBase));
- return JSFloat64Array::getConstructor(exec, domObject->globalObject());
-}
-
-void JSFloat64Array::put(JSCell* cell, ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot& slot)
-{
- JSFloat64Array* thisObject = jsCast<JSFloat64Array*>(cell);
- ASSERT_GC_OBJECT_INHERITS(thisObject, info());
- if (std::optional<uint32_t> index = parseIndex(propertyName)) {
- thisObject->indexSetter(exec, index.value(), value);
- return;
- }
- Base::put(thisObject, exec, propertyName, value, slot);
-}
-
-void JSFloat64Array::putByIndex(JSCell* cell, ExecState* exec, unsigned index, JSValue value, bool shouldThrow)
-{
- JSFloat64Array* thisObject = jsCast<JSFloat64Array*>(cell);
- ASSERT_GC_OBJECT_INHERITS(thisObject, info());
- if (index <= MAX_ARRAY_INDEX) {
- UNUSED_PARAM(shouldThrow);
- thisObject->indexSetter(exec, index, value);
- return;
- }
- Base::putByIndex(cell, exec, index, value, shouldThrow);
-}
-
-void JSFloat64Array::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
-{
- JSFloat64Array* thisObject = jsCast<JSFloat64Array*>(object);
- ASSERT_GC_OBJECT_INHERITS(thisObject, info());
- for (unsigned i = 0; i < static_cast<Float64Array*>(thisObject->impl())->length(); ++i)
- propertyNames.add(Identifier::from(exec, i));
- Base::getOwnPropertyNames(thisObject, exec, propertyNames, mode);
-}
-
-JSValue JSFloat64Array::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
-{
- return getDOMConstructor<JSFloat64ArrayConstructor>(exec, jsCast<JSDOMGlobalObject*>(globalObject));
-}
-
-EncodedJSValue JSC_HOST_CALL jsFloat64ArrayPrototypeFunctionFoo(ExecState* exec)
-{
- JSValue thisValue = exec->thisValue();
- if (!thisValue.inherits(JSFloat64Array::info()))
- return throwVMTypeError(exec);
- JSFloat64Array* castedThis = jsCast<JSFloat64Array*>(asObject(thisValue));
- ASSERT_GC_OBJECT_INHERITS(castedThis, JSFloat64Array::info());
- Float64Array* impl = static_cast<Float64Array*>(castedThis->impl());
- if (exec->argumentCount() < 1)
- return throwVMError(exec, createNotEnoughArgumentsError(exec));
- Float32Array* array(toFloat32Array(exec->argument(0)));
- if (exec->hadException())
- return JSValue::encode(jsUndefined());
-
- JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->foo(array)));
- return JSValue::encode(result);
-}
-
-EncodedJSValue JSC_HOST_CALL jsFloat64ArrayPrototypeFunctionSet(ExecState* exec)
-{
- JSValue thisValue = exec->thisValue();
- if (!thisValue.inherits(JSFloat64Array::info()))
- return throwVMTypeError(exec);
- JSFloat64Array* castedThis = jsCast<JSFloat64Array*>(asObject(thisValue));
- ASSERT_GC_OBJECT_INHERITS(castedThis, JSFloat64Array::info());
- return JSValue::encode(setWebGLArrayHelper<Float64Array, double>(exec, castedThis->impl()));
-}
-
-
-JSValue JSFloat64Array::getByIndex(ExecState*, unsigned index)
-{
- ASSERT_GC_OBJECT_INHERITS(this, info());
- double result = static_cast<Float64Array*>(impl())->item(index);
- if (std::isnan(result))
- return jsNaN();
- return JSValue(result);
-}
-
-Float64Array* toFloat64Array(JSC::JSValue value)
-{
- return value.inherits(JSFloat64Array::info()) ? jsCast<JSFloat64Array*>(asObject(value))->impl() : 0;
-}
-
-}
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSFloat64Arrayh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/bindings/scripts/test/JS/JSFloat64Array.h (210322 => 210323)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSFloat64Array.h        2017-01-05 08:08:11 UTC (rev 210322)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSFloat64Array.h        2017-01-05 08:46:10 UTC (rev 210323)
</span><span class="lines">@@ -1,136 +0,0 @@
</span><del>-/*
- This file is part of the WebKit open source project.
- This file has been generated by generate-bindings.pl. DO NOT MODIFY!
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- along with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#ifndef JSFloat64Array_h
-#define JSFloat64Array_h
-
-#include "JSArrayBufferView.h"
-#include "JSDOMBinding.h"
-#include <runtime/Float64Array.h>
-#include <runtime/JSObject.h>
-
-namespace WebCore {
-
-class JSFloat64Array : public JSArrayBufferView {
-public:
- typedef JSArrayBufferView Base;
- static JSFloat64Array* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<Float64Array> impl)
- {
- JSFloat64Array* ptr = new (NotNull, JSC::allocateCell<JSFloat64Array>(globalObject->vm().heap)) JSFloat64Array(structure, globalObject, impl);
- ptr->finishCreation(globalObject->vm());
- return ptr;
- }
-
- static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*);
- static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
- static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertyDescriptor&);
- static bool getOwnPropertySlotByIndex(JSC::JSObject*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);
- static void put(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&);
- static void putByIndex(JSC::JSCell*, JSC::ExecState*, unsigned propertyName, JSC::JSValue, bool shouldThrow);
- DECLARE_INFO;
-
- static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
- {
- return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
- }
-
- static void getOwnPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode = JSC::EnumerationMode());
- static JSC::JSValue getConstructor(JSC::ExecState*, JSC::JSGlobalObject*);
- Float64Array* impl() const
- {
- return static_cast<Float64Array*>(Base::impl());
- }
- static const JSC::TypedArrayType TypedArrayStorageType = JSC::TypedArrayFloat64;
- intptr_t m_storageLength;
- void* m_storage;
-protected:
- JSFloat64Array(JSC::Structure*, JSDOMGlobalObject*, PassRefPtr<Float64Array>);
- void finishCreation(JSC::VM&);
- static const unsigned StructureFlags = JSC::OverridesGetPropertyNames | JSC::OverridesGetOwnPropertySlot | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | Base::StructureFlags;
- JSC::JSValue getByIndex(JSC::ExecState*, unsigned index);
- void indexSetter(JSC::ExecState*, unsigned index, JSC::JSValue);
-};
-
-JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, Float64Array*);
-Float64Array* toFloat64Array(JSC::JSValue);
-
-class JSFloat64ArrayPrototype : public JSC::JSNonFinalObject {
-public:
- typedef JSC::JSNonFinalObject Base;
- static JSC::JSObject* self(JSC::ExecState*, JSC::JSGlobalObject*);
- static JSFloat64ArrayPrototype* create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)
- {
- JSFloat64ArrayPrototype* ptr = new (NotNull, JSC::allocateCell<JSFloat64ArrayPrototype>(vm.heap)) JSFloat64ArrayPrototype(vm, globalObject, structure);
- ptr->finishCreation(vm);
- return ptr;
- }
-
- DECLARE_INFO;
- static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
- static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertyDescriptor&);
- static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
- {
- return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
- }
-
-private:
- JSFloat64ArrayPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(vm, structure) { }
-protected:
- static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
-};
-
-class JSFloat64ArrayConstructor : public DOMConstructorObject {
-private:
- JSFloat64ArrayConstructor(JSC::Structure*, JSDOMGlobalObject*);
- void finishCreation(JSC::ExecState*, JSDOMGlobalObject*);
-
-public:
- typedef DOMConstructorObject Base;
- static JSFloat64ArrayConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject)
- {
- JSFloat64ArrayConstructor* ptr = new (NotNull, JSC::allocateCell<JSFloat64ArrayConstructor>(*exec->heap())) JSFloat64ArrayConstructor(structure, globalObject);
- ptr->finishCreation(exec, globalObject);
- return ptr;
- }
-
- static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
- static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertyDescriptor&);
- DECLARE_INFO;
- static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
- {
- return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
- }
-protected:
- static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
- static JSC::EncodedJSValue JSC_HOST_CALL constructJSFloat64Array(JSC::ExecState*);
- static JSC::ConstructType getConstructData(JSC::JSCell*, JSC::ConstructData&);
-};
-
-// Functions
-
-JSC::EncodedJSValue JSC_HOST_CALL jsFloat64ArrayPrototypeFunctionFoo(JSC::ExecState*);
-JSC::EncodedJSValue JSC_HOST_CALL jsFloat64ArrayPrototypeFunctionSet(JSC::ExecState*);
-// Attributes
-
-JSC::JSValue jsFloat64ArrayConstructor(JSC::ExecState*, JSC::JSValue, JSC::PropertyName);
-
-} // namespace WebCore
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoresvgSVGElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGElement.cpp (210322 => 210323)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGElement.cpp        2017-01-05 08:08:11 UTC (rev 210322)
+++ trunk/Source/WebCore/svg/SVGElement.cpp        2017-01-05 08:46:10 UTC (rev 210323)
</span><span class="lines">@@ -537,7 +537,7 @@
</span><span class="cx"> if (containingShadowRoot())
</span><span class="cx"> return Node::removeEventListener(eventType, listener, options);
</span><span class="cx">
</span><del>- // EventTarget::removeEventListener creates a PassRefPtr around the given EventListener
</del><ins>+ // EventTarget::removeEventListener creates a Ref around the given EventListener
</ins><span class="cx"> // object when creating a temporary RegisteredEventListener object used to look up the
</span><span class="cx"> // event listener in a cache. If we want to be able to call removeEventListener() multiple
</span><span class="cx"> // times on different nodes, we have to delay its immediate destruction, which would happen
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.cpp (210322 => 210323)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.cpp        2017-01-05 08:08:11 UTC (rev 210322)
+++ trunk/Source/WebCore/testing/Internals.cpp        2017-01-05 08:46:10 UTC (rev 210323)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx"> * Copyright (C) 2012 Google Inc. All rights reserved.
</span><del>- * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013-2017 Apple Inc. All rights reserved.
</ins><span class="cx"> *
</span><span class="cx"> * Redistribution and use in source and binary forms, with or without
</span><span class="cx"> * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -811,7 +811,7 @@
</span><span class="cx"> return element.renderer() && element.renderer()->hasPausedImageAnimations();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-RefPtr<CSSComputedStyleDeclaration> Internals::computedStyleIncludingVisitedInfo(Element& element) const
</del><ins>+Ref<CSSComputedStyleDeclaration> Internals::computedStyleIncludingVisitedInfo(Element& element) const
</ins><span class="cx"> {
</span><span class="cx"> bool allowVisitedStyle = true;
</span><span class="cx"> return CSSComputedStyleDeclaration::create(element, allowVisitedStyle);
</span><span class="lines">@@ -1433,7 +1433,7 @@
</span><span class="cx"> return range.text();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-RefPtr<Range> Internals::subrange(Range& range, int rangeLocation, int rangeLength)
</del><ins>+Ref<Range> Internals::subrange(Range& range, int rangeLocation, int rangeLength)
</ins><span class="cx"> {
</span><span class="cx"> return TextIterator::subrange(&range, rangeLocation, rangeLength);
</span><span class="cx"> }
</span><span class="lines">@@ -1441,7 +1441,7 @@
</span><span class="cx"> ExceptionOr<RefPtr<Range>> Internals::rangeForDictionaryLookupAtLocation(int x, int y)
</span><span class="cx"> {
</span><span class="cx"> #if PLATFORM(MAC)
</span><del>- Document* document = contextDocument();
</del><ins>+ auto* document = contextDocument();
</ins><span class="cx"> if (!document || !document->frame())
</span><span class="cx"> return Exception { INVALID_ACCESS_ERR };
</span><span class="cx">
</span><span class="lines">@@ -1856,11 +1856,10 @@
</span><span class="cx">
</span><span class="cx"> RefPtr<DOMWindow> Internals::openDummyInspectorFrontend(const String& url)
</span><span class="cx"> {
</span><del>- Page* inspectedPage = contextDocument()->frame()->page();
- RefPtr<DOMWindow> window = inspectedPage->mainFrame().document()->domWindow();
- RefPtr<DOMWindow> frontendWindow = window->open(url, "", "", *window, *window);
</del><ins>+ auto* inspectedPage = contextDocument()->frame()->page();
+ auto* window = inspectedPage->mainFrame().document()->domWindow();
+ auto frontendWindow = window->open(url, "", "", *window, *window);
</ins><span class="cx"> m_inspectorFrontend = std::make_unique<InspectorStubFrontend>(*inspectedPage, frontendWindow.copyRef());
</span><del>-
</del><span class="cx"> return frontendWindow;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2563,13 +2562,13 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">
</span><del>-RefPtr<ArrayBuffer> Internals::serializeObject(PassRefPtr<SerializedScriptValue> value) const
</del><ins>+Ref<ArrayBuffer> Internals::serializeObject(const RefPtr<SerializedScriptValue>& value) const
</ins><span class="cx"> {
</span><span class="cx"> auto& bytes = value->data();
</span><span class="cx"> return ArrayBuffer::create(bytes.data(), bytes.size());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-RefPtr<SerializedScriptValue> Internals::deserializeBuffer(ArrayBuffer& buffer) const
</del><ins>+Ref<SerializedScriptValue> Internals::deserializeBuffer(ArrayBuffer& buffer) const
</ins><span class="cx"> {
</span><span class="cx"> Vector<uint8_t> bytes;
</span><span class="cx"> bytes.append(static_cast<const uint8_t*>(buffer.data()), buffer.byteLength());
</span><span class="lines">@@ -2578,8 +2577,7 @@
</span><span class="cx">
</span><span class="cx"> bool Internals::isFromCurrentWorld(JSC::JSValue value) const
</span><span class="cx"> {
</span><del>- ASSERT(value);
- JSC::ExecState& state = *contextDocument()->vm().topCallFrame;
</del><ins>+ auto& state = *contextDocument()->vm().topCallFrame;
</ins><span class="cx"> return !value.isObject() || &worldForDOMObject(asObject(value)) == &currentWorld(&state);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2600,7 +2598,7 @@
</span><span class="cx">
</span><span class="cx"> void Internals::enableAutoSizeMode(bool enabled, int minimumWidth, int minimumHeight, int maximumWidth, int maximumHeight)
</span><span class="cx"> {
</span><del>- Document* document = contextDocument();
</del><ins>+ auto* document = contextDocument();
</ins><span class="cx"> if (!document || !document->view())
</span><span class="cx"> return;
</span><span class="cx"> document->view()->enableAutoSizeMode(enabled, IntSize(minimumWidth, minimumHeight), IntSize(maximumWidth, maximumHeight));
</span><span class="lines">@@ -2607,21 +2605,24 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(LEGACY_ENCRYPTED_MEDIA)
</span><ins>+
</ins><span class="cx"> void Internals::initializeMockCDM()
</span><span class="cx"> {
</span><del>- CDM::registerCDMFactory([](CDM* cdm) { return std::make_unique<MockCDM>(cdm); },
</del><ins>+ CDM::registerCDMFactory([] (CDM* cdm) { return std::make_unique<MockCDM>(cdm); },
</ins><span class="cx"> MockCDM::supportsKeySystem, MockCDM::supportsKeySystemAndMimeType);
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if ENABLE(ENCRYPTED_MEDIA)
</span><ins>+
</ins><span class="cx"> Ref<MockCDMFactory> Internals::registerMockCDM()
</span><span class="cx"> {
</span><span class="cx"> return MockCDMFactory::create();
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx">
</span><del>-
</del><span class="cx"> String Internals::markerTextForListItem(Element& element)
</span><span class="cx"> {
</span><span class="cx"> return WebCore::markerTextForListItem(&element);
</span><span class="lines">@@ -3487,10 +3488,9 @@
</span><span class="cx">
</span><span class="cx"> RefPtr<GCObservation> Internals::observeGC(JSC::JSValue value)
</span><span class="cx"> {
</span><del>- if (!value || value.isNull() || value.isUndefined() || !value.getObject())
</del><ins>+ if (!value.isObject())
</ins><span class="cx"> return nullptr;
</span><del>-
- return GCObservation::create(value.getObject());
</del><ins>+ return GCObservation::create(asObject(value));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void Internals::setUserInterfaceLayoutDirection(UserInterfaceLayoutDirection userInterfaceLayoutDirection)
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.h (210322 => 210323)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.h        2017-01-05 08:08:11 UTC (rev 210322)
+++ trunk/Source/WebCore/testing/Internals.h        2017-01-05 08:46:10 UTC (rev 210323)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx"> * Copyright (C) 2012 Google Inc. All rights reserved.
</span><del>- * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013-2017 Apple Inc. All rights reserved.
</ins><span class="cx"> *
</span><span class="cx"> * Redistribution and use in source and binary forms, with or without
</span><span class="cx"> * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -111,7 +111,7 @@
</span><span class="cx"> void clearPageCache();
</span><span class="cx"> unsigned pageCacheSize() const;
</span><span class="cx">
</span><del>- RefPtr<CSSComputedStyleDeclaration> computedStyleIncludingVisitedInfo(Element&) const;
</del><ins>+ Ref<CSSComputedStyleDeclaration> computedStyleIncludingVisitedInfo(Element&) const;
</ins><span class="cx">
</span><span class="cx"> Node* ensureUserAgentShadowRoot(Element& host);
</span><span class="cx"> Node* shadowRoot(Element& host);
</span><span class="lines">@@ -199,7 +199,7 @@
</span><span class="cx"> unsigned locationFromRange(Element& scope, const Range&);
</span><span class="cx"> unsigned lengthFromRange(Element& scope, const Range&);
</span><span class="cx"> String rangeAsText(const Range&);
</span><del>- RefPtr<Range> subrange(Range&, int rangeLocation, int rangeLength);
</del><ins>+ Ref<Range> subrange(Range&, int rangeLocation, int rangeLength);
</ins><span class="cx"> ExceptionOr<RefPtr<Range>> rangeForDictionaryLookupAtLocation(int x, int y);
</span><span class="cx">
</span><span class="cx"> ExceptionOr<void> setDelegatesScrolling(bool enabled);
</span><span class="lines">@@ -351,8 +351,8 @@
</span><span class="cx"> ExceptionOr<void> updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(Node*);
</span><span class="cx"> unsigned layoutCount() const;
</span><span class="cx">
</span><del>- RefPtr<ArrayBuffer> serializeObject(PassRefPtr<SerializedScriptValue>) const;
- RefPtr<SerializedScriptValue> deserializeBuffer(ArrayBuffer&) const;
</del><ins>+ Ref<ArrayBuffer> serializeObject(const RefPtr<SerializedScriptValue>&) const;
+ Ref<SerializedScriptValue> deserializeBuffer(ArrayBuffer&) const;
</ins><span class="cx">
</span><span class="cx"> bool isFromCurrentWorld(JSC::JSValue) const;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalsidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.idl (210322 => 210323)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.idl        2017-01-05 08:08:11 UTC (rev 210322)
+++ trunk/Source/WebCore/testing/Internals.idl        2017-01-05 08:46:10 UTC (rev 210323)
</span><span class="lines">@@ -153,7 +153,7 @@
</span><span class="cx"> [MayThrowException] DOMString inspectorHighlightObject();
</span><span class="cx">
</span><span class="cx"> [MayThrowException] unsigned long markerCountForNode(Node node, DOMString markerType);
</span><del>- [MayThrowException] Range markerRangeForNode(Node node, DOMString markerType, unsigned long index);
</del><ins>+ [MayThrowException] Range? markerRangeForNode(Node node, DOMString markerType, unsigned long index);
</ins><span class="cx"> [MayThrowException] DOMString markerDescriptionForNode(Node node, DOMString markerType, unsigned long index);
</span><span class="cx"> [MayThrowException] DOMString dumpMarkerRects(DOMString markerType);
</span><span class="cx"> void addTextMatchMarker(Range range, boolean isActive);
</span><span class="lines">@@ -187,12 +187,12 @@
</span><span class="cx">
</span><span class="cx"> [MayThrowException] void scrollElementToRect(Element element, long x, long y, long w, long h);
</span><span class="cx">
</span><del>- Range rangeFromLocationAndLength(Element scope, long rangeLocation, long rangeLength);
</del><ins>+ Range? rangeFromLocationAndLength(Element scope, long rangeLocation, long rangeLength);
</ins><span class="cx"> unsigned long locationFromRange(Element scope, Range range);
</span><span class="cx"> unsigned long lengthFromRange(Element scope, Range range);
</span><span class="cx"> DOMString rangeAsText(Range range);
</span><span class="cx"> Range subrange(Range range, long rangeLocation, long rangeLength);
</span><del>- [MayThrowException] Range rangeForDictionaryLookupAtLocation(long x, long y);
</del><ins>+ [MayThrowException] Range? rangeForDictionaryLookupAtLocation(long x, long y);
</ins><span class="cx">
</span><span class="cx"> [MayThrowException] void setDelegatesScrolling(boolean enabled);
</span><span class="cx">
</span><span class="lines">@@ -208,7 +208,7 @@
</span><span class="cx"> [MayThrowException] unsigned long wheelEventHandlerCount();
</span><span class="cx"> [MayThrowException] unsigned long touchEventHandlerCount();
</span><span class="cx">
</span><del>- [MayThrowException] NodeList nodesFromRect(Document document, long x, long y,
</del><ins>+ [MayThrowException] NodeList? nodesFromRect(Document document, long x, long y,
</ins><span class="cx"> unsigned long topPadding, unsigned long rightPadding, unsigned long bottomPadding, unsigned long leftPadding,
</span><span class="cx"> boolean ignoreClipping, boolean allowShadowContent, boolean allowChildFrameContent);
</span><span class="cx">
</span><span class="lines">@@ -253,7 +253,7 @@
</span><span class="cx">
</span><span class="cx"> [MayThrowException] DOMString scrollingStateTreeAsText();
</span><span class="cx"> [MayThrowException] DOMString mainThreadScrollingReasons(); // FIXME: rename to synchronousScrollingReasons().
</span><del>- [MayThrowException] ClientRectList nonFastScrollableRects();
</del><ins>+ [MayThrowException] ClientRectList? nonFastScrollableRects();
</ins><span class="cx">
</span><span class="cx"> [MayThrowException] DOMString repaintRectsAsText();
</span><span class="cx">
</span><span class="lines">@@ -283,7 +283,7 @@
</span><span class="cx">
</span><span class="cx"> unsigned long numberOfLiveNodes();
</span><span class="cx"> unsigned long numberOfLiveDocuments();
</span><del>- DOMWindow openDummyInspectorFrontend(DOMString url);
</del><ins>+ DOMWindow? openDummyInspectorFrontend(DOMString url);
</ins><span class="cx"> void closeDummyInspectorFrontend();
</span><span class="cx"> [MayThrowException] void setInspectorIsUnderTest(boolean isUnderTest);
</span><span class="cx">
</span><span class="lines">@@ -369,7 +369,7 @@
</span><span class="cx"> DOMString toolTipFromElement(Element element);
</span><span class="cx">
</span><span class="cx"> SerializedScriptValue deserializeBuffer(ArrayBuffer buffer);
</span><del>- ArrayBuffer serializeObject(SerializedScriptValue obj);
</del><ins>+ ArrayBuffer serializeObject(SerializedScriptValue object);
</ins><span class="cx">
</span><span class="cx"> boolean isFromCurrentWorld(any obj);
</span><span class="cx">
</span><span class="lines">@@ -446,7 +446,7 @@
</span><span class="cx">
</span><span class="cx"> void setPageDefersLoading(boolean defersLoading);
</span><span class="cx">
</span><del>- File createFile(DOMString url);
</del><ins>+ File? createFile(DOMString url);
</ins><span class="cx"> void queueMicroTask(long testNumber);
</span><span class="cx"> boolean testPreloaderSettingViewport();
</span><span class="cx">
</span><span class="lines">@@ -488,7 +488,7 @@
</span><span class="cx">
</span><span class="cx"> boolean isProcessingUserGesture();
</span><span class="cx">
</span><del>- GCObservation observeGC(any observed);
</del><ins>+ GCObservation? observeGC(any observed);
</ins><span class="cx">
</span><span class="cx"> void setUserInterfaceLayoutDirection(UserInterfaceLayoutDirection userInterfaceLayoutDirection);
</span><span class="cx"> void setBaseWritingDirection(BaseWritingDirection direction);
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersDedicatedWorkerThreadcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/DedicatedWorkerThread.cpp (210322 => 210323)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/DedicatedWorkerThread.cpp        2017-01-05 08:08:11 UTC (rev 210322)
+++ trunk/Source/WebCore/workers/DedicatedWorkerThread.cpp        2017-01-05 08:46:10 UTC (rev 210323)
</span><span class="lines">@@ -48,9 +48,9 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-Ref<WorkerGlobalScope> DedicatedWorkerThread::createWorkerGlobalScope(const URL& url, const String& identifier, const String& userAgent, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, PassRefPtr<SecurityOrigin> topOrigin)
</del><ins>+Ref<WorkerGlobalScope> DedicatedWorkerThread::createWorkerGlobalScope(const URL& url, const String& identifier, const String& userAgent, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, RefPtr<SecurityOrigin>&& topOrigin)
</ins><span class="cx"> {
</span><del>- return DedicatedWorkerGlobalScope::create(url, identifier, userAgent, *this, contentSecurityPolicyResponseHeaders, shouldBypassMainWorldContentSecurityPolicy, topOrigin, idbConnectionProxy(), socketProvider());
</del><ins>+ return DedicatedWorkerGlobalScope::create(url, identifier, userAgent, *this, contentSecurityPolicyResponseHeaders, shouldBypassMainWorldContentSecurityPolicy, WTFMove(topOrigin), idbConnectionProxy(), socketProvider());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void DedicatedWorkerThread::runEventLoop()
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersDedicatedWorkerThreadh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/DedicatedWorkerThread.h (210322 => 210323)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/DedicatedWorkerThread.h        2017-01-05 08:08:11 UTC (rev 210322)
+++ trunk/Source/WebCore/workers/DedicatedWorkerThread.h        2017-01-05 08:46:10 UTC (rev 210323)
</span><span class="lines">@@ -49,7 +49,7 @@
</span><span class="cx"> WorkerObjectProxy& workerObjectProxy() const { return m_workerObjectProxy; }
</span><span class="cx">
</span><span class="cx"> protected:
</span><del>- Ref<WorkerGlobalScope> createWorkerGlobalScope(const URL&, const String& identifier, const String& userAgent, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, PassRefPtr<SecurityOrigin> topOrigin) override;
</del><ins>+ Ref<WorkerGlobalScope> createWorkerGlobalScope(const URL&, const String& identifier, const String& userAgent, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, RefPtr<SecurityOrigin>&& topOrigin) override;
</ins><span class="cx"> void runEventLoop() override;
</span><span class="cx">
</span><span class="cx"> private:
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersWorkercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/Worker.cpp (210322 => 210323)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/Worker.cpp        2017-01-05 08:08:11 UTC (rev 210322)
+++ trunk/Source/WebCore/workers/Worker.cpp        2017-01-05 08:46:10 UTC (rev 210323)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2008, 2010 Apple Inc. All Rights Reserved.
</del><ins>+ * Copyright (C) 2008-2017 Apple Inc. All Rights Reserved.
</ins><span class="cx"> * Copyright (C) 2009 Google Inc. All Rights Reserved.
</span><span class="cx"> *
</span><span class="cx"> * Redistribution and use in source and binary forms, with or without
</span><span class="lines">@@ -54,7 +54,7 @@
</span><span class="cx"> inline Worker::Worker(ScriptExecutionContext& context, JSC::RuntimeFlags runtimeFlags)
</span><span class="cx"> : ActiveDOMObject(&context)
</span><span class="cx"> , m_identifier("worker:" + Inspector::IdentifiersFactory::createIdentifier())
</span><del>- , m_contextProxy(WorkerGlobalScopeProxy::create(this))
</del><ins>+ , m_contextProxy(WorkerGlobalScopeProxy::create(*this))
</ins><span class="cx"> , m_runtimeFlags(runtimeFlags)
</span><span class="cx"> {
</span><span class="cx"> if (!allWorkers) {
</span><span class="lines">@@ -62,7 +62,7 @@
</span><span class="cx"> networkStateNotifier().addNetworkStateChangeListener(networkStateChanged);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- HashSet<Worker*>::AddResult addResult = allWorkers->add(this);
</del><ins>+ auto addResult = allWorkers->add(this);
</ins><span class="cx"> ASSERT_UNUSED(addResult, addResult.isNewEntry);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -98,7 +98,7 @@
</span><span class="cx"> ASSERT(isMainThread());
</span><span class="cx"> ASSERT(scriptExecutionContext()); // The context is protected by worker context proxy, so it cannot be destroyed while a Worker exists.
</span><span class="cx"> allWorkers->remove(this);
</span><del>- m_contextProxy->workerObjectDestroyed();
</del><ins>+ m_contextProxy.workerObjectDestroyed();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> ExceptionOr<void> Worker::postMessage(JSC::ExecState& state, JSC::JSValue messageValue, Vector<JSC::Strong<JSC::JSObject>>&& transfer)
</span><span class="lines">@@ -112,13 +112,13 @@
</span><span class="cx"> auto channels = MessagePort::disentanglePorts(WTFMove(ports));
</span><span class="cx"> if (channels.hasException())
</span><span class="cx"> return channels.releaseException();
</span><del>- m_contextProxy->postMessageToWorkerGlobalScope(message.releaseReturnValue(), channels.releaseReturnValue());
</del><ins>+ m_contextProxy.postMessageToWorkerGlobalScope(message.releaseReturnValue(), channels.releaseReturnValue());
</ins><span class="cx"> return { };
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void Worker::terminate()
</span><span class="cx"> {
</span><del>- m_contextProxy->terminateWorkerGlobalScope();
</del><ins>+ m_contextProxy.terminateWorkerGlobalScope();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool Worker::canSuspendForDocumentSuspension() const
</span><span class="lines">@@ -139,12 +139,12 @@
</span><span class="cx">
</span><span class="cx"> bool Worker::hasPendingActivity() const
</span><span class="cx"> {
</span><del>- return m_contextProxy->hasPendingActivity() || ActiveDOMObject::hasPendingActivity();
</del><ins>+ return m_contextProxy.hasPendingActivity() || ActiveDOMObject::hasPendingActivity();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void Worker::notifyNetworkStateChange(bool isOnLine)
</span><span class="cx"> {
</span><del>- m_contextProxy->notifyNetworkStateChange(isOnLine);
</del><ins>+ m_contextProxy.notifyNetworkStateChange(isOnLine);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void Worker::didReceiveResponse(unsigned long identifier, const ResourceResponse& response)
</span><span class="lines">@@ -161,7 +161,7 @@
</span><span class="cx"> dispatchEvent(Event::create(eventNames().errorEvent, false, true));
</span><span class="cx"> else {
</span><span class="cx"> const ContentSecurityPolicyResponseHeaders& contentSecurityPolicyResponseHeaders = m_contentSecurityPolicyResponseHeaders ? m_contentSecurityPolicyResponseHeaders.value() : scriptExecutionContext()->contentSecurityPolicy()->responseHeaders();
</span><del>- m_contextProxy->startWorkerGlobalScope(m_scriptLoader->url(), scriptExecutionContext()->userAgent(m_scriptLoader->url()), m_scriptLoader->script(), contentSecurityPolicyResponseHeaders, m_shouldBypassMainWorldContentSecurityPolicy, m_runtimeFlags);
</del><ins>+ m_contextProxy.startWorkerGlobalScope(m_scriptLoader->url(), scriptExecutionContext()->userAgent(m_scriptLoader->url()), m_scriptLoader->script(), contentSecurityPolicyResponseHeaders, m_shouldBypassMainWorldContentSecurityPolicy, m_runtimeFlags);
</ins><span class="cx"> InspectorInstrumentation::scriptImported(*scriptExecutionContext(), m_scriptLoader->identifier(), m_scriptLoader->script());
</span><span class="cx"> }
</span><span class="cx"> m_scriptLoader = nullptr;
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersWorkerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/Worker.h (210322 => 210323)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/Worker.h        2017-01-05 08:08:11 UTC (rev 210322)
+++ trunk/Source/WebCore/workers/Worker.h        2017-01-05 08:46:10 UTC (rev 210323)
</span><span class="lines">@@ -80,7 +80,7 @@
</span><span class="cx">
</span><span class="cx"> RefPtr<WorkerScriptLoader> m_scriptLoader;
</span><span class="cx"> String m_identifier;
</span><del>- WorkerGlobalScopeProxy* m_contextProxy; // The proxy outlives the worker to perform thread shutdown.
</del><ins>+ WorkerGlobalScopeProxy& m_contextProxy; // The proxy outlives the worker to perform thread shutdown.
</ins><span class="cx"> std::optional<ContentSecurityPolicyResponseHeaders> m_contentSecurityPolicyResponseHeaders;
</span><span class="cx"> bool m_shouldBypassMainWorldContentSecurityPolicy { false };
</span><span class="cx"> JSC::RuntimeFlags m_runtimeFlags;
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersWorkerGlobalScopeProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/WorkerGlobalScopeProxy.h (210322 => 210323)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/WorkerGlobalScopeProxy.h        2017-01-05 08:08:11 UTC (rev 210322)
+++ trunk/Source/WebCore/workers/WorkerGlobalScopeProxy.h        2017-01-05 08:46:10 UTC (rev 210323)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx"> * Copyright (C) 2009 Google Inc. All rights reserved.
</span><ins>+ * Copyright (C) 2017 Apple Inc. All rights reserved.
</ins><span class="cx"> *
</span><span class="cx"> * Redistribution and use in source and binary forms, with or without
</span><span class="cx"> * modification, are permitted provided that the following conditions are
</span><span class="lines">@@ -30,35 +31,29 @@
</span><span class="cx">
</span><span class="cx"> #pragma once
</span><span class="cx">
</span><del>-#include "MessagePort.h"
-#include "WorkerThread.h"
-#include <memory>
-#include <wtf/Forward.h>
</del><ins>+#include "MessagePortChannel.h"
+#include <runtime/RuntimeFlags.h>
</ins><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>- class ContentSecurityPolicyResponseHeaders;
- class URL;
- class Worker;
</del><ins>+class ContentSecurityPolicyResponseHeaders;
+class URL;
+class Worker;
</ins><span class="cx">
</span><del>- // A proxy to talk to the worker context.
- class WorkerGlobalScopeProxy {
- public:
- static WorkerGlobalScopeProxy* create(Worker*);
</del><ins>+// A proxy to talk to the worker context.
+class WorkerGlobalScopeProxy {
+public:
+ static WorkerGlobalScopeProxy& create(Worker&);
</ins><span class="cx">
</span><del>- virtual ~WorkerGlobalScopeProxy() { }
</del><ins>+ virtual void startWorkerGlobalScope(const URL& scriptURL, const String& userAgent, const String& sourceCode, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, JSC::RuntimeFlags) = 0;
+ virtual void terminateWorkerGlobalScope() = 0;
+ virtual void postMessageToWorkerGlobalScope(RefPtr<SerializedScriptValue>&&, std::unique_ptr<MessagePortChannelArray>) = 0;
+ virtual bool hasPendingActivity() const = 0;
+ virtual void workerObjectDestroyed() = 0;
+ virtual void notifyNetworkStateChange(bool isOnline) = 0;
</ins><span class="cx">
</span><del>- virtual void startWorkerGlobalScope(const URL& scriptURL, const String& userAgent, const String& sourceCode, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, JSC::RuntimeFlags) = 0;
</del><ins>+protected:
+ virtual ~WorkerGlobalScopeProxy() { }
+};
</ins><span class="cx">
</span><del>- virtual void terminateWorkerGlobalScope() = 0;
-
- virtual void postMessageToWorkerGlobalScope(RefPtr<SerializedScriptValue>&&, std::unique_ptr<MessagePortChannelArray>) = 0;
-
- virtual bool hasPendingActivity() const = 0;
-
- virtual void workerObjectDestroyed() = 0;
-
- virtual void notifyNetworkStateChange(bool isOnline) = 0;
- };
-
</del><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersWorkerMessagingProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/WorkerMessagingProxy.cpp (210322 => 210323)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/WorkerMessagingProxy.cpp        2017-01-05 08:08:11 UTC (rev 210322)
+++ trunk/Source/WebCore/workers/WorkerMessagingProxy.cpp        2017-01-05 08:46:10 UTC (rev 210323)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2008, 2016 Apple Inc. All Rights Reserved.
</del><ins>+ * Copyright (C) 2008-2017 Apple Inc. All Rights Reserved.
</ins><span class="cx"> * Copyright (C) 2009 Google Inc. All Rights Reserved.
</span><span class="cx"> *
</span><span class="cx"> * Redistribution and use in source and binary forms, with or without
</span><span class="lines">@@ -34,7 +34,6 @@
</span><span class="cx"> #include "DedicatedWorkerThread.h"
</span><span class="cx"> #include "Document.h"
</span><span class="cx"> #include "ErrorEvent.h"
</span><del>-#include "Event.h"
</del><span class="cx"> #include "EventNames.h"
</span><span class="cx"> #include "MessageEvent.h"
</span><span class="cx"> #include "PageGroup.h"
</span><span class="lines">@@ -48,21 +47,16 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-WorkerGlobalScopeProxy* WorkerGlobalScopeProxy::create(Worker* worker)
</del><ins>+WorkerGlobalScopeProxy& WorkerGlobalScopeProxy::create(Worker& worker)
</ins><span class="cx"> {
</span><del>- return new WorkerMessagingProxy(worker);
</del><ins>+ return *new WorkerMessagingProxy(worker);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-WorkerMessagingProxy::WorkerMessagingProxy(Worker* workerObject)
- : m_scriptExecutionContext(workerObject->scriptExecutionContext())
- , m_inspectorProxy(std::make_unique<WorkerInspectorProxy>(workerObject->identifier()))
- , m_workerObject(workerObject)
- , m_mayBeDestroyed(false)
- , m_unconfirmedMessageCount(0)
- , m_workerThreadHadPendingActivity(false)
- , m_askedToTerminate(false)
</del><ins>+WorkerMessagingProxy::WorkerMessagingProxy(Worker& workerObject)
+ : m_scriptExecutionContext(workerObject.scriptExecutionContext())
+ , m_inspectorProxy(std::make_unique<WorkerInspectorProxy>(workerObject.identifier()))
+ , m_workerObject(&workerObject)
</ins><span class="cx"> {
</span><del>- ASSERT(m_workerObject);
</del><span class="cx"> ASSERT((is<Document>(*m_scriptExecutionContext) && isMainThread())
</span><span class="cx"> || (is<WorkerGlobalScope>(*m_scriptExecutionContext) && currentThread() == downcast<WorkerGlobalScope>(*m_scriptExecutionContext).thread().threadID()));
</span><span class="cx"> }
</span><span class="lines">@@ -94,12 +88,12 @@
</span><span class="cx"> SocketProvider* socketProvider = nullptr;
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>- RefPtr<DedicatedWorkerThread> thread = DedicatedWorkerThread::create(scriptURL, identifier, userAgent, sourceCode, *this, *this, startMode, contentSecurityPolicyResponseHeaders, shouldBypassMainWorldContentSecurityPolicy, document.topOrigin(), proxy, socketProvider, runtimeFlags);
</del><ins>+ auto thread = DedicatedWorkerThread::create(scriptURL, identifier, userAgent, sourceCode, *this, *this, startMode, contentSecurityPolicyResponseHeaders, shouldBypassMainWorldContentSecurityPolicy, document.topOrigin(), proxy, socketProvider, runtimeFlags);
</ins><span class="cx">
</span><del>- workerThreadCreated(thread);
</del><ins>+ workerThreadCreated(thread.get());
</ins><span class="cx"> thread->start();
</span><span class="cx">
</span><del>- m_inspectorProxy->workerStarted(m_scriptExecutionContext.get(), thread.get(), scriptURL);
</del><ins>+ m_inspectorProxy->workerStarted(m_scriptExecutionContext.get(), thread.ptr(), scriptURL);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WorkerMessagingProxy::postMessageToWorkerObject(RefPtr<SerializedScriptValue>&& message, std::unique_ptr<MessagePortChannelArray> channels)
</span><span class="lines">@@ -174,9 +168,9 @@
</span><span class="cx"> });
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WorkerMessagingProxy::workerThreadCreated(PassRefPtr<DedicatedWorkerThread> workerThread)
</del><ins>+void WorkerMessagingProxy::workerThreadCreated(DedicatedWorkerThread& workerThread)
</ins><span class="cx"> {
</span><del>- m_workerThread = workerThread;
</del><ins>+ m_workerThread = &workerThread;
</ins><span class="cx">
</span><span class="cx"> if (m_askedToTerminate) {
</span><span class="cx"> // Worker.terminate() could be called from JS before the thread was created.
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersWorkerMessagingProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/WorkerMessagingProxy.h (210322 => 210323)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/WorkerMessagingProxy.h        2017-01-05 08:08:11 UTC (rev 210322)
+++ trunk/Source/WebCore/workers/WorkerMessagingProxy.h        2017-01-05 08:46:10 UTC (rev 210323)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2008 Apple Inc. All Rights Reserved.
</del><ins>+ * Copyright (C) 2008-2017 Apple Inc. All Rights Reserved.
</ins><span class="cx"> *
</span><span class="cx"> * Redistribution and use in source and binary forms, with or without
</span><span class="cx"> * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -25,79 +25,69 @@
</span><span class="cx">
</span><span class="cx"> #pragma once
</span><span class="cx">
</span><del>-#include "ScriptExecutionContext.h"
</del><span class="cx"> #include "WorkerGlobalScopeProxy.h"
</span><span class="cx"> #include "WorkerLoaderProxy.h"
</span><span class="cx"> #include "WorkerObjectProxy.h"
</span><del>-#include <memory>
-#include <wtf/Forward.h>
-#include <wtf/Noncopyable.h>
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefPtr.h>
-#include <wtf/Vector.h>
</del><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>- class ContentSecurityPolicyResponseHeaders;
- class DedicatedWorkerThread;
- class Worker;
- class WorkerInspectorProxy;
</del><ins>+class DedicatedWorkerThread;
+class WorkerInspectorProxy;
</ins><span class="cx">
</span><del>- class WorkerMessagingProxy : public WorkerGlobalScopeProxy, public WorkerObjectProxy, public WorkerLoaderProxy {
- WTF_MAKE_NONCOPYABLE(WorkerMessagingProxy); WTF_MAKE_FAST_ALLOCATED;
- public:
- explicit WorkerMessagingProxy(Worker*);
</del><ins>+class WorkerMessagingProxy final : public WorkerGlobalScopeProxy, public WorkerObjectProxy, public WorkerLoaderProxy {
+ WTF_MAKE_FAST_ALLOCATED;
+public:
+ explicit WorkerMessagingProxy(Worker&);
</ins><span class="cx">
</span><del>- // Implementations of WorkerGlobalScopeProxy.
- // (Only use these methods in the worker object thread.)
- void startWorkerGlobalScope(const URL& scriptURL, const String& userAgent, const String& sourceCode, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, JSC::RuntimeFlags) override;
- void terminateWorkerGlobalScope() override;
- void postMessageToWorkerGlobalScope(RefPtr<SerializedScriptValue>&&, std::unique_ptr<MessagePortChannelArray>) override;
- bool hasPendingActivity() const override;
- void workerObjectDestroyed() override;
- void notifyNetworkStateChange(bool isOnline) override;
</del><ins>+private:
+ virtual ~WorkerMessagingProxy();
</ins><span class="cx">
</span><del>- // Implementations of WorkerObjectProxy.
- // (Only use these methods in the worker context thread.)
- void postMessageToWorkerObject(RefPtr<SerializedScriptValue>&&, std::unique_ptr<MessagePortChannelArray>) override;
- void postExceptionToWorkerObject(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL) override;
- void postMessageToPageInspector(const String&) override;
- void confirmMessageFromWorkerObject(bool hasPendingActivity) override;
- void reportPendingActivity(bool hasPendingActivity) override;
- void workerGlobalScopeClosed() override;
- void workerGlobalScopeDestroyed() override;
</del><ins>+ // Implementations of WorkerGlobalScopeProxy.
+ // (Only use these functions in the worker object thread.)
+ void startWorkerGlobalScope(const URL& scriptURL, const String& userAgent, const String& sourceCode, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, JSC::RuntimeFlags) final;
+ void terminateWorkerGlobalScope() final;
+ void postMessageToWorkerGlobalScope(RefPtr<SerializedScriptValue>&&, std::unique_ptr<MessagePortChannelArray>) final;
+ bool hasPendingActivity() const final;
+ void workerObjectDestroyed() final;
+ void notifyNetworkStateChange(bool isOnline) final;
</ins><span class="cx">
</span><del>- // Implementation of WorkerLoaderProxy.
- // These methods are called on different threads to schedule loading
- // requests and to send callbacks back to WorkerGlobalScope.
- void postTaskToLoader(ScriptExecutionContext::Task&&) override;
- bool postTaskForModeToWorkerGlobalScope(ScriptExecutionContext::Task&&, const String& mode) override;
</del><ins>+ // Implementations of WorkerObjectProxy.
+ // (Only use these functions in the worker context thread.)
+ void postMessageToWorkerObject(RefPtr<SerializedScriptValue>&&, std::unique_ptr<MessagePortChannelArray>) final;
+ void postExceptionToWorkerObject(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL) final;
+ void postMessageToPageInspector(const String&) final;
+ void confirmMessageFromWorkerObject(bool hasPendingActivity) final;
+ void reportPendingActivity(bool hasPendingActivity) final;
+ void workerGlobalScopeClosed() final;
+ void workerGlobalScopeDestroyed() final;
</ins><span class="cx">
</span><del>- void workerThreadCreated(PassRefPtr<DedicatedWorkerThread>);
</del><ins>+ // Implementation of WorkerLoaderProxy.
+ // These functions are called on different threads to schedule loading
+ // requests and to send callbacks back to WorkerGlobalScope.
+ void postTaskToLoader(ScriptExecutionContext::Task&&) final;
+ bool postTaskForModeToWorkerGlobalScope(ScriptExecutionContext::Task&&, const String& mode) final;
</ins><span class="cx">
</span><del>- // Only use this method on the worker object thread.
- bool askedToTerminate() const { return m_askedToTerminate; }
</del><ins>+ void workerThreadCreated(DedicatedWorkerThread&);
</ins><span class="cx">
</span><del>- protected:
- virtual ~WorkerMessagingProxy();
</del><ins>+ // Only use this method on the worker object thread.
+ bool askedToTerminate() const { return m_askedToTerminate; }
</ins><span class="cx">
</span><del>- private:
- void workerGlobalScopeDestroyedInternal();
- void reportPendingActivityInternal(bool confirmingMessage, bool hasPendingActivity);
- Worker* workerObject() const { return m_workerObject; }
</del><ins>+ void workerGlobalScopeDestroyedInternal();
+ void reportPendingActivityInternal(bool confirmingMessage, bool hasPendingActivity);
+ Worker* workerObject() const { return m_workerObject; }
</ins><span class="cx">
</span><del>- RefPtr<ScriptExecutionContext> m_scriptExecutionContext;
- std::unique_ptr<WorkerInspectorProxy> m_inspectorProxy;
- Worker* m_workerObject;
- bool m_mayBeDestroyed;
- RefPtr<DedicatedWorkerThread> m_workerThread;
</del><ins>+ RefPtr<ScriptExecutionContext> m_scriptExecutionContext;
+ std::unique_ptr<WorkerInspectorProxy> m_inspectorProxy;
+ Worker* m_workerObject;
+ bool m_mayBeDestroyed { false };
+ RefPtr<DedicatedWorkerThread> m_workerThread;
</ins><span class="cx">
</span><del>- unsigned m_unconfirmedMessageCount; // Unconfirmed messages from worker object to worker thread.
- bool m_workerThreadHadPendingActivity; // The latest confirmation from worker thread reported that it was still active.
</del><ins>+ unsigned m_unconfirmedMessageCount { 0 }; // Unconfirmed messages from worker object to worker thread.
+ bool m_workerThreadHadPendingActivity { false }; // The latest confirmation from worker thread reported that it was still active.
</ins><span class="cx">
</span><del>- bool m_askedToTerminate;
</del><ins>+ bool m_askedToTerminate { false };
</ins><span class="cx">
</span><del>- Vector<std::unique_ptr<ScriptExecutionContext::Task>> m_queuedEarlyTasks; // Tasks are queued here until there's a thread object created.
- };
</del><ins>+ Vector<std::unique_ptr<ScriptExecutionContext::Task>> m_queuedEarlyTasks; // Tasks are queued here until there's a thread object created.
+};
</ins><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersWorkerThreadh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/WorkerThread.h (210322 => 210323)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/WorkerThread.h        2017-01-05 08:08:11 UTC (rev 210322)
+++ trunk/Source/WebCore/workers/WorkerThread.h        2017-01-05 08:46:10 UTC (rev 210323)
</span><span class="lines">@@ -29,7 +29,6 @@
</span><span class="cx"> #include <memory>
</span><span class="cx"> #include <runtime/RuntimeFlags.h>
</span><span class="cx"> #include <wtf/Forward.h>
</span><del>-#include <wtf/PassRefPtr.h>
</del><span class="cx"> #include <wtf/RefCounted.h>
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -84,7 +83,7 @@
</span><span class="cx"> WorkerThread(const URL&, const String& identifier, const String& userAgent, const String& sourceCode, WorkerLoaderProxy&, WorkerReportingProxy&, WorkerThreadStartMode, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin* topOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*, JSC::RuntimeFlags);
</span><span class="cx">
</span><span class="cx"> // Factory method for creating a new worker context for the thread.
</span><del>- virtual Ref<WorkerGlobalScope> createWorkerGlobalScope(const URL&, const String& identifier, const String& userAgent, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, PassRefPtr<SecurityOrigin> topOrigin) = 0;
</del><ins>+ virtual Ref<WorkerGlobalScope> createWorkerGlobalScope(const URL&, const String& identifier, const String& userAgent, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, RefPtr<SecurityOrigin>&& topOrigin) = 0;
</ins><span class="cx">
</span><span class="cx"> // Executes the event loop for the worker thread. Derived classes can override to perform actions before/after entering the event loop.
</span><span class="cx"> virtual void runEventLoop();
</span></span></pre>
</div>
</div>
</body>
</html>