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

Unified Diff: Source/modules/filesystem/WorkerGlobalScopeFileSystem.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/WorkerGlobalScopeFileSystem.cpp
diff --git a/Source/modules/filesystem/WorkerGlobalScopeFileSystem.cpp b/Source/modules/filesystem/WorkerGlobalScopeFileSystem.cpp
index 0bfc69c07a198b701fcc30c447929684a1c69927..bf26d527b02cbf76c1c8adf7926b6e91a13d4177 100644
--- a/Source/modules/filesystem/WorkerGlobalScopeFileSystem.cpp
+++ b/Source/modules/filesystem/WorkerGlobalScopeFileSystem.cpp
@@ -45,26 +45,26 @@
namespace WebCore {
-void WorkerGlobalScopeFileSystem::webkitRequestFileSystem(WorkerGlobalScope* worker, int type, long long size, PassOwnPtr<FileSystemCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback)
+void WorkerGlobalScopeFileSystem::webkitRequestFileSystem(WorkerGlobalScope& worker, int type, long long size, PassOwnPtr<FileSystemCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback)
{
- ExecutionContext* secureContext = worker->executionContext();
+ ExecutionContext* secureContext = worker.executionContext();
if (!secureContext->securityOrigin()->canAccessFileSystem()) {
- DOMFileSystem::scheduleCallback(worker, errorCallback, FileError::create(FileError::SECURITY_ERR));
+ DOMFileSystem::scheduleCallback(&worker, errorCallback, FileError::create(FileError::SECURITY_ERR));
return;
}
FileSystemType fileSystemType = static_cast<FileSystemType>(type);
if (!DOMFileSystemBase::isValidType(fileSystemType)) {
- DOMFileSystem::scheduleCallback(worker, errorCallback, FileError::create(FileError::INVALID_MODIFICATION_ERR));
+ DOMFileSystem::scheduleCallback(&worker, errorCallback, FileError::create(FileError::INVALID_MODIFICATION_ERR));
return;
}
- LocalFileSystem::from(worker)->requestFileSystem(worker, fileSystemType, size, FileSystemCallbacks::create(successCallback, errorCallback, worker, fileSystemType));
+ LocalFileSystem::from(worker)->requestFileSystem(&worker, fileSystemType, size, FileSystemCallbacks::create(successCallback, errorCallback, &worker, fileSystemType));
}
-PassRefPtr<DOMFileSystemSync> WorkerGlobalScopeFileSystem::webkitRequestFileSystemSync(WorkerGlobalScope* worker, int type, long long size, ExceptionState& exceptionState)
+PassRefPtr<DOMFileSystemSync> WorkerGlobalScopeFileSystem::webkitRequestFileSystemSync(WorkerGlobalScope& worker, int type, long long size, ExceptionState& exceptionState)
{
- ExecutionContext* secureContext = worker->executionContext();
+ ExecutionContext* secureContext = worker.executionContext();
if (!secureContext->securityOrigin()->canAccessFileSystem()) {
exceptionState.throwSecurityError(FileError::securityErrorMessage);
return 0;
@@ -77,34 +77,34 @@ PassRefPtr<DOMFileSystemSync> WorkerGlobalScopeFileSystem::webkitRequestFileSyst
}
FileSystemSyncCallbackHelper helper;
- OwnPtr<AsyncFileSystemCallbacks> callbacks = FileSystemCallbacks::create(helper.successCallback(), helper.errorCallback(), worker, fileSystemType);
+ OwnPtr<AsyncFileSystemCallbacks> callbacks = FileSystemCallbacks::create(helper.successCallback(), helper.errorCallback(), &worker, fileSystemType);
callbacks->setShouldBlockUntilCompletion(true);
- LocalFileSystem::from(worker)->requestFileSystem(worker, fileSystemType, size, callbacks.release());
+ LocalFileSystem::from(worker)->requestFileSystem(&worker, fileSystemType, size, callbacks.release());
return helper.getResult(exceptionState);
}
-void WorkerGlobalScopeFileSystem::webkitResolveLocalFileSystemURL(WorkerGlobalScope* worker, const String& url, PassOwnPtr<EntryCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback)
+void WorkerGlobalScopeFileSystem::webkitResolveLocalFileSystemURL(WorkerGlobalScope& worker, const String& url, PassOwnPtr<EntryCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback)
{
- KURL completedURL = worker->completeURL(url);
- ExecutionContext* secureContext = worker->executionContext();
+ KURL completedURL = worker.completeURL(url);
+ ExecutionContext* secureContext = worker.executionContext();
if (!secureContext->securityOrigin()->canAccessFileSystem() || !secureContext->securityOrigin()->canRequest(completedURL)) {
- DOMFileSystem::scheduleCallback(worker, errorCallback, FileError::create(FileError::SECURITY_ERR));
+ DOMFileSystem::scheduleCallback(&worker, errorCallback, FileError::create(FileError::SECURITY_ERR));
return;
}
if (!completedURL.isValid()) {
- DOMFileSystem::scheduleCallback(worker, errorCallback, FileError::create(FileError::ENCODING_ERR));
+ DOMFileSystem::scheduleCallback(&worker, errorCallback, FileError::create(FileError::ENCODING_ERR));
return;
}
- LocalFileSystem::from(worker)->resolveURL(worker, completedURL, ResolveURICallbacks::create(successCallback, errorCallback, worker));
+ LocalFileSystem::from(worker)->resolveURL(&worker, completedURL, ResolveURICallbacks::create(successCallback, errorCallback, &worker));
}
-PassRefPtr<EntrySync> WorkerGlobalScopeFileSystem::webkitResolveLocalFileSystemSyncURL(WorkerGlobalScope* worker, const String& url, ExceptionState& exceptionState)
+PassRefPtr<EntrySync> WorkerGlobalScopeFileSystem::webkitResolveLocalFileSystemSyncURL(WorkerGlobalScope& worker, const String& url, ExceptionState& exceptionState)
{
- KURL completedURL = worker->completeURL(url);
- ExecutionContext* secureContext = worker->executionContext();
+ KURL completedURL = worker.completeURL(url);
+ ExecutionContext* secureContext = worker.executionContext();
if (!secureContext->securityOrigin()->canAccessFileSystem() || !secureContext->securityOrigin()->canRequest(completedURL)) {
exceptionState.throwSecurityError(FileError::securityErrorMessage);
return 0;
@@ -116,10 +116,10 @@ PassRefPtr<EntrySync> WorkerGlobalScopeFileSystem::webkitResolveLocalFileSystemS
}
EntrySyncCallbackHelper resolveURLHelper;
- OwnPtr<AsyncFileSystemCallbacks> callbacks = ResolveURICallbacks::create(resolveURLHelper.successCallback(), resolveURLHelper.errorCallback(), worker);
+ OwnPtr<AsyncFileSystemCallbacks> callbacks = ResolveURICallbacks::create(resolveURLHelper.successCallback(), resolveURLHelper.errorCallback(), &worker);
callbacks->setShouldBlockUntilCompletion(true);
- LocalFileSystem::from(worker)->resolveURL(worker, completedURL, callbacks.release());
+ LocalFileSystem::from(worker)->resolveURL(&worker, completedURL, callbacks.release());
RefPtr<EntrySync> entry = resolveURLHelper.getResult(exceptionState);
if (!entry)

Powered by Google App Engine
This is Rietveld 408576698