WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-132401-20140430141345.patch (text/plain), 27.84 KB, created by
Zan Dobersek
on 2014-04-30 14:14:08 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Zan Dobersek
Created:
2014-04-30 14:14:08 PDT
Size:
27.84 KB
patch
obsolete
>Subversion Revision: 168033 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index efbb57be50bf94ed9dd6c1222f5f0e6dd4a2b7d3..c24bf4ef39f746b491332a4a46c4ab34666f6509 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,55 @@ >+2014-04-30 Zan Dobersek <zdobersek@igalia.com> >+ >+ Move Source/WebCore/workers/ code to std::unique_ptr >+ https://bugs.webkit.org/show_bug.cgi?id=132401 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Replace uses of OwnPtr and PassOwnPtr in code under Source/WebCore/workers (and related places) >+ with std::unique_ptr. >+ >+ * bindings/js/JSDOMWindowCustom.cpp: >+ (WebCore::JSDOMWindow::setTimeout): >+ (WebCore::JSDOMWindow::setInterval): >+ * bindings/js/JSWorkerGlobalScopeCustom.cpp: >+ (WebCore::JSWorkerGlobalScope::setTimeout): >+ (WebCore::JSWorkerGlobalScope::setInterval): >+ * bindings/js/ScheduledAction.cpp: >+ (WebCore::ScheduledAction::create): >+ * bindings/js/ScheduledAction.h: >+ * page/DOMTimer.cpp: >+ (WebCore::DOMTimer::DOMTimer): >+ (WebCore::DOMTimer::install): >+ (WebCore::DOMTimer::fired): >+ (WebCore::DOMTimer::didStop): >+ * page/DOMTimer.h: >+ * page/DOMWindow.cpp: >+ (WebCore::DOMWindow::setTimeout): >+ (WebCore::DOMWindow::setInterval): >+ * page/DOMWindow.h: >+ * workers/WorkerEventQueue.h: >+ * workers/WorkerGlobalScope.cpp: >+ (WebCore::WorkerGlobalScope::WorkerGlobalScope): >+ (WebCore::WorkerGlobalScope::setTimeout): >+ (WebCore::WorkerGlobalScope::setInterval): >+ * workers/WorkerGlobalScope.h: >+ (WebCore::WorkerGlobalScope::clearScript): >+ * workers/WorkerLoaderProxy.h: >+ * workers/WorkerMessagingProxy.h: >+ * workers/WorkerRunLoop.cpp: >+ (WebCore::WorkerRunLoop::WorkerRunLoop): >+ * workers/WorkerRunLoop.h: >+ * workers/WorkerScriptLoader.cpp: >+ (WebCore::WorkerScriptLoader::loadSynchronously): >+ (WebCore::WorkerScriptLoader::loadAsynchronously): >+ (WebCore::WorkerScriptLoader::createResourceRequest): >+ * workers/WorkerScriptLoader.h: >+ * workers/WorkerThread.cpp: >+ (WebCore::WorkerThread::WorkerThread): >+ (WebCore::WorkerThread::workerThread): >+ (WebCore::WorkerThreadStartupData::create): Deleted. >+ * workers/WorkerThread.h: >+ > 2014-04-30 Alexey Proskuryakov <ap@apple.com> > > https://bugs.webkit.org/show_bug.cgi?id=132363 >diff --git a/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp b/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp >index 6feda6f930b1146b04d8a1cc87cf8af47b23f42c..2995a6a726cdb530fb060102ce7c597b2528cebb 100644 >--- a/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp >+++ b/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp >@@ -587,7 +587,7 @@ JSValue JSDOMWindow::postMessage(ExecState* exec) > JSValue JSDOMWindow::setTimeout(ExecState* exec) > { > ContentSecurityPolicy* contentSecurityPolicy = impl().document() ? impl().document()->contentSecurityPolicy() : 0; >- OwnPtr<ScheduledAction> action = ScheduledAction::create(exec, globalObject()->world(), contentSecurityPolicy); >+ std::unique_ptr<ScheduledAction> action = ScheduledAction::create(exec, globalObject()->world(), contentSecurityPolicy); > if (exec->hadException()) > return jsUndefined(); > >@@ -597,7 +597,7 @@ JSValue JSDOMWindow::setTimeout(ExecState* exec) > int delay = exec->argument(1).toInt32(exec); > > ExceptionCode ec = 0; >- int result = impl().setTimeout(action.release(), delay, ec); >+ int result = impl().setTimeout(std::move(action), delay, ec); > setDOMException(exec, ec); > > return jsNumber(result); >@@ -606,7 +606,7 @@ JSValue JSDOMWindow::setTimeout(ExecState* exec) > JSValue JSDOMWindow::setInterval(ExecState* exec) > { > ContentSecurityPolicy* contentSecurityPolicy = impl().document() ? impl().document()->contentSecurityPolicy() : 0; >- OwnPtr<ScheduledAction> action = ScheduledAction::create(exec, globalObject()->world(), contentSecurityPolicy); >+ std::unique_ptr<ScheduledAction> action = ScheduledAction::create(exec, globalObject()->world(), contentSecurityPolicy); > if (exec->hadException()) > return jsUndefined(); > int delay = exec->argument(1).toInt32(exec); >@@ -615,7 +615,7 @@ JSValue JSDOMWindow::setInterval(ExecState* exec) > return jsNumber(0); > > ExceptionCode ec = 0; >- int result = impl().setInterval(action.release(), delay, ec); >+ int result = impl().setInterval(std::move(action), delay, ec); > setDOMException(exec, ec); > > return jsNumber(result); >diff --git a/Source/WebCore/bindings/js/JSWorkerGlobalScopeCustom.cpp b/Source/WebCore/bindings/js/JSWorkerGlobalScopeCustom.cpp >index 8e612a4116d95265ab2aab1830855fa2754927fa..a6dac26e8755f4e3ed0a844c8d26fabf89467366 100644 >--- a/Source/WebCore/bindings/js/JSWorkerGlobalScopeCustom.cpp >+++ b/Source/WebCore/bindings/js/JSWorkerGlobalScopeCustom.cpp >@@ -87,24 +87,24 @@ JSValue JSWorkerGlobalScope::importScripts(ExecState* exec) > > JSValue JSWorkerGlobalScope::setTimeout(ExecState* exec) > { >- OwnPtr<ScheduledAction> action = ScheduledAction::create(exec, globalObject()->world(), impl().contentSecurityPolicy()); >+ std::unique_ptr<ScheduledAction> action = ScheduledAction::create(exec, globalObject()->world(), impl().contentSecurityPolicy()); > if (exec->hadException()) > return jsUndefined(); > if (!action) > return jsNumber(0); > int delay = exec->argument(1).toInt32(exec); >- return jsNumber(impl().setTimeout(action.release(), delay)); >+ return jsNumber(impl().setTimeout(std::move(action), delay)); > } > > JSValue JSWorkerGlobalScope::setInterval(ExecState* exec) > { >- OwnPtr<ScheduledAction> action = ScheduledAction::create(exec, globalObject()->world(), impl().contentSecurityPolicy()); >+ std::unique_ptr<ScheduledAction> action = ScheduledAction::create(exec, globalObject()->world(), impl().contentSecurityPolicy()); > if (exec->hadException()) > return jsUndefined(); > if (!action) > return jsNumber(0); > int delay = exec->argument(1).toInt32(exec); >- return jsNumber(impl().setInterval(action.release(), delay)); >+ return jsNumber(impl().setInterval(std::move(action), delay)); > } > > } // namespace WebCore >diff --git a/Source/WebCore/bindings/js/ScheduledAction.cpp b/Source/WebCore/bindings/js/ScheduledAction.cpp >index f596371209bb7121361a516ad724ca523ab7757e..37c7728ed9e62d4beac6caf7a305dedef1d6ad26 100644 >--- a/Source/WebCore/bindings/js/ScheduledAction.cpp >+++ b/Source/WebCore/bindings/js/ScheduledAction.cpp >@@ -46,7 +46,7 @@ using namespace JSC; > > namespace WebCore { > >-PassOwnPtr<ScheduledAction> ScheduledAction::create(ExecState* exec, DOMWrapperWorld& isolatedWorld, ContentSecurityPolicy* policy) >+std::unique_ptr<ScheduledAction> ScheduledAction::create(ExecState* exec, DOMWrapperWorld& isolatedWorld, ContentSecurityPolicy* policy) > { > JSValue v = exec->argument(0); > CallData callData; >@@ -56,10 +56,10 @@ PassOwnPtr<ScheduledAction> ScheduledAction::create(ExecState* exec, DOMWrapperW > String string = v.toString(exec)->value(exec); > if (exec->hadException()) > return nullptr; >- return adoptPtr(new ScheduledAction(string, isolatedWorld)); >+ return std::unique_ptr<ScheduledAction>(new ScheduledAction(string, isolatedWorld)); > } > >- return adoptPtr(new ScheduledAction(exec, v, isolatedWorld)); >+ return std::unique_ptr<ScheduledAction>(new ScheduledAction(exec, v, isolatedWorld)); > } > > ScheduledAction::ScheduledAction(ExecState* exec, JSValue function, DOMWrapperWorld& isolatedWorld) >diff --git a/Source/WebCore/bindings/js/ScheduledAction.h b/Source/WebCore/bindings/js/ScheduledAction.h >index c1f628f9b4f334126a3d6c3755e6677009ffe43b..a58d9e5b34d3d52dde4742d1e94c77a596dd1c81 100644 >--- a/Source/WebCore/bindings/js/ScheduledAction.h >+++ b/Source/WebCore/bindings/js/ScheduledAction.h >@@ -23,8 +23,8 @@ > #include "JSDOMBinding.h" > #include <heap/Strong.h> > #include <heap/StrongInlines.h> >+#include <memory> > #include <runtime/JSCell.h> >-#include <wtf/PassOwnPtr.h> > #include <wtf/Vector.h> > #include <wtf/text/WTFString.h> > >@@ -46,7 +46,7 @@ namespace WebCore { > class ScheduledAction { > WTF_MAKE_NONCOPYABLE(ScheduledAction); WTF_MAKE_FAST_ALLOCATED; > public: >- static PassOwnPtr<ScheduledAction> create(JSC::ExecState*, DOMWrapperWorld& isolatedWorld, ContentSecurityPolicy*); >+ static std::unique_ptr<ScheduledAction> create(JSC::ExecState*, DOMWrapperWorld& isolatedWorld, ContentSecurityPolicy*); > > void execute(ScriptExecutionContext*); > >diff --git a/Source/WebCore/page/DOMTimer.cpp b/Source/WebCore/page/DOMTimer.cpp >index 5bfb74bf838ee2d40b031d7a2ad87fa9a12f78d9..9e3ee45f090a278b1c7293266ff0da056bf70041 100644 >--- a/Source/WebCore/page/DOMTimer.cpp >+++ b/Source/WebCore/page/DOMTimer.cpp >@@ -58,10 +58,10 @@ static inline bool shouldForwardUserGesture(int interval, int nestingLevel) > && nestingLevel == 1; // Gestures should not be forwarded to nested timers. > } > >-DOMTimer::DOMTimer(ScriptExecutionContext* context, PassOwnPtr<ScheduledAction> action, int interval, bool singleShot) >+DOMTimer::DOMTimer(ScriptExecutionContext* context, std::unique_ptr<ScheduledAction> action, int interval, bool singleShot) > : SuspendableTimer(context) > , m_nestingLevel(timerNestingLevel + 1) >- , m_action(action) >+ , m_action(std::move(action)) > , m_originalInterval(interval) > , m_shouldForwardUserGesture(shouldForwardUserGesture(interval, m_nestingLevel)) > { >@@ -83,12 +83,12 @@ DOMTimer::~DOMTimer() > scriptExecutionContext()->removeTimeout(m_timeoutId); > } > >-int DOMTimer::install(ScriptExecutionContext* context, PassOwnPtr<ScheduledAction> action, int timeout, bool singleShot) >+int DOMTimer::install(ScriptExecutionContext* context, std::unique_ptr<ScheduledAction> action, int timeout, bool singleShot) > { > // DOMTimer constructor links the new timer into a list of ActiveDOMObjects held by the 'context'. > // The timer is deleted when context is deleted (DOMTimer::contextDestroyed) or explicitly via DOMTimer::removeById(), > // or if it is a one-time timer and it has fired (DOMTimer::fired). >- DOMTimer* timer = new DOMTimer(context, action, timeout, singleShot); >+ DOMTimer* timer = new DOMTimer(context, std::move(action), timeout, singleShot); > #if PLATFORM(IOS) > if (context->isDocument()) { > Document& document = toDocument(*context); >@@ -157,7 +157,7 @@ void DOMTimer::fired() > } > > // Delete timer before executing the action for one-shot timers. >- OwnPtr<ScheduledAction> action = m_action.release(); >+ ScheduledAction* action = m_action.release(); > > // No access to member variables after this point. > delete this; >@@ -207,7 +207,7 @@ void DOMTimer::didStop() > // Need to release JS objects potentially protected by ScheduledAction > // because they can form circular references back to the ScriptExecutionContext > // which will cause a memory leak. >- m_action.clear(); >+ m_action = nullptr; > } > > void DOMTimer::adjustMinimumTimerInterval(double oldMinimumTimerInterval) >diff --git a/Source/WebCore/page/DOMTimer.h b/Source/WebCore/page/DOMTimer.h >index 5ed05e22da60176549c799604b8ec30bac460678..9f1cbaa4c074c8d692138e278971d69c8d8cf841 100644 >--- a/Source/WebCore/page/DOMTimer.h >+++ b/Source/WebCore/page/DOMTimer.h >@@ -28,8 +28,7 @@ > #define DOMTimer_h > > #include "SuspendableTimer.h" >-#include <wtf/OwnPtr.h> >-#include <wtf/PassOwnPtr.h> >+#include <memory> > > namespace WebCore { > >@@ -40,7 +39,7 @@ namespace WebCore { > virtual ~DOMTimer(); > // Creates a new timer owned by specified ScriptExecutionContext, starts it > // and returns its Id. >- static int install(ScriptExecutionContext*, PassOwnPtr<ScheduledAction>, int timeout, bool singleShot); >+ static int install(ScriptExecutionContext*, std::unique_ptr<ScheduledAction>, int timeout, bool singleShot); > static void removeById(ScriptExecutionContext*, int timeoutId); > > // Adjust to a change in the ScriptExecutionContext's minimum timer interval. >@@ -49,7 +48,7 @@ namespace WebCore { > void adjustMinimumTimerInterval(double oldMinimumTimerInterval); > > private: >- DOMTimer(ScriptExecutionContext*, PassOwnPtr<ScheduledAction>, int interval, bool singleShot); >+ DOMTimer(ScriptExecutionContext*, std::unique_ptr<ScheduledAction>, int interval, bool singleShot); > virtual void fired() override; > > // ActiveDOMObject >@@ -65,7 +64,7 @@ namespace WebCore { > > int m_timeoutId; > int m_nestingLevel; >- OwnPtr<ScheduledAction> m_action; >+ std::unique_ptr<ScheduledAction> m_action; > int m_originalInterval; > bool m_shouldForwardUserGesture; > }; >diff --git a/Source/WebCore/page/DOMWindow.cpp b/Source/WebCore/page/DOMWindow.cpp >index f206dd3ccd17bdd0fb4125c6a6f0dadb071220b1..59b6b157771c8353a1e69f13e60aff3ab3e7bbe7 100644 >--- a/Source/WebCore/page/DOMWindow.cpp >+++ b/Source/WebCore/page/DOMWindow.cpp >@@ -1512,14 +1512,14 @@ void DOMWindow::resizeTo(float width, float height) const > page->chrome().setWindowRect(adjustWindowRect(page, update)); > } > >-int DOMWindow::setTimeout(PassOwnPtr<ScheduledAction> action, int timeout, ExceptionCode& ec) >+int DOMWindow::setTimeout(std::unique_ptr<ScheduledAction> action, int timeout, ExceptionCode& ec) > { > ScriptExecutionContext* context = scriptExecutionContext(); > if (!context) { > ec = INVALID_ACCESS_ERR; > return -1; > } >- return DOMTimer::install(context, action, timeout, true); >+ return DOMTimer::install(context, std::move(action), timeout, true); > } > > void DOMWindow::clearTimeout(int timeoutId) >@@ -1546,14 +1546,14 @@ void DOMWindow::clearTimeout(int timeoutId) > DOMTimer::removeById(context, timeoutId); > } > >-int DOMWindow::setInterval(PassOwnPtr<ScheduledAction> action, int timeout, ExceptionCode& ec) >+int DOMWindow::setInterval(std::unique_ptr<ScheduledAction> action, int timeout, ExceptionCode& ec) > { > ScriptExecutionContext* context = scriptExecutionContext(); > if (!context) { > ec = INVALID_ACCESS_ERR; > return -1; > } >- return DOMTimer::install(context, action, timeout, false); >+ return DOMTimer::install(context, std::move(action), timeout, false); > } > > void DOMWindow::clearInterval(int timeoutId) >diff --git a/Source/WebCore/page/DOMWindow.h b/Source/WebCore/page/DOMWindow.h >index ac94c8a0a7ed645bea7c27fc75b16663a37760bb..96d98f70fde685325178af9e9ef46e6be5ffb74c 100644 >--- a/Source/WebCore/page/DOMWindow.h >+++ b/Source/WebCore/page/DOMWindow.h >@@ -33,6 +33,7 @@ > #include "URL.h" > #include "Supplementable.h" > #include <functional> >+#include <memory> > > namespace Inspector { > class ScriptCallStack; >@@ -253,9 +254,9 @@ namespace WebCore { > void resizeTo(float width, float height) const; > > // Timers >- int setTimeout(PassOwnPtr<ScheduledAction>, int timeout, ExceptionCode&); >+ int setTimeout(std::unique_ptr<ScheduledAction>, int timeout, ExceptionCode&); > void clearTimeout(int timeoutId); >- int setInterval(PassOwnPtr<ScheduledAction>, int timeout, ExceptionCode&); >+ int setInterval(std::unique_ptr<ScheduledAction>, int timeout, ExceptionCode&); > void clearInterval(int timeoutId); > > // WebKit animation extensions >diff --git a/Source/WebCore/workers/WorkerEventQueue.h b/Source/WebCore/workers/WorkerEventQueue.h >index 1c92844f920d7e12014b21dda9d8115db7623a26..9a05756811929230b4bee5780dec8419d55a247e 100644 >--- a/Source/WebCore/workers/WorkerEventQueue.h >+++ b/Source/WebCore/workers/WorkerEventQueue.h >@@ -29,7 +29,6 @@ > > #include "EventQueue.h" > #include <wtf/HashMap.h> >-#include <wtf/PassOwnPtr.h> > > namespace WebCore { > >diff --git a/Source/WebCore/workers/WorkerGlobalScope.cpp b/Source/WebCore/workers/WorkerGlobalScope.cpp >index 722d6b964bee78847539661bb4278156b51b76b9..b818e088a500dc5cec590daa413f7f826e7b4de5 100644 >--- a/Source/WebCore/workers/WorkerGlobalScope.cpp >+++ b/Source/WebCore/workers/WorkerGlobalScope.cpp >@@ -68,7 +68,7 @@ WorkerGlobalScope::WorkerGlobalScope(const URL& url, const String& userAgent, st > : m_url(url) > , m_userAgent(userAgent) > , m_groupSettings(std::move(settings)) >- , m_script(adoptPtr(new WorkerScriptController(this))) >+ , m_script(std::make_unique<WorkerScriptController>(this)) > , m_thread(thread) > #if ENABLE(INSPECTOR) > , m_workerInspectorController(std::make_unique<WorkerInspectorController>(*this)) >@@ -153,9 +153,9 @@ void WorkerGlobalScope::postTask(Task task) > thread().runLoop().postTask(std::move(task)); > } > >-int WorkerGlobalScope::setTimeout(PassOwnPtr<ScheduledAction> action, int timeout) >+int WorkerGlobalScope::setTimeout(std::unique_ptr<ScheduledAction> action, int timeout) > { >- return DOMTimer::install(scriptExecutionContext(), action, timeout, true); >+ return DOMTimer::install(scriptExecutionContext(), std::move(action), timeout, true); > } > > void WorkerGlobalScope::clearTimeout(int timeoutId) >@@ -163,9 +163,9 @@ void WorkerGlobalScope::clearTimeout(int timeoutId) > DOMTimer::removeById(scriptExecutionContext(), timeoutId); > } > >-int WorkerGlobalScope::setInterval(PassOwnPtr<ScheduledAction> action, int timeout) >+int WorkerGlobalScope::setInterval(std::unique_ptr<ScheduledAction> action, int timeout) > { >- return DOMTimer::install(scriptExecutionContext(), action, timeout, false); >+ return DOMTimer::install(scriptExecutionContext(), std::move(action), timeout, false); > } > > void WorkerGlobalScope::clearInterval(int timeoutId) >diff --git a/Source/WebCore/workers/WorkerGlobalScope.h b/Source/WebCore/workers/WorkerGlobalScope.h >index 00184667869d45121cafae13c879dc2e0a46e9a4..9bd899e3f82680498041c1ff4901901c1877109f 100644 >--- a/Source/WebCore/workers/WorkerGlobalScope.h >+++ b/Source/WebCore/workers/WorkerGlobalScope.h >@@ -35,9 +35,9 @@ > #include "ScriptExecutionContext.h" > #include "WorkerEventQueue.h" > #include "WorkerScriptController.h" >+#include <memory> > #include <wtf/Assertions.h> > #include <wtf/HashMap.h> >-#include <wtf/OwnPtr.h> > #include <wtf/PassRefPtr.h> > #include <wtf/RefCounted.h> > #include <wtf/RefPtr.h> >@@ -72,7 +72,7 @@ namespace WebCore { > virtual void disableEval(const String& errorMessage) override; > > WorkerScriptController* script() { return m_script.get(); } >- void clearScript() { m_script.clear(); } >+ void clearScript() { m_script = nullptr; } > > WorkerThread& thread() const { return m_thread; } > >@@ -94,9 +94,9 @@ namespace WebCore { > WorkerNavigator* navigator() const; > > // Timers >- int setTimeout(PassOwnPtr<ScheduledAction>, int timeout); >+ int setTimeout(std::unique_ptr<ScheduledAction>, int timeout); > void clearTimeout(int timeoutId); >- int setInterval(PassOwnPtr<ScheduledAction>, int timeout); >+ int setInterval(std::unique_ptr<ScheduledAction>, int timeout); > void clearInterval(int timeoutId); > > virtual bool isContextThread() const override; >@@ -167,7 +167,7 @@ namespace WebCore { > mutable RefPtr<WorkerLocation> m_location; > mutable RefPtr<WorkerNavigator> m_navigator; > >- OwnPtr<WorkerScriptController> m_script; >+ std::unique_ptr<WorkerScriptController> m_script; > WorkerThread& m_thread; > > #if ENABLE(INSPECTOR) >diff --git a/Source/WebCore/workers/WorkerLoaderProxy.h b/Source/WebCore/workers/WorkerLoaderProxy.h >index df304dc5d50258c97120af70b629090d69546f39..6ed35876fd569c98a66c8ee05243aac95809686c 100644 >--- a/Source/WebCore/workers/WorkerLoaderProxy.h >+++ b/Source/WebCore/workers/WorkerLoaderProxy.h >@@ -33,7 +33,6 @@ > > #include "ScriptExecutionContext.h" > #include <wtf/Forward.h> >-#include <wtf/PassOwnPtr.h> > > namespace WebCore { > >diff --git a/Source/WebCore/workers/WorkerMessagingProxy.h b/Source/WebCore/workers/WorkerMessagingProxy.h >index 02b08d603ca4e4d7df5b35fc03610f9dc6f66844..564dee98a97a39910aad0b402ac86919bc4fa6f8 100644 >--- a/Source/WebCore/workers/WorkerMessagingProxy.h >+++ b/Source/WebCore/workers/WorkerMessagingProxy.h >@@ -34,7 +34,6 @@ > #include <memory> > #include <wtf/Forward.h> > #include <wtf/Noncopyable.h> >-#include <wtf/PassOwnPtr.h> > #include <wtf/PassRefPtr.h> > #include <wtf/RefPtr.h> > #include <wtf/Vector.h> >diff --git a/Source/WebCore/workers/WorkerRunLoop.cpp b/Source/WebCore/workers/WorkerRunLoop.cpp >index b64c2e6697bc65581d1dea20490aed2542933e6e..2a8852fbe40222d1084d797b7e4b7610b09a1d95 100644 >--- a/Source/WebCore/workers/WorkerRunLoop.cpp >+++ b/Source/WebCore/workers/WorkerRunLoop.cpp >@@ -87,7 +87,7 @@ private: > }; > > WorkerRunLoop::WorkerRunLoop() >- : m_sharedTimer(adoptPtr(new WorkerSharedTimer)) >+ : m_sharedTimer(std::make_unique<WorkerSharedTimer>()) > , m_nestedCount(0) > , m_uniqueId(0) > { >diff --git a/Source/WebCore/workers/WorkerRunLoop.h b/Source/WebCore/workers/WorkerRunLoop.h >index f23c30f5b32a7d4f9d19185bbdb4a1087a697156..76a46f2142463b17da65c58c1e6e18cb2409709a 100644 >--- a/Source/WebCore/workers/WorkerRunLoop.h >+++ b/Source/WebCore/workers/WorkerRunLoop.h >@@ -32,9 +32,8 @@ > #define WorkerRunLoop_h > > #include "ScriptExecutionContext.h" >+#include <memory> > #include <wtf/MessageQueue.h> >-#include <wtf/OwnPtr.h> >-#include <wtf/PassOwnPtr.h> > > namespace WebCore { > >@@ -90,7 +89,7 @@ namespace WebCore { > void runCleanupTasks(WorkerGlobalScope*); > > MessageQueue<Task> m_messageQueue; >- OwnPtr<WorkerSharedTimer> m_sharedTimer; >+ std::unique_ptr<WorkerSharedTimer> m_sharedTimer; > int m_nestedCount; > unsigned long m_uniqueId; > }; >diff --git a/Source/WebCore/workers/WorkerScriptLoader.cpp b/Source/WebCore/workers/WorkerScriptLoader.cpp >index 6223fffd971d91f064545664b2e3ac280c4cbb72..fa41f40ce3084c9468731acd6faf6838a25eeaca 100644 >--- a/Source/WebCore/workers/WorkerScriptLoader.cpp >+++ b/Source/WebCore/workers/WorkerScriptLoader.cpp >@@ -37,7 +37,6 @@ > #include "WorkerGlobalScope.h" > #include "WorkerScriptLoaderClient.h" > #include "WorkerThreadableLoader.h" >-#include <wtf/OwnPtr.h> > #include <wtf/Ref.h> > #include <wtf/RefPtr.h> > >@@ -59,7 +58,7 @@ void WorkerScriptLoader::loadSynchronously(ScriptExecutionContext* scriptExecuti > { > m_url = url; > >- OwnPtr<ResourceRequest> request(createResourceRequest()); >+ std::unique_ptr<ResourceRequest> request(createResourceRequest()); > if (!request) > return; > >@@ -79,7 +78,7 @@ void WorkerScriptLoader::loadAsynchronously(ScriptExecutionContext* scriptExecut > m_client = client; > m_url = url; > >- OwnPtr<ResourceRequest> request(createResourceRequest()); >+ std::unique_ptr<ResourceRequest> request(createResourceRequest()); > if (!request) > return; > >@@ -99,11 +98,11 @@ const URL& WorkerScriptLoader::responseURL() const > return m_responseURL; > } > >-PassOwnPtr<ResourceRequest> WorkerScriptLoader::createResourceRequest() >+std::unique_ptr<ResourceRequest> WorkerScriptLoader::createResourceRequest() > { >- OwnPtr<ResourceRequest> request = adoptPtr(new ResourceRequest(m_url)); >+ auto request = std::make_unique<ResourceRequest>(m_url); > request->setHTTPMethod("GET"); >- return request.release(); >+ return std::move(request); > } > > void WorkerScriptLoader::didReceiveResponse(unsigned long identifier, const ResourceResponse& response) >diff --git a/Source/WebCore/workers/WorkerScriptLoader.h b/Source/WebCore/workers/WorkerScriptLoader.h >index a735e6b4ec10844a388e1d2c33958d0893689e99..9aaf6646996f28228a0b772fb924a51d14abb4fd 100644 >--- a/Source/WebCore/workers/WorkerScriptLoader.h >+++ b/Source/WebCore/workers/WorkerScriptLoader.h >@@ -32,7 +32,7 @@ > #include "ResourceRequest.h" > #include "ThreadableLoader.h" > #include "ThreadableLoaderClient.h" >- >+#include <memory> > #include <wtf/FastMalloc.h> > #include <wtf/PassRefPtr.h> > #include <wtf/RefCounted.h> >@@ -77,7 +77,7 @@ namespace WebCore { > WorkerScriptLoader(); > ~WorkerScriptLoader(); > >- PassOwnPtr<ResourceRequest> createResourceRequest(); >+ std::unique_ptr<ResourceRequest> createResourceRequest(); > void notifyFinished(); > > WorkerScriptLoaderClient* m_client; >diff --git a/Source/WebCore/workers/WorkerThread.cpp b/Source/WebCore/workers/WorkerThread.cpp >index 440b06ccf4106c2728fb210fe5f29c2312681ffa..24adc6c8e91eebac74993a893669fd4a94aa718d 100644 >--- a/Source/WebCore/workers/WorkerThread.cpp >+++ b/Source/WebCore/workers/WorkerThread.cpp >@@ -79,10 +79,7 @@ unsigned WorkerThread::workerThreadCount() > struct WorkerThreadStartupData { > WTF_MAKE_NONCOPYABLE(WorkerThreadStartupData); WTF_MAKE_FAST_ALLOCATED; > public: >- static PassOwnPtr<WorkerThreadStartupData> create(const URL& scriptURL, const String& userAgent, const GroupSettings* settings, const String& sourceCode, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType, const SecurityOrigin* topOrigin) >- { >- return adoptPtr(new WorkerThreadStartupData(scriptURL, userAgent, settings, sourceCode, startMode, contentSecurityPolicy, contentSecurityPolicyType, topOrigin)); >- } >+ WorkerThreadStartupData(const URL& scriptURL, const String& userAgent, const GroupSettings*, const String& sourceCode, WorkerThreadStartMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType, const SecurityOrigin* topOrigin); > > URL m_scriptURL; > String m_userAgent; >@@ -92,8 +89,6 @@ public: > String m_contentSecurityPolicy; > ContentSecurityPolicy::HeaderType m_contentSecurityPolicyType; > RefPtr<SecurityOrigin> m_topOrigin; >-private: >- WorkerThreadStartupData(const URL& scriptURL, const String& userAgent, const GroupSettings*, const String& sourceCode, WorkerThreadStartMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType, const SecurityOrigin* topOrigin); > }; > > WorkerThreadStartupData::WorkerThreadStartupData(const URL& scriptURL, const String& userAgent, const GroupSettings* settings, const String& sourceCode, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType, const SecurityOrigin* topOrigin) >@@ -118,7 +113,7 @@ WorkerThread::WorkerThread(const URL& scriptURL, const String& userAgent, const > : m_threadID(0) > , m_workerLoaderProxy(workerLoaderProxy) > , m_workerReportingProxy(workerReportingProxy) >- , m_startupData(WorkerThreadStartupData::create(scriptURL, userAgent, settings, sourceCode, startMode, contentSecurityPolicy, contentSecurityPolicyType, topOrigin)) >+ , m_startupData(std::make_unique<WorkerThreadStartupData>(scriptURL, userAgent, settings, sourceCode, startMode, contentSecurityPolicy, contentSecurityPolicyType, topOrigin)) > #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) > , m_notificationClient(0) > #endif >@@ -180,7 +175,7 @@ void WorkerThread::workerThread() > // Free the startup data to cause its member variable deref's happen on the worker's thread (since > // all ref/derefs of these objects are happening on the thread at this point). Note that > // WorkerThread::~WorkerThread happens on a different thread where it was created. >- m_startupData.clear(); >+ m_startupData = nullptr; > > runEventLoop(); > >diff --git a/Source/WebCore/workers/WorkerThread.h b/Source/WebCore/workers/WorkerThread.h >index 4359ee3abf780c0682c4651f52ef0cfff7d9968c..38d0d830759f83edf622bd5ec5b6fc466ffcab52 100644 >--- a/Source/WebCore/workers/WorkerThread.h >+++ b/Source/WebCore/workers/WorkerThread.h >@@ -30,8 +30,8 @@ > #include "ContentSecurityPolicy.h" > #include "GroupSettings.h" > #include "WorkerRunLoop.h" >+#include <memory> > #include <wtf/Forward.h> >-#include <wtf/OwnPtr.h> > #include <wtf/PassRefPtr.h> > #include <wtf/RefCounted.h> > >@@ -92,7 +92,7 @@ namespace WebCore { > RefPtr<WorkerGlobalScope> m_workerGlobalScope; > Mutex m_threadCreationMutex; > >- OwnPtr<WorkerThreadStartupData> m_startupData; >+ std::unique_ptr<WorkerThreadStartupData> m_startupData; > > #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) > NotificationClient* m_notificationClient;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 132401
:
230519
|
231260