Diff
Modified: trunk/Source/WebCore/ChangeLog (168585 => 168586)
--- trunk/Source/WebCore/ChangeLog 2014-05-10 22:41:17 UTC (rev 168585)
+++ trunk/Source/WebCore/ChangeLog 2014-05-10 22:42:35 UTC (rev 168586)
@@ -1,3 +1,17 @@
+2014-05-10 Commit Queue <[email protected]>
+
+ Unreviewed, rolling out r168578.
+ https://bugs.webkit.org/show_bug.cgi?id=132789
+
+ Speculative rollout since this appears to break PLT3.
+ (Requested by kling on #webkit).
+
+ Reverted changeset:
+
+ "Move Source/WebCore/workers/ code to std::unique_ptr"
+ https://bugs.webkit.org/show_bug.cgi?id=132401
+ http://trac.webkit.org/changeset/168578
+
2014-05-10 Darin Adler <[email protected]>
REGRESSION (r166853): fast/preloader/document-write.html is very flaky
Modified: trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp (168585 => 168586)
--- trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp 2014-05-10 22:41:17 UTC (rev 168585)
+++ trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp 2014-05-10 22:42:35 UTC (rev 168586)
@@ -594,7 +594,7 @@
JSValue JSDOMWindow::setTimeout(ExecState* exec)
{
ContentSecurityPolicy* contentSecurityPolicy = impl().document() ? impl().document()->contentSecurityPolicy() : 0;
- std::unique_ptr<ScheduledAction> action = "" globalObject()->world(), contentSecurityPolicy);
+ OwnPtr<ScheduledAction> action = "" globalObject()->world(), contentSecurityPolicy);
if (exec->hadException())
return jsUndefined();
@@ -604,7 +604,7 @@
int delay = exec->argument(1).toInt32(exec);
ExceptionCode ec = 0;
- int result = impl().setTimeout(std::move(action), delay, ec);
+ int result = impl().setTimeout(action.release(), delay, ec);
setDOMException(exec, ec);
return jsNumber(result);
@@ -613,7 +613,7 @@
JSValue JSDOMWindow::setInterval(ExecState* exec)
{
ContentSecurityPolicy* contentSecurityPolicy = impl().document() ? impl().document()->contentSecurityPolicy() : 0;
- std::unique_ptr<ScheduledAction> action = "" globalObject()->world(), contentSecurityPolicy);
+ OwnPtr<ScheduledAction> action = "" globalObject()->world(), contentSecurityPolicy);
if (exec->hadException())
return jsUndefined();
int delay = exec->argument(1).toInt32(exec);
@@ -622,7 +622,7 @@
return jsNumber(0);
ExceptionCode ec = 0;
- int result = impl().setInterval(std::move(action), delay, ec);
+ int result = impl().setInterval(action.release(), delay, ec);
setDOMException(exec, ec);
return jsNumber(result);
Modified: trunk/Source/WebCore/bindings/js/JSWorkerGlobalScopeCustom.cpp (168585 => 168586)
--- trunk/Source/WebCore/bindings/js/JSWorkerGlobalScopeCustom.cpp 2014-05-10 22:41:17 UTC (rev 168585)
+++ trunk/Source/WebCore/bindings/js/JSWorkerGlobalScopeCustom.cpp 2014-05-10 22:42:35 UTC (rev 168586)
@@ -87,24 +87,24 @@
JSValue JSWorkerGlobalScope::setTimeout(ExecState* exec)
{
- std::unique_ptr<ScheduledAction> action = "" globalObject()->world(), impl().contentSecurityPolicy());
+ OwnPtr<ScheduledAction> action = "" 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(std::move(action), delay));
+ return jsNumber(impl().setTimeout(action.release(), delay));
}
JSValue JSWorkerGlobalScope::setInterval(ExecState* exec)
{
- std::unique_ptr<ScheduledAction> action = "" globalObject()->world(), impl().contentSecurityPolicy());
+ OwnPtr<ScheduledAction> action = "" 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(std::move(action), delay));
+ return jsNumber(impl().setInterval(action.release(), delay));
}
} // namespace WebCore
Modified: trunk/Source/WebCore/bindings/js/ScheduledAction.cpp (168585 => 168586)
--- trunk/Source/WebCore/bindings/js/ScheduledAction.cpp 2014-05-10 22:41:17 UTC (rev 168585)
+++ trunk/Source/WebCore/bindings/js/ScheduledAction.cpp 2014-05-10 22:42:35 UTC (rev 168586)
@@ -46,7 +46,7 @@
namespace WebCore {
-std::unique_ptr<ScheduledAction> ScheduledAction::create(ExecState* exec, DOMWrapperWorld& isolatedWorld, ContentSecurityPolicy* policy)
+PassOwnPtr<ScheduledAction> ScheduledAction::create(ExecState* exec, DOMWrapperWorld& isolatedWorld, ContentSecurityPolicy* policy)
{
JSValue v = exec->argument(0);
CallData callData;
@@ -56,10 +56,10 @@
String string = v.toString(exec)->value(exec);
if (exec->hadException())
return nullptr;
- return std::unique_ptr<ScheduledAction>(new ScheduledAction(string, isolatedWorld));
+ return adoptPtr(new ScheduledAction(string, isolatedWorld));
}
- return std::unique_ptr<ScheduledAction>(new ScheduledAction(exec, v, isolatedWorld));
+ return adoptPtr(new ScheduledAction(exec, v, isolatedWorld));
}
ScheduledAction::ScheduledAction(ExecState* exec, JSValue function, DOMWrapperWorld& isolatedWorld)
Modified: trunk/Source/WebCore/bindings/js/ScheduledAction.h (168585 => 168586)
--- trunk/Source/WebCore/bindings/js/ScheduledAction.h 2014-05-10 22:41:17 UTC (rev 168585)
+++ trunk/Source/WebCore/bindings/js/ScheduledAction.h 2014-05-10 22:42:35 UTC (rev 168586)
@@ -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 @@
class ScheduledAction {
WTF_MAKE_NONCOPYABLE(ScheduledAction); WTF_MAKE_FAST_ALLOCATED;
public:
- static std::unique_ptr<ScheduledAction> create(JSC::ExecState*, DOMWrapperWorld& isolatedWorld, ContentSecurityPolicy*);
+ static PassOwnPtr<ScheduledAction> create(JSC::ExecState*, DOMWrapperWorld& isolatedWorld, ContentSecurityPolicy*);
void execute(ScriptExecutionContext*);
Modified: trunk/Source/WebCore/page/DOMTimer.cpp (168585 => 168586)
--- trunk/Source/WebCore/page/DOMTimer.cpp 2014-05-10 22:41:17 UTC (rev 168585)
+++ trunk/Source/WebCore/page/DOMTimer.cpp 2014-05-10 22:42:35 UTC (rev 168586)
@@ -58,10 +58,10 @@
&& nestingLevel == 1; // Gestures should not be forwarded to nested timers.
}
-DOMTimer::DOMTimer(ScriptExecutionContext* context, std::unique_ptr<ScheduledAction> action, int interval, bool singleShot)
+DOMTimer::DOMTimer(ScriptExecutionContext* context, PassOwnPtr<ScheduledAction> action, int interval, bool singleShot)
: SuspendableTimer(context)
, m_nestingLevel(timerNestingLevel + 1)
- , m_action(std::move(action))
+ , m_action(action)
, m_originalInterval(interval)
, m_shouldForwardUserGesture(shouldForwardUserGesture(interval, m_nestingLevel))
{
@@ -83,12 +83,12 @@
scriptExecutionContext()->removeTimeout(m_timeoutId);
}
-int DOMTimer::install(ScriptExecutionContext* context, std::unique_ptr<ScheduledAction> action, int timeout, bool singleShot)
+int DOMTimer::install(ScriptExecutionContext* context, PassOwnPtr<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, std::move(action), timeout, singleShot);
+ DOMTimer* timer = new DOMTimer(context, action, timeout, singleShot);
#if PLATFORM(IOS)
if (context->isDocument()) {
Document& document = toDocument(*context);
@@ -157,7 +157,7 @@
}
// Delete timer before executing the action for one-shot timers.
- ScheduledAction* action = ""
+ OwnPtr<ScheduledAction> action = ""
// No access to member variables after this point.
delete this;
@@ -207,7 +207,7 @@
// 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 = nullptr;
+ m_action.clear();
}
void DOMTimer::adjustMinimumTimerInterval(double oldMinimumTimerInterval)
Modified: trunk/Source/WebCore/page/DOMTimer.h (168585 => 168586)
--- trunk/Source/WebCore/page/DOMTimer.h 2014-05-10 22:41:17 UTC (rev 168585)
+++ trunk/Source/WebCore/page/DOMTimer.h 2014-05-10 22:42:35 UTC (rev 168586)
@@ -28,7 +28,8 @@
#define DOMTimer_h
#include "SuspendableTimer.h"
-#include <memory>
+#include <wtf/OwnPtr.h>
+#include <wtf/PassOwnPtr.h>
namespace WebCore {
@@ -39,7 +40,7 @@
virtual ~DOMTimer();
// Creates a new timer owned by specified ScriptExecutionContext, starts it
// and returns its Id.
- static int install(ScriptExecutionContext*, std::unique_ptr<ScheduledAction>, int timeout, bool singleShot);
+ static int install(ScriptExecutionContext*, PassOwnPtr<ScheduledAction>, int timeout, bool singleShot);
static void removeById(ScriptExecutionContext*, int timeoutId);
// Adjust to a change in the ScriptExecutionContext's minimum timer interval.
@@ -48,7 +49,7 @@
void adjustMinimumTimerInterval(double oldMinimumTimerInterval);
private:
- DOMTimer(ScriptExecutionContext*, std::unique_ptr<ScheduledAction>, int interval, bool singleShot);
+ DOMTimer(ScriptExecutionContext*, PassOwnPtr<ScheduledAction>, int interval, bool singleShot);
virtual void fired() override;
// ActiveDOMObject
@@ -64,7 +65,7 @@
int m_timeoutId;
int m_nestingLevel;
- std::unique_ptr<ScheduledAction> m_action;
+ OwnPtr<ScheduledAction> m_action;
int m_originalInterval;
bool m_shouldForwardUserGesture;
};
Modified: trunk/Source/WebCore/page/DOMWindow.cpp (168585 => 168586)
--- trunk/Source/WebCore/page/DOMWindow.cpp 2014-05-10 22:41:17 UTC (rev 168585)
+++ trunk/Source/WebCore/page/DOMWindow.cpp 2014-05-10 22:42:35 UTC (rev 168586)
@@ -1513,14 +1513,14 @@
page->chrome().setWindowRect(adjustWindowRect(page, update));
}
-int DOMWindow::setTimeout(std::unique_ptr<ScheduledAction> action, int timeout, ExceptionCode& ec)
+int DOMWindow::setTimeout(PassOwnPtr<ScheduledAction> action, int timeout, ExceptionCode& ec)
{
ScriptExecutionContext* context = scriptExecutionContext();
if (!context) {
ec = INVALID_ACCESS_ERR;
return -1;
}
- return DOMTimer::install(context, std::move(action), timeout, true);
+ return DOMTimer::install(context, action, timeout, true);
}
void DOMWindow::clearTimeout(int timeoutId)
@@ -1547,14 +1547,14 @@
DOMTimer::removeById(context, timeoutId);
}
-int DOMWindow::setInterval(std::unique_ptr<ScheduledAction> action, int timeout, ExceptionCode& ec)
+int DOMWindow::setInterval(PassOwnPtr<ScheduledAction> action, int timeout, ExceptionCode& ec)
{
ScriptExecutionContext* context = scriptExecutionContext();
if (!context) {
ec = INVALID_ACCESS_ERR;
return -1;
}
- return DOMTimer::install(context, std::move(action), timeout, false);
+ return DOMTimer::install(context, action, timeout, false);
}
void DOMWindow::clearInterval(int timeoutId)
Modified: trunk/Source/WebCore/page/DOMWindow.h (168585 => 168586)
--- trunk/Source/WebCore/page/DOMWindow.h 2014-05-10 22:41:17 UTC (rev 168585)
+++ trunk/Source/WebCore/page/DOMWindow.h 2014-05-10 22:42:35 UTC (rev 168586)
@@ -33,7 +33,6 @@
#include "URL.h"
#include "Supplementable.h"
#include <functional>
-#include <memory>
namespace Inspector {
class ScriptCallStack;
@@ -254,9 +253,9 @@
void resizeTo(float width, float height) const;
// Timers
- int setTimeout(std::unique_ptr<ScheduledAction>, int timeout, ExceptionCode&);
+ int setTimeout(PassOwnPtr<ScheduledAction>, int timeout, ExceptionCode&);
void clearTimeout(int timeoutId);
- int setInterval(std::unique_ptr<ScheduledAction>, int timeout, ExceptionCode&);
+ int setInterval(PassOwnPtr<ScheduledAction>, int timeout, ExceptionCode&);
void clearInterval(int timeoutId);
// WebKit animation extensions
Modified: trunk/Source/WebCore/workers/WorkerEventQueue.h (168585 => 168586)
--- trunk/Source/WebCore/workers/WorkerEventQueue.h 2014-05-10 22:41:17 UTC (rev 168585)
+++ trunk/Source/WebCore/workers/WorkerEventQueue.h 2014-05-10 22:42:35 UTC (rev 168586)
@@ -29,6 +29,7 @@
#include "EventQueue.h"
#include <wtf/HashMap.h>
+#include <wtf/PassOwnPtr.h>
namespace WebCore {
Modified: trunk/Source/WebCore/workers/WorkerGlobalScope.cpp (168585 => 168586)
--- trunk/Source/WebCore/workers/WorkerGlobalScope.cpp 2014-05-10 22:41:17 UTC (rev 168585)
+++ trunk/Source/WebCore/workers/WorkerGlobalScope.cpp 2014-05-10 22:42:35 UTC (rev 168586)
@@ -67,7 +67,7 @@
: m_url(url)
, m_userAgent(userAgent)
, m_groupSettings(std::move(settings))
- , m_script(std::make_unique<WorkerScriptController>(this))
+ , m_script(adoptPtr(new WorkerScriptController(this)))
, m_thread(thread)
#if ENABLE(INSPECTOR)
, m_workerInspectorController(std::make_unique<WorkerInspectorController>(*this))
@@ -152,9 +152,9 @@
thread().runLoop().postTask(std::move(task));
}
-int WorkerGlobalScope::setTimeout(std::unique_ptr<ScheduledAction> action, int timeout)
+int WorkerGlobalScope::setTimeout(PassOwnPtr<ScheduledAction> action, int timeout)
{
- return DOMTimer::install(scriptExecutionContext(), std::move(action), timeout, true);
+ return DOMTimer::install(scriptExecutionContext(), action, timeout, true);
}
void WorkerGlobalScope::clearTimeout(int timeoutId)
@@ -162,9 +162,9 @@
DOMTimer::removeById(scriptExecutionContext(), timeoutId);
}
-int WorkerGlobalScope::setInterval(std::unique_ptr<ScheduledAction> action, int timeout)
+int WorkerGlobalScope::setInterval(PassOwnPtr<ScheduledAction> action, int timeout)
{
- return DOMTimer::install(scriptExecutionContext(), std::move(action), timeout, false);
+ return DOMTimer::install(scriptExecutionContext(), action, timeout, false);
}
void WorkerGlobalScope::clearInterval(int timeoutId)
Modified: trunk/Source/WebCore/workers/WorkerGlobalScope.h (168585 => 168586)
--- trunk/Source/WebCore/workers/WorkerGlobalScope.h 2014-05-10 22:41:17 UTC (rev 168585)
+++ trunk/Source/WebCore/workers/WorkerGlobalScope.h 2014-05-10 22:42:35 UTC (rev 168586)
@@ -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 @@
virtual void disableEval(const String& errorMessage) override;
WorkerScriptController* script() { return m_script.get(); }
- void clearScript() { m_script = nullptr; }
+ void clearScript() { m_script.clear(); }
WorkerThread& thread() const { return m_thread; }
@@ -94,9 +94,9 @@
WorkerNavigator* navigator() const;
// Timers
- int setTimeout(std::unique_ptr<ScheduledAction>, int timeout);
+ int setTimeout(PassOwnPtr<ScheduledAction>, int timeout);
void clearTimeout(int timeoutId);
- int setInterval(std::unique_ptr<ScheduledAction>, int timeout);
+ int setInterval(PassOwnPtr<ScheduledAction>, int timeout);
void clearInterval(int timeoutId);
virtual bool isContextThread() const override;
@@ -167,7 +167,7 @@
mutable RefPtr<WorkerLocation> m_location;
mutable RefPtr<WorkerNavigator> m_navigator;
- std::unique_ptr<WorkerScriptController> m_script;
+ OwnPtr<WorkerScriptController> m_script;
WorkerThread& m_thread;
#if ENABLE(INSPECTOR)
Modified: trunk/Source/WebCore/workers/WorkerLoaderProxy.h (168585 => 168586)
--- trunk/Source/WebCore/workers/WorkerLoaderProxy.h 2014-05-10 22:41:17 UTC (rev 168585)
+++ trunk/Source/WebCore/workers/WorkerLoaderProxy.h 2014-05-10 22:42:35 UTC (rev 168586)
@@ -33,6 +33,7 @@
#include "ScriptExecutionContext.h"
#include <wtf/Forward.h>
+#include <wtf/PassOwnPtr.h>
namespace WebCore {
Modified: trunk/Source/WebCore/workers/WorkerMessagingProxy.h (168585 => 168586)
--- trunk/Source/WebCore/workers/WorkerMessagingProxy.h 2014-05-10 22:41:17 UTC (rev 168585)
+++ trunk/Source/WebCore/workers/WorkerMessagingProxy.h 2014-05-10 22:42:35 UTC (rev 168586)
@@ -34,6 +34,7 @@
#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>
Modified: trunk/Source/WebCore/workers/WorkerRunLoop.cpp (168585 => 168586)
--- trunk/Source/WebCore/workers/WorkerRunLoop.cpp 2014-05-10 22:41:17 UTC (rev 168585)
+++ trunk/Source/WebCore/workers/WorkerRunLoop.cpp 2014-05-10 22:42:35 UTC (rev 168586)
@@ -87,7 +87,7 @@
};
WorkerRunLoop::WorkerRunLoop()
- : m_sharedTimer(std::make_unique<WorkerSharedTimer>())
+ : m_sharedTimer(adoptPtr(new WorkerSharedTimer))
, m_nestedCount(0)
, m_uniqueId(0)
{
Modified: trunk/Source/WebCore/workers/WorkerRunLoop.h (168585 => 168586)
--- trunk/Source/WebCore/workers/WorkerRunLoop.h 2014-05-10 22:41:17 UTC (rev 168585)
+++ trunk/Source/WebCore/workers/WorkerRunLoop.h 2014-05-10 22:42:35 UTC (rev 168586)
@@ -32,8 +32,9 @@
#define WorkerRunLoop_h
#include "ScriptExecutionContext.h"
-#include <memory>
#include <wtf/MessageQueue.h>
+#include <wtf/OwnPtr.h>
+#include <wtf/PassOwnPtr.h>
namespace WebCore {
@@ -89,7 +90,7 @@
void runCleanupTasks(WorkerGlobalScope*);
MessageQueue<Task> m_messageQueue;
- std::unique_ptr<WorkerSharedTimer> m_sharedTimer;
+ OwnPtr<WorkerSharedTimer> m_sharedTimer;
int m_nestedCount;
unsigned long m_uniqueId;
};
Modified: trunk/Source/WebCore/workers/WorkerScriptLoader.cpp (168585 => 168586)
--- trunk/Source/WebCore/workers/WorkerScriptLoader.cpp 2014-05-10 22:41:17 UTC (rev 168585)
+++ trunk/Source/WebCore/workers/WorkerScriptLoader.cpp 2014-05-10 22:42:35 UTC (rev 168586)
@@ -37,6 +37,7 @@
#include "WorkerGlobalScope.h"
#include "WorkerScriptLoaderClient.h"
#include "WorkerThreadableLoader.h"
+#include <wtf/OwnPtr.h>
#include <wtf/Ref.h>
#include <wtf/RefPtr.h>
@@ -58,7 +59,7 @@
{
m_url = url;
- std::unique_ptr<ResourceRequest> request(createResourceRequest());
+ OwnPtr<ResourceRequest> request(createResourceRequest());
if (!request)
return;
@@ -78,7 +79,7 @@
m_client = client;
m_url = url;
- std::unique_ptr<ResourceRequest> request(createResourceRequest());
+ OwnPtr<ResourceRequest> request(createResourceRequest());
if (!request)
return;
@@ -98,11 +99,11 @@
return m_responseURL;
}
-std::unique_ptr<ResourceRequest> WorkerScriptLoader::createResourceRequest()
+PassOwnPtr<ResourceRequest> WorkerScriptLoader::createResourceRequest()
{
- auto request = std::make_unique<ResourceRequest>(m_url);
+ OwnPtr<ResourceRequest> request = adoptPtr(new ResourceRequest(m_url));
request->setHTTPMethod("GET");
- return std::move(request);
+ return request.release();
}
void WorkerScriptLoader::didReceiveResponse(unsigned long identifier, const ResourceResponse& response)
Modified: trunk/Source/WebCore/workers/WorkerScriptLoader.h (168585 => 168586)
--- trunk/Source/WebCore/workers/WorkerScriptLoader.h 2014-05-10 22:41:17 UTC (rev 168585)
+++ trunk/Source/WebCore/workers/WorkerScriptLoader.h 2014-05-10 22:42:35 UTC (rev 168586)
@@ -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 @@
WorkerScriptLoader();
~WorkerScriptLoader();
- std::unique_ptr<ResourceRequest> createResourceRequest();
+ PassOwnPtr<ResourceRequest> createResourceRequest();
void notifyFinished();
WorkerScriptLoaderClient* m_client;
Modified: trunk/Source/WebCore/workers/WorkerThread.cpp (168585 => 168586)
--- trunk/Source/WebCore/workers/WorkerThread.cpp 2014-05-10 22:41:17 UTC (rev 168585)
+++ trunk/Source/WebCore/workers/WorkerThread.cpp 2014-05-10 22:42:35 UTC (rev 168586)
@@ -79,7 +79,10 @@
struct WorkerThreadStartupData {
WTF_MAKE_NONCOPYABLE(WorkerThreadStartupData); WTF_MAKE_FAST_ALLOCATED;
public:
- WorkerThreadStartupData(const URL& scriptURL, const String& userAgent, const GroupSettings*, const String& sourceCode, WorkerThreadStartMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType, const SecurityOrigin* topOrigin);
+ 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));
+ }
URL m_scriptURL;
String m_userAgent;
@@ -89,6 +92,8 @@
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)
@@ -113,7 +118,7 @@
: m_threadID(0)
, m_workerLoaderProxy(workerLoaderProxy)
, m_workerReportingProxy(workerReportingProxy)
- , m_startupData(std::make_unique<WorkerThreadStartupData>(scriptURL, userAgent, settings, sourceCode, startMode, contentSecurityPolicy, contentSecurityPolicyType, topOrigin))
+ , m_startupData(WorkerThreadStartupData::create(scriptURL, userAgent, settings, sourceCode, startMode, contentSecurityPolicy, contentSecurityPolicyType, topOrigin))
#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
, m_notificationClient(0)
#endif
@@ -175,7 +180,7 @@
// 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 = nullptr;
+ m_startupData.clear();
runEventLoop();
Modified: trunk/Source/WebCore/workers/WorkerThread.h (168585 => 168586)
--- trunk/Source/WebCore/workers/WorkerThread.h 2014-05-10 22:41:17 UTC (rev 168585)
+++ trunk/Source/WebCore/workers/WorkerThread.h 2014-05-10 22:42:35 UTC (rev 168586)
@@ -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 @@
RefPtr<WorkerGlobalScope> m_workerGlobalScope;
Mutex m_threadCreationMutex;
- std::unique_ptr<WorkerThreadStartupData> m_startupData;
+ OwnPtr<WorkerThreadStartupData> m_startupData;
#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
NotificationClient* m_notificationClient;