Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1927)

Unified Diff: Source/web/WebSharedWorkerImpl.cpp

Issue 887463003: Turn WorkerLoaderProxy into a threadsafe, ref-counted object. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Clarify WorkerLoaderProxyProvider's obligations on shutdown Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/web/WebSharedWorkerImpl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebSharedWorkerImpl.cpp
diff --git a/Source/web/WebSharedWorkerImpl.cpp b/Source/web/WebSharedWorkerImpl.cpp
index 2640d4fc504b4b4b27603454fe13bc06d4f95e62..f054d379a35459ecbc98600d431b6fbce095f488 100644
--- a/Source/web/WebSharedWorkerImpl.cpp
+++ b/Source/web/WebSharedWorkerImpl.cpp
@@ -47,6 +47,7 @@
#include "core/workers/WorkerClients.h"
#include "core/workers/WorkerGlobalScope.h"
#include "core/workers/WorkerInspectorProxy.h"
+#include "core/workers/WorkerLoaderProxy.h"
#include "core/workers/WorkerScriptLoader.h"
#include "core/workers/WorkerThreadStartupData.h"
#include "platform/RuntimeEnabledFeatures.h"
@@ -171,6 +172,8 @@ WebSharedWorkerImpl::~WebSharedWorkerImpl()
m_webView->close();
m_mainFrame->close();
+ if (m_loaderProxy)
+ m_loaderProxy->detachProvider(this);
}
void WebSharedWorkerImpl::stopWorkerThread()
@@ -317,7 +320,7 @@ void WebSharedWorkerImpl::workerThreadTerminatedOnMainThread()
delete this;
}
-// WorkerLoaderProxy -----------------------------------------------------------
+// WorkerLoaderProxyProvider -----------------------------------------------------------
void WebSharedWorkerImpl::postTaskToLoader(PassOwnPtr<ExecutionContextTask> task)
{
@@ -392,7 +395,8 @@ void WebSharedWorkerImpl::onScriptLoaderFinished()
WebSecurityOrigin webSecurityOrigin(m_loadingDocument->securityOrigin());
providePermissionClientToWorker(workerClients.get(), adoptPtr(client()->createWorkerPermissionClientProxy(webSecurityOrigin)));
OwnPtrWillBeRawPtr<WorkerThreadStartupData> startupData = WorkerThreadStartupData::create(m_url, m_loadingDocument->userAgent(m_url), m_mainScriptLoader->script(), startMode, m_contentSecurityPolicy, static_cast<ContentSecurityPolicyHeaderType>(m_policyType), starterOrigin, workerClients.release());
- setWorkerThread(SharedWorkerThread::create(m_name, *this, *this, startupData.release()));
+ m_loaderProxy = WorkerLoaderProxy::create(this);
+ setWorkerThread(SharedWorkerThread::create(m_name, m_loaderProxy, *this, startupData.release()));
InspectorInstrumentation::scriptImported(m_loadingDocument.get(), m_mainScriptLoader->identifier(), m_mainScriptLoader->script());
m_mainScriptLoader.clear();
« no previous file with comments | « Source/web/WebSharedWorkerImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698