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

Unified Diff: Source/modules/filesystem/LocalFileSystem.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/modules/filesystem/LocalFileSystem.cpp
diff --git a/Source/modules/filesystem/LocalFileSystem.cpp b/Source/modules/filesystem/LocalFileSystem.cpp
index 750a7677cf86bef115b03b58d1c016c871a65c61..611ba4b4d028e0a5313131e7fcfc9fe04a4c557e 100644
--- a/Source/modules/filesystem/LocalFileSystem.cpp
+++ b/Source/modules/filesystem/LocalFileSystem.cpp
@@ -106,19 +106,19 @@ const char* LocalFileSystem::supplementName()
return "LocalFileSystem";
}
-LocalFileSystem* LocalFileSystem::from(ExecutionContext* context)
+LocalFileSystem* LocalFileSystem::from(ExecutionContext& context)
{
- if (context->isDocument()) {
- return static_cast<LocalFileSystem*>(Supplement<Page>::from(toDocument(context)->page(), supplementName()));
+ if (context.isDocument()) {
+ return static_cast<LocalFileSystem*>(Supplement<Page>::from(toDocument(context).page(), supplementName()));
}
- ASSERT(context->isWorkerGlobalScope());
- return static_cast<LocalFileSystem*>(Supplement<WorkerClients>::from(toWorkerGlobalScope(context)->clients(), supplementName()));
+ ASSERT(context.isWorkerGlobalScope());
+ return static_cast<LocalFileSystem*>(Supplement<WorkerClients>::from(toWorkerGlobalScope(context).clients(), supplementName()));
}
-void provideLocalFileSystemTo(Page* page, PassOwnPtr<FileSystemClient> client)
+void provideLocalFileSystemTo(Page& page, PassOwnPtr<FileSystemClient> client)
{
- page->provideSupplement(LocalFileSystem::supplementName(), LocalFileSystem::create(client));
- page->inspectorController().registerModuleAgent(InspectorFileSystemAgent::create(page));
+ page.provideSupplement(LocalFileSystem::supplementName(), LocalFileSystem::create(client));
+ page.inspectorController().registerModuleAgent(InspectorFileSystemAgent::create(&page));
}
void provideLocalFileSystemToWorker(WorkerClients* clients, PassOwnPtr<FileSystemClient> client)

Powered by Google App Engine
This is Rietveld 408576698