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

Unified Diff: Source/web/DatabaseObserver.cpp

Issue 27552003: Have WorkerScriptController::workerGlobalScope return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 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/core/workers/WorkerGlobalScope.cpp ('k') | Source/wtf/PassRefPtr.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/DatabaseObserver.cpp
diff --git a/Source/web/DatabaseObserver.cpp b/Source/web/DatabaseObserver.cpp
index 20a87857d84bd79ebcb2c6f8e69036a84499c688..c09ef019ac130bc009b91a3f24ab7400fa4b905f 100644
--- a/Source/web/DatabaseObserver.cpp
+++ b/Source/web/DatabaseObserver.cpp
@@ -62,7 +62,7 @@ static const char allowDatabaseMode[] = "allowDatabaseMode";
// call back to the worker context.
class AllowDatabaseMainThreadBridge : public WorkerAllowMainThreadBridgeBase {
public:
- static PassRefPtr<AllowDatabaseMainThreadBridge> create(WebCore::WorkerGlobalScope* workerGlobalScope, WebWorkerBase* webWorkerBase, const String& mode, WebFrame* frame, const String& name, const String& displayName, unsigned long estimatedSize)
+ static PassRefPtr<AllowDatabaseMainThreadBridge> create(WebCore::WorkerGlobalScope& workerGlobalScope, WebWorkerBase* webWorkerBase, const String& mode, WebFrame* frame, const String& name, const String& displayName, unsigned long estimatedSize)
{
return adoptRef(new AllowDatabaseMainThreadBridge(workerGlobalScope, webWorkerBase, mode, frame, name, displayName, estimatedSize));
}
@@ -85,8 +85,8 @@ private:
unsigned long m_estimatedSize;
};
- AllowDatabaseMainThreadBridge(WebCore::WorkerGlobalScope* workerGlobalScope, WebWorkerBase* webWorkerBase, const String& mode, WebFrame* frame, const String& name, const String& displayName, unsigned long estimatedSize)
- : WorkerAllowMainThreadBridgeBase(workerGlobalScope, webWorkerBase)
+ AllowDatabaseMainThreadBridge(WebCore::WorkerGlobalScope& workerGlobalScope, WebWorkerBase* webWorkerBase, const String& mode, WebFrame* frame, const String& name, const String& displayName, unsigned long estimatedSize)
+ : WorkerAllowMainThreadBridgeBase(&workerGlobalScope, webWorkerBase)
{
postTaskToMainThread(
adoptPtr(new AllowDatabaseParams(mode, frame, name, displayName, estimatedSize)));
@@ -104,8 +104,8 @@ private:
bool allowDatabaseForWorker(WebFrame* frame, const WebString& name, const WebString& displayName, unsigned long estimatedSize)
{
WebCore::WorkerScriptController* controller = WebCore::WorkerScriptController::controllerForContext();
- WebCore::WorkerGlobalScope* workerGlobalScope = controller->workerGlobalScope();
- WebCore::WorkerThread* workerThread = workerGlobalScope->thread();
+ WebCore::WorkerGlobalScope& workerGlobalScope = controller->workerGlobalScope();
+ WebCore::WorkerThread* workerThread = workerGlobalScope.thread();
WebCore::WorkerRunLoop& runLoop = workerThread->runLoop();
WebCore::WorkerLoaderProxy* workerLoaderProxy = &workerThread->workerLoaderProxy();
@@ -116,7 +116,7 @@ bool allowDatabaseForWorker(WebFrame* frame, const WebString& name, const WebStr
RefPtr<AllowDatabaseMainThreadBridge> bridge = AllowDatabaseMainThreadBridge::create(workerGlobalScope, workerLoaderProxy->toWebWorkerBase(), mode, frame, name, displayName, estimatedSize);
// Either the bridge returns, or the queue gets terminated.
- if (runLoop.runInMode(workerGlobalScope, mode) == MessageQueueTerminated) {
+ if (runLoop.runInMode(&workerGlobalScope, mode) == MessageQueueTerminated) {
bridge->cancel();
return false;
}
« no previous file with comments | « Source/core/workers/WorkerGlobalScope.cpp ('k') | Source/wtf/PassRefPtr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698