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

Unified Diff: Source/web/WorkerPermissionClient.cpp

Issue 171333003: Pass implementation object to supplemental classes by reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 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
Index: Source/web/WorkerPermissionClient.cpp
diff --git a/Source/web/WorkerPermissionClient.cpp b/Source/web/WorkerPermissionClient.cpp
index 61cefced0692757a2cd684aab1e650f4a0333376..45a169a3639d7124832026694a486bb162130f70 100644
--- a/Source/web/WorkerPermissionClient.cpp
+++ b/Source/web/WorkerPermissionClient.cpp
@@ -75,9 +75,11 @@ const char* WorkerPermissionClient::supplementName()
return "WorkerPermissionClient";
}
-WorkerPermissionClient* WorkerPermissionClient::from(ExecutionContext* context)
+WorkerPermissionClient* WorkerPermissionClient::from(ExecutionContext& context)
{
- return static_cast<WorkerPermissionClient*>(Supplement<WorkerClients>::from(toWorkerGlobalScope(context)->clients(), supplementName()));
+ WorkerClients* clients = toWorkerGlobalScope(context).clients();
+ ASSERT(clients);
+ return static_cast<WorkerPermissionClient*>(Supplement<WorkerClients>::from(*clients, supplementName()));
}
WorkerPermissionClient::WorkerPermissionClient(PassOwnPtr<WebWorkerPermissionClientProxy> proxy)
@@ -87,7 +89,8 @@ WorkerPermissionClient::WorkerPermissionClient(PassOwnPtr<WebWorkerPermissionCli
void providePermissionClientToWorker(WorkerClients* clients, PassOwnPtr<WebWorkerPermissionClientProxy> proxy)
{
- WorkerPermissionClient::provideTo(clients, WorkerPermissionClient::supplementName(), WorkerPermissionClient::create(proxy));
+ ASSERT(clients);
+ WorkerPermissionClient::provideTo(*clients, WorkerPermissionClient::supplementName(), WorkerPermissionClient::create(proxy));
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698