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

Side by Side Diff: Source/modules/filesystem/WorkerGlobalScopeFileSystem.cpp

Issue 563703002: Oilpan: Enable oilpan for callback classes (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2009, 2011 Google Inc. All Rights Reserved. 3 * Copyright (C) 2009, 2011 Google Inc. All Rights Reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 27 matching lines...) Expand all
38 #include "modules/filesystem/FileEntrySync.h" 38 #include "modules/filesystem/FileEntrySync.h"
39 #include "modules/filesystem/FileSystemCallback.h" 39 #include "modules/filesystem/FileSystemCallback.h"
40 #include "modules/filesystem/FileSystemCallbacks.h" 40 #include "modules/filesystem/FileSystemCallbacks.h"
41 #include "modules/filesystem/LocalFileSystem.h" 41 #include "modules/filesystem/LocalFileSystem.h"
42 #include "modules/filesystem/SyncCallbackHelper.h" 42 #include "modules/filesystem/SyncCallbackHelper.h"
43 #include "platform/FileSystemType.h" 43 #include "platform/FileSystemType.h"
44 #include "platform/weborigin/SecurityOrigin.h" 44 #include "platform/weborigin/SecurityOrigin.h"
45 45
46 namespace blink { 46 namespace blink {
47 47
48 void WorkerGlobalScopeFileSystem::webkitRequestFileSystem(WorkerGlobalScope& wor ker, int type, long long size, PassOwnPtrWillBeRawPtr<FileSystemCallback> succes sCallback, PassOwnPtrWillBeRawPtr<ErrorCallback> errorCallback) 48 void WorkerGlobalScopeFileSystem::webkitRequestFileSystem(WorkerGlobalScope& wor ker, int type, long long size, FileSystemCallback* successCallback, ErrorCallbac k* errorCallback)
49 { 49 {
50 ExecutionContext* secureContext = worker.executionContext(); 50 ExecutionContext* secureContext = worker.executionContext();
51 if (!secureContext->securityOrigin()->canAccessFileSystem()) { 51 if (!secureContext->securityOrigin()->canAccessFileSystem()) {
52 DOMFileSystem::scheduleCallback(&worker, errorCallback, FileError::creat e(FileError::SECURITY_ERR)); 52 DOMFileSystem::scheduleCallback(&worker, errorCallback, FileError::creat e(FileError::SECURITY_ERR));
53 return; 53 return;
54 } 54 }
55 55
56 FileSystemType fileSystemType = static_cast<FileSystemType>(type); 56 FileSystemType fileSystemType = static_cast<FileSystemType>(type);
57 if (!DOMFileSystemBase::isValidType(fileSystemType)) { 57 if (!DOMFileSystemBase::isValidType(fileSystemType)) {
58 DOMFileSystem::scheduleCallback(&worker, errorCallback, FileError::creat e(FileError::INVALID_MODIFICATION_ERR)); 58 DOMFileSystem::scheduleCallback(&worker, errorCallback, FileError::creat e(FileError::INVALID_MODIFICATION_ERR));
(...skipping 18 matching lines...) Expand all
77 } 77 }
78 78
79 FileSystemSyncCallbackHelper* helper = FileSystemSyncCallbackHelper::create( ); 79 FileSystemSyncCallbackHelper* helper = FileSystemSyncCallbackHelper::create( );
80 OwnPtr<AsyncFileSystemCallbacks> callbacks = FileSystemCallbacks::create(hel per->successCallback(), helper->errorCallback(), &worker, fileSystemType); 80 OwnPtr<AsyncFileSystemCallbacks> callbacks = FileSystemCallbacks::create(hel per->successCallback(), helper->errorCallback(), &worker, fileSystemType);
81 callbacks->setShouldBlockUntilCompletion(true); 81 callbacks->setShouldBlockUntilCompletion(true);
82 82
83 LocalFileSystem::from(worker)->requestFileSystem(&worker, fileSystemType, si ze, callbacks.release()); 83 LocalFileSystem::from(worker)->requestFileSystem(&worker, fileSystemType, si ze, callbacks.release());
84 return helper->getResult(exceptionState); 84 return helper->getResult(exceptionState);
85 } 85 }
86 86
87 void WorkerGlobalScopeFileSystem::webkitResolveLocalFileSystemURL(WorkerGlobalSc ope& worker, const String& url, PassOwnPtrWillBeRawPtr<EntryCallback> successCal lback, PassOwnPtrWillBeRawPtr<ErrorCallback> errorCallback) 87 void WorkerGlobalScopeFileSystem::webkitResolveLocalFileSystemURL(WorkerGlobalSc ope& worker, const String& url, EntryCallback* successCallback, ErrorCallback* e rrorCallback)
88 { 88 {
89 KURL completedURL = worker.completeURL(url); 89 KURL completedURL = worker.completeURL(url);
90 ExecutionContext* secureContext = worker.executionContext(); 90 ExecutionContext* secureContext = worker.executionContext();
91 if (!secureContext->securityOrigin()->canAccessFileSystem() || !secureContex t->securityOrigin()->canRequest(completedURL)) { 91 if (!secureContext->securityOrigin()->canAccessFileSystem() || !secureContex t->securityOrigin()->canRequest(completedURL)) {
92 DOMFileSystem::scheduleCallback(&worker, errorCallback, FileError::creat e(FileError::SECURITY_ERR)); 92 DOMFileSystem::scheduleCallback(&worker, errorCallback, FileError::creat e(FileError::SECURITY_ERR));
93 return; 93 return;
94 } 94 }
95 95
96 if (!completedURL.isValid()) { 96 if (!completedURL.isValid()) {
97 DOMFileSystem::scheduleCallback(&worker, errorCallback, FileError::creat e(FileError::ENCODING_ERR)); 97 DOMFileSystem::scheduleCallback(&worker, errorCallback, FileError::creat e(FileError::ENCODING_ERR));
(...skipping 23 matching lines...) Expand all
121 121
122 LocalFileSystem::from(worker)->resolveURL(&worker, completedURL, callbacks.r elease()); 122 LocalFileSystem::from(worker)->resolveURL(&worker, completedURL, callbacks.r elease());
123 123
124 return resolveURLHelper->getResult(exceptionState); 124 return resolveURLHelper->getResult(exceptionState);
125 } 125 }
126 126
127 COMPILE_ASSERT(static_cast<int>(WorkerGlobalScopeFileSystem::TEMPORARY) == stati c_cast<int>(FileSystemTypeTemporary), enum_mismatch); 127 COMPILE_ASSERT(static_cast<int>(WorkerGlobalScopeFileSystem::TEMPORARY) == stati c_cast<int>(FileSystemTypeTemporary), enum_mismatch);
128 COMPILE_ASSERT(static_cast<int>(WorkerGlobalScopeFileSystem::PERSISTENT) == stat ic_cast<int>(FileSystemTypePersistent), enum_mismatch); 128 COMPILE_ASSERT(static_cast<int>(WorkerGlobalScopeFileSystem::PERSISTENT) == stat ic_cast<int>(FileSystemTypePersistent), enum_mismatch);
129 129
130 } // namespace blink 130 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/filesystem/WorkerGlobalScopeFileSystem.h ('k') | Source/modules/geolocation/GeoNotifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698