| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/child/fileapi/webfilesystem_impl.h" | 5 #include "content/child/fileapi/webfilesystem_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
| 11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
| 12 #include "base/synchronization/waitable_event.h" | 12 #include "base/synchronization/waitable_event.h" |
| 13 #include "base/thread_task_runner_handle.h" |
| 13 #include "base/threading/thread_local.h" | 14 #include "base/threading/thread_local.h" |
| 14 #include "content/child/child_thread_impl.h" | 15 #include "content/child/child_thread_impl.h" |
| 15 #include "content/child/file_info_util.h" | 16 #include "content/child/file_info_util.h" |
| 16 #include "content/child/fileapi/file_system_dispatcher.h" | 17 #include "content/child/fileapi/file_system_dispatcher.h" |
| 17 #include "content/child/fileapi/webfilewriter_impl.h" | 18 #include "content/child/fileapi/webfilewriter_impl.h" |
| 18 #include "content/child/worker_task_runner.h" | |
| 19 #include "content/common/fileapi/file_system_messages.h" | 19 #include "content/common/fileapi/file_system_messages.h" |
| 20 #include "storage/common/fileapi/directory_entry.h" | 20 #include "storage/common/fileapi/directory_entry.h" |
| 21 #include "storage/common/fileapi/file_system_util.h" | 21 #include "storage/common/fileapi/file_system_util.h" |
| 22 #include "third_party/WebKit/public/platform/WebFileInfo.h" | 22 #include "third_party/WebKit/public/platform/WebFileInfo.h" |
| 23 #include "third_party/WebKit/public/platform/WebFileSystemCallbacks.h" | 23 #include "third_party/WebKit/public/platform/WebFileSystemCallbacks.h" |
| 24 #include "third_party/WebKit/public/platform/WebString.h" | 24 #include "third_party/WebKit/public/platform/WebString.h" |
| 25 #include "third_party/WebKit/public/platform/WebURL.h" | 25 #include "third_party/WebKit/public/platform/WebURL.h" |
| 26 #include "third_party/WebKit/public/web/WebHeap.h" | 26 #include "third_party/WebKit/public/web/WebHeap.h" |
| 27 #include "url/gurl.h" | 27 #include "url/gurl.h" |
| 28 | 28 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 | 84 |
| 85 base::LazyInstance<base::ThreadLocalPointer<WebFileSystemImpl> >::Leaky | 85 base::LazyInstance<base::ThreadLocalPointer<WebFileSystemImpl> >::Leaky |
| 86 g_webfilesystem_tls = LAZY_INSTANCE_INITIALIZER; | 86 g_webfilesystem_tls = LAZY_INSTANCE_INITIALIZER; |
| 87 | 87 |
| 88 void DidReceiveSnapshotFile(int request_id) { | 88 void DidReceiveSnapshotFile(int request_id) { |
| 89 if (ChildThreadImpl::current()) | 89 if (ChildThreadImpl::current()) |
| 90 ChildThreadImpl::current()->Send( | 90 ChildThreadImpl::current()->Send( |
| 91 new FileSystemHostMsg_DidReceiveSnapshotFile(request_id)); | 91 new FileSystemHostMsg_DidReceiveSnapshotFile(request_id)); |
| 92 } | 92 } |
| 93 | 93 |
| 94 int CurrentWorkerId() { | |
| 95 return WorkerTaskRunner::Instance()->CurrentWorkerId(); | |
| 96 } | |
| 97 | |
| 98 template <typename Method, typename Params> | 94 template <typename Method, typename Params> |
| 99 void CallDispatcherOnMainThread( | 95 void CallDispatcherOnMainThread( |
| 100 const scoped_refptr<base::SingleThreadTaskRunner>& main_thread_task_runner, | 96 const scoped_refptr<base::SingleThreadTaskRunner>& main_thread_task_runner, |
| 101 Method method, const Params& params, | 97 Method method, const Params& params, |
| 102 WaitableCallbackResults* waitable_results) { | 98 WaitableCallbackResults* waitable_results) { |
| 103 if (!main_thread_task_runner->RunsTasksOnCurrentThread()) { | 99 if (!main_thread_task_runner->RunsTasksOnCurrentThread()) { |
| 104 main_thread_task_runner->PostTask( | 100 main_thread_task_runner->PostTask( |
| 105 FROM_HERE, | 101 FROM_HERE, |
| 106 base::Bind(&CallDispatcherOnMainThread<Method, Params>, | 102 base::Bind(&CallDispatcherOnMainThread<Method, Params>, |
| 107 main_thread_task_runner, method, params, | 103 main_thread_task_runner, method, params, |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 WebFileSystemImpl* filesystem = | 180 WebFileSystemImpl* filesystem = |
| 185 WebFileSystemImpl::ThreadSpecificInstance(NULL); | 181 WebFileSystemImpl::ThreadSpecificInstance(NULL); |
| 186 if (!filesystem) | 182 if (!filesystem) |
| 187 return; | 183 return; |
| 188 WebFileSystemCallbacks callbacks = filesystem->GetCallbacks(callbacks_id); | 184 WebFileSystemCallbacks callbacks = filesystem->GetCallbacks(callbacks_id); |
| 189 if (callbacks_unregister_mode == UNREGISTER_CALLBACKS) | 185 if (callbacks_unregister_mode == UNREGISTER_CALLBACKS) |
| 190 filesystem->UnregisterCallbacks(callbacks_id); | 186 filesystem->UnregisterCallbacks(callbacks_id); |
| 191 callback.Run(&callbacks); | 187 callback.Run(&callbacks); |
| 192 } | 188 } |
| 193 | 189 |
| 194 void DispatchResultsClosure(int thread_id, int callbacks_id, | 190 void DispatchResultsClosure( |
| 195 WaitableCallbackResults* waitable_results, | 191 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
| 196 const base::Closure& results_closure) { | 192 int callbacks_id, |
| 197 if (thread_id != CurrentWorkerId()) { | 193 WaitableCallbackResults* waitable_results, |
| 198 if (waitable_results) { | 194 const base::Closure& results_closure) { |
| 199 // If someone is waiting, this should result in running the closure. | 195 if (task_runner->BelongsToCurrentThread()) { |
| 200 waitable_results->AddResultsAndSignal(results_closure); | 196 results_closure.Run(); |
| 201 // In case no one is waiting, post a task to run the closure. | |
| 202 WorkerTaskRunner::Instance()->PostTask( | |
| 203 thread_id, | |
| 204 base::Bind(&WaitableCallbackResults::Run, | |
| 205 make_scoped_refptr(waitable_results))); | |
| 206 return; | |
| 207 } | |
| 208 WorkerTaskRunner::Instance()->PostTask(thread_id, results_closure); | |
| 209 return; | 197 return; |
| 210 } | 198 } |
| 211 results_closure.Run(); | 199 |
| 200 if (waitable_results) { |
| 201 // If someone is waiting, this should result in running the closure. |
| 202 waitable_results->AddResultsAndSignal(results_closure); |
| 203 // In case no one is waiting, post a task to run the closure. |
| 204 task_runner->PostTask(FROM_HERE, |
| 205 base::Bind(&WaitableCallbackResults::Run, |
| 206 make_scoped_refptr(waitable_results))); |
| 207 return; |
| 208 } |
| 209 task_runner->PostTask(FROM_HERE, results_closure); |
| 212 } | 210 } |
| 213 | 211 |
| 214 void CallbackFileSystemCallbacks( | 212 void CallbackFileSystemCallbacks( |
| 215 int thread_id, int callbacks_id, | 213 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
| 214 int callbacks_id, |
| 216 WaitableCallbackResults* waitable_results, | 215 WaitableCallbackResults* waitable_results, |
| 217 const base::Callback<void(WebFileSystemCallbacks*)>& callback, | 216 const base::Callback<void(WebFileSystemCallbacks*)>& callback, |
| 218 CallbacksUnregisterMode callbacksunregister_mode) { | 217 CallbacksUnregisterMode callbacksunregister_mode) { |
| 219 DispatchResultsClosure( | 218 DispatchResultsClosure(task_runner, callbacks_id, waitable_results, |
| 220 thread_id, callbacks_id, waitable_results, | 219 base::Bind(&RunCallbacks, callbacks_id, callback, |
| 221 base::Bind(&RunCallbacks, callbacks_id, callback, | 220 callbacksunregister_mode)); |
| 222 callbacksunregister_mode)); | |
| 223 } | 221 } |
| 224 | 222 |
| 225 //----------------------------------------------------------------------------- | 223 //----------------------------------------------------------------------------- |
| 226 // Callback adapters. Callbacks must be called on the original calling thread, | 224 // Callback adapters. Callbacks must be called on the original calling thread, |
| 227 // so these callback adapters relay back the results to the calling thread | 225 // so these callback adapters relay back the results to the calling thread |
| 228 // if necessary. | 226 // if necessary. |
| 229 | 227 |
| 230 void OpenFileSystemCallbackAdapter( | 228 void OpenFileSystemCallbackAdapter( |
| 231 int thread_id, int callbacks_id, | 229 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
| 230 int callbacks_id, |
| 232 WaitableCallbackResults* waitable_results, | 231 WaitableCallbackResults* waitable_results, |
| 233 const std::string& name, const GURL& root) { | 232 const std::string& name, |
| 233 const GURL& root) { |
| 234 CallbackFileSystemCallbacks( | 234 CallbackFileSystemCallbacks( |
| 235 thread_id, callbacks_id, waitable_results, | 235 task_runner, callbacks_id, waitable_results, |
| 236 base::Bind(&DidOpenFileSystem, base::UTF8ToUTF16(name), root), | 236 base::Bind(&DidOpenFileSystem, base::UTF8ToUTF16(name), root), |
| 237 UNREGISTER_CALLBACKS); | 237 UNREGISTER_CALLBACKS); |
| 238 } | 238 } |
| 239 | 239 |
| 240 void ResolveURLCallbackAdapter(int thread_id, | 240 void ResolveURLCallbackAdapter( |
| 241 int callbacks_id, | 241 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
| 242 WaitableCallbackResults* waitable_results, | 242 int callbacks_id, |
| 243 const storage::FileSystemInfo& info, | 243 WaitableCallbackResults* waitable_results, |
| 244 const base::FilePath& file_path, | 244 const storage::FileSystemInfo& info, |
| 245 bool is_directory) { | 245 const base::FilePath& file_path, |
| 246 bool is_directory) { |
| 246 base::FilePath normalized_path( | 247 base::FilePath normalized_path( |
| 247 storage::VirtualPath::GetNormalizedFilePath(file_path)); | 248 storage::VirtualPath::GetNormalizedFilePath(file_path)); |
| 248 CallbackFileSystemCallbacks( | 249 CallbackFileSystemCallbacks( |
| 249 thread_id, callbacks_id, waitable_results, | 250 task_runner, callbacks_id, waitable_results, |
| 250 base::Bind(&DidResolveURL, base::UTF8ToUTF16(info.name), info.root_url, | 251 base::Bind(&DidResolveURL, base::UTF8ToUTF16(info.name), info.root_url, |
| 251 info.mount_type, | 252 info.mount_type, normalized_path.AsUTF16Unsafe(), |
| 252 normalized_path.AsUTF16Unsafe(), is_directory), | 253 is_directory), |
| 253 UNREGISTER_CALLBACKS); | 254 UNREGISTER_CALLBACKS); |
| 254 } | 255 } |
| 255 | 256 |
| 256 void StatusCallbackAdapter(int thread_id, int callbacks_id, | 257 void StatusCallbackAdapter( |
| 257 WaitableCallbackResults* waitable_results, | 258 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
| 258 base::File::Error error) { | 259 int callbacks_id, |
| 260 WaitableCallbackResults* waitable_results, |
| 261 base::File::Error error) { |
| 259 if (error == base::File::FILE_OK) { | 262 if (error == base::File::FILE_OK) { |
| 260 CallbackFileSystemCallbacks( | 263 CallbackFileSystemCallbacks(task_runner, callbacks_id, waitable_results, |
| 261 thread_id, callbacks_id, waitable_results, | 264 base::Bind(&DidSucceed), UNREGISTER_CALLBACKS); |
| 262 base::Bind(&DidSucceed), | |
| 263 UNREGISTER_CALLBACKS); | |
| 264 } else { | 265 } else { |
| 265 CallbackFileSystemCallbacks( | 266 CallbackFileSystemCallbacks(task_runner, callbacks_id, waitable_results, |
| 266 thread_id, callbacks_id, waitable_results, | 267 base::Bind(&DidFail, error), |
| 267 base::Bind(&DidFail, error), | 268 UNREGISTER_CALLBACKS); |
| 268 UNREGISTER_CALLBACKS); | |
| 269 } | 269 } |
| 270 } | 270 } |
| 271 | 271 |
| 272 void ReadMetadataCallbackAdapter(int thread_id, int callbacks_id, | 272 void ReadMetadataCallbackAdapter( |
| 273 WaitableCallbackResults* waitable_results, | 273 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
| 274 const base::File::Info& file_info) { | 274 int callbacks_id, |
| 275 CallbackFileSystemCallbacks( | 275 WaitableCallbackResults* waitable_results, |
| 276 thread_id, callbacks_id, waitable_results, | 276 const base::File::Info& file_info) { |
| 277 base::Bind(&DidReadMetadata, file_info), | 277 CallbackFileSystemCallbacks(task_runner, callbacks_id, waitable_results, |
| 278 UNREGISTER_CALLBACKS); | 278 base::Bind(&DidReadMetadata, file_info), |
| 279 UNREGISTER_CALLBACKS); |
| 279 } | 280 } |
| 280 | 281 |
| 281 void ReadDirectoryCallbackAdapter( | 282 void ReadDirectoryCallbackAdapter( |
| 282 int thread_id, | 283 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
| 283 int callbacks_id, | 284 int callbacks_id, |
| 284 WaitableCallbackResults* waitable_results, | 285 WaitableCallbackResults* waitable_results, |
| 285 const std::vector<storage::DirectoryEntry>& entries, | 286 const std::vector<storage::DirectoryEntry>& entries, |
| 286 bool has_more) { | 287 bool has_more) { |
| 287 CallbackFileSystemCallbacks( | 288 CallbackFileSystemCallbacks( |
| 288 thread_id, callbacks_id, waitable_results, | 289 task_runner, callbacks_id, waitable_results, |
| 289 base::Bind(&DidReadDirectory, entries, has_more), | 290 base::Bind(&DidReadDirectory, entries, has_more), |
| 290 has_more ? DO_NOT_UNREGISTER_CALLBACKS : UNREGISTER_CALLBACKS); | 291 has_more ? DO_NOT_UNREGISTER_CALLBACKS : UNREGISTER_CALLBACKS); |
| 291 } | 292 } |
| 292 | 293 |
| 293 void DidCreateFileWriter( | 294 void DidCreateFileWriter( |
| 294 int callbacks_id, | 295 int callbacks_id, |
| 295 const GURL& path, | 296 const GURL& path, |
| 296 blink::WebFileWriterClient* client, | 297 blink::WebFileWriterClient* client, |
| 297 const scoped_refptr<base::SingleThreadTaskRunner>& main_thread_task_runner, | 298 const scoped_refptr<base::SingleThreadTaskRunner>& main_thread_task_runner, |
| 298 const base::File::Info& file_info) { | 299 const base::File::Info& file_info) { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 310 } | 311 } |
| 311 WebFileWriterImpl::Type type = | 312 WebFileWriterImpl::Type type = |
| 312 callbacks.shouldBlockUntilCompletion() ? | 313 callbacks.shouldBlockUntilCompletion() ? |
| 313 WebFileWriterImpl::TYPE_SYNC : WebFileWriterImpl::TYPE_ASYNC; | 314 WebFileWriterImpl::TYPE_SYNC : WebFileWriterImpl::TYPE_ASYNC; |
| 314 callbacks.didCreateFileWriter( | 315 callbacks.didCreateFileWriter( |
| 315 new WebFileWriterImpl(path, client, type, main_thread_task_runner), | 316 new WebFileWriterImpl(path, client, type, main_thread_task_runner), |
| 316 file_info.size); | 317 file_info.size); |
| 317 } | 318 } |
| 318 | 319 |
| 319 void CreateFileWriterCallbackAdapter( | 320 void CreateFileWriterCallbackAdapter( |
| 320 int thread_id, int callbacks_id, | 321 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
| 322 int callbacks_id, |
| 321 WaitableCallbackResults* waitable_results, | 323 WaitableCallbackResults* waitable_results, |
| 322 const scoped_refptr<base::SingleThreadTaskRunner>& main_thread_task_runner, | 324 const scoped_refptr<base::SingleThreadTaskRunner>& main_thread_task_runner, |
| 323 const GURL& path, | 325 const GURL& path, |
| 324 blink::WebFileWriterClient* client, | 326 blink::WebFileWriterClient* client, |
| 325 const base::File::Info& file_info) { | 327 const base::File::Info& file_info) { |
| 326 DispatchResultsClosure( | 328 DispatchResultsClosure( |
| 327 thread_id, callbacks_id, waitable_results, | 329 task_runner, callbacks_id, waitable_results, |
| 328 base::Bind(&DidCreateFileWriter, callbacks_id, path, client, | 330 base::Bind(&DidCreateFileWriter, callbacks_id, path, client, |
| 329 main_thread_task_runner, file_info)); | 331 main_thread_task_runner, file_info)); |
| 330 } | 332 } |
| 331 | 333 |
| 332 void DidCreateSnapshotFile( | 334 void DidCreateSnapshotFile( |
| 333 int callbacks_id, | 335 int callbacks_id, |
| 334 const scoped_refptr<base::SingleThreadTaskRunner>& main_thread_task_runner, | 336 const scoped_refptr<base::SingleThreadTaskRunner>& main_thread_task_runner, |
| 335 const base::File::Info& file_info, | 337 const base::File::Info& file_info, |
| 336 const base::FilePath& platform_path, | 338 const base::FilePath& platform_path, |
| 337 int request_id) { | 339 int request_id) { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 348 web_file_info.platformPath = platform_path.AsUTF16Unsafe(); | 350 web_file_info.platformPath = platform_path.AsUTF16Unsafe(); |
| 349 callbacks.didCreateSnapshotFile(web_file_info); | 351 callbacks.didCreateSnapshotFile(web_file_info); |
| 350 | 352 |
| 351 // TODO(michaeln,kinuko): Use ThreadSafeSender when Blob becomes | 353 // TODO(michaeln,kinuko): Use ThreadSafeSender when Blob becomes |
| 352 // non-bridge model. | 354 // non-bridge model. |
| 353 main_thread_task_runner->PostTask( | 355 main_thread_task_runner->PostTask( |
| 354 FROM_HERE, base::Bind(&DidReceiveSnapshotFile, request_id)); | 356 FROM_HERE, base::Bind(&DidReceiveSnapshotFile, request_id)); |
| 355 } | 357 } |
| 356 | 358 |
| 357 void CreateSnapshotFileCallbackAdapter( | 359 void CreateSnapshotFileCallbackAdapter( |
| 358 int thread_id, int callbacks_id, | 360 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
| 361 int callbacks_id, |
| 359 WaitableCallbackResults* waitable_results, | 362 WaitableCallbackResults* waitable_results, |
| 360 const scoped_refptr<base::SingleThreadTaskRunner>& main_thread_task_runner, | 363 const scoped_refptr<base::SingleThreadTaskRunner>& main_thread_task_runner, |
| 361 const base::File::Info& file_info, | 364 const base::File::Info& file_info, |
| 362 const base::FilePath& platform_path, | 365 const base::FilePath& platform_path, |
| 363 int request_id) { | 366 int request_id) { |
| 364 DispatchResultsClosure( | 367 DispatchResultsClosure( |
| 365 thread_id, callbacks_id, waitable_results, | 368 task_runner, callbacks_id, waitable_results, |
| 366 base::Bind(&DidCreateSnapshotFile, callbacks_id, main_thread_task_runner, | 369 base::Bind(&DidCreateSnapshotFile, callbacks_id, main_thread_task_runner, |
| 367 file_info, platform_path, request_id)); | 370 file_info, platform_path, request_id)); |
| 368 } | 371 } |
| 369 | 372 |
| 370 } // namespace | 373 } // namespace |
| 371 | 374 |
| 372 //----------------------------------------------------------------------------- | 375 //----------------------------------------------------------------------------- |
| 373 // WebFileSystemImpl | 376 // WebFileSystemImpl |
| 374 | 377 |
| 375 WebFileSystemImpl* WebFileSystemImpl::ThreadSpecificInstance( | 378 WebFileSystemImpl* WebFileSystemImpl::ThreadSpecificInstance( |
| (...skipping 30 matching lines...) Expand all Loading... |
| 406 } | 409 } |
| 407 | 410 |
| 408 void WebFileSystemImpl::openFileSystem( | 411 void WebFileSystemImpl::openFileSystem( |
| 409 const blink::WebURL& storage_partition, | 412 const blink::WebURL& storage_partition, |
| 410 blink::WebFileSystemType type, | 413 blink::WebFileSystemType type, |
| 411 WebFileSystemCallbacks callbacks) { | 414 WebFileSystemCallbacks callbacks) { |
| 412 int callbacks_id = RegisterCallbacks(callbacks); | 415 int callbacks_id = RegisterCallbacks(callbacks); |
| 413 scoped_refptr<WaitableCallbackResults> waitable_results = | 416 scoped_refptr<WaitableCallbackResults> waitable_results = |
| 414 MaybeCreateWaitableResults(callbacks, callbacks_id); | 417 MaybeCreateWaitableResults(callbacks, callbacks_id); |
| 415 CallDispatcherOnMainThread( | 418 CallDispatcherOnMainThread( |
| 416 main_thread_task_runner_, | 419 main_thread_task_runner_, &FileSystemDispatcher::OpenFileSystem, |
| 417 &FileSystemDispatcher::OpenFileSystem, | |
| 418 MakeTuple(GURL(storage_partition), | 420 MakeTuple(GURL(storage_partition), |
| 419 static_cast<storage::FileSystemType>(type), | 421 static_cast<storage::FileSystemType>(type), |
| 420 base::Bind(&OpenFileSystemCallbackAdapter, | 422 base::Bind(&OpenFileSystemCallbackAdapter, |
| 421 CurrentWorkerId(), | 423 base::ThreadTaskRunnerHandle::Get(), callbacks_id, |
| 422 callbacks_id, | |
| 423 waitable_results), | 424 waitable_results), |
| 424 base::Bind(&StatusCallbackAdapter, | 425 base::Bind(&StatusCallbackAdapter, |
| 425 CurrentWorkerId(), | 426 base::ThreadTaskRunnerHandle::Get(), callbacks_id, |
| 426 callbacks_id, | |
| 427 waitable_results)), | 427 waitable_results)), |
| 428 waitable_results.get()); | 428 waitable_results.get()); |
| 429 } | 429 } |
| 430 | 430 |
| 431 void WebFileSystemImpl::resolveURL( | 431 void WebFileSystemImpl::resolveURL( |
| 432 const blink::WebURL& filesystem_url, | 432 const blink::WebURL& filesystem_url, |
| 433 WebFileSystemCallbacks callbacks) { | 433 WebFileSystemCallbacks callbacks) { |
| 434 int callbacks_id = RegisterCallbacks(callbacks); | 434 int callbacks_id = RegisterCallbacks(callbacks); |
| 435 scoped_refptr<WaitableCallbackResults> waitable_results = | 435 scoped_refptr<WaitableCallbackResults> waitable_results = |
| 436 MaybeCreateWaitableResults(callbacks, callbacks_id); | 436 MaybeCreateWaitableResults(callbacks, callbacks_id); |
| 437 CallDispatcherOnMainThread( | 437 CallDispatcherOnMainThread( |
| 438 main_thread_task_runner_, | 438 main_thread_task_runner_, &FileSystemDispatcher::ResolveURL, |
| 439 &FileSystemDispatcher::ResolveURL, | |
| 440 MakeTuple(GURL(filesystem_url), | 439 MakeTuple(GURL(filesystem_url), |
| 441 base::Bind(&ResolveURLCallbackAdapter, | 440 base::Bind(&ResolveURLCallbackAdapter, |
| 442 CurrentWorkerId(), callbacks_id, waitable_results), | 441 base::ThreadTaskRunnerHandle::Get(), callbacks_id, |
| 442 waitable_results), |
| 443 base::Bind(&StatusCallbackAdapter, | 443 base::Bind(&StatusCallbackAdapter, |
| 444 CurrentWorkerId(), callbacks_id, waitable_results)), | 444 base::ThreadTaskRunnerHandle::Get(), callbacks_id, |
| 445 waitable_results)), |
| 445 waitable_results.get()); | 446 waitable_results.get()); |
| 446 } | 447 } |
| 447 | 448 |
| 448 void WebFileSystemImpl::deleteFileSystem( | 449 void WebFileSystemImpl::deleteFileSystem( |
| 449 const blink::WebURL& storage_partition, | 450 const blink::WebURL& storage_partition, |
| 450 blink::WebFileSystemType type, | 451 blink::WebFileSystemType type, |
| 451 WebFileSystemCallbacks callbacks) { | 452 WebFileSystemCallbacks callbacks) { |
| 452 int callbacks_id = RegisterCallbacks(callbacks); | 453 int callbacks_id = RegisterCallbacks(callbacks); |
| 453 scoped_refptr<WaitableCallbackResults> waitable_results = | 454 scoped_refptr<WaitableCallbackResults> waitable_results = |
| 454 MaybeCreateWaitableResults(callbacks, callbacks_id); | 455 MaybeCreateWaitableResults(callbacks, callbacks_id); |
| 455 CallDispatcherOnMainThread( | 456 CallDispatcherOnMainThread( |
| 456 main_thread_task_runner_, | 457 main_thread_task_runner_, &FileSystemDispatcher::DeleteFileSystem, |
| 457 &FileSystemDispatcher::DeleteFileSystem, | |
| 458 MakeTuple(GURL(storage_partition), | 458 MakeTuple(GURL(storage_partition), |
| 459 static_cast<storage::FileSystemType>(type), | 459 static_cast<storage::FileSystemType>(type), |
| 460 base::Bind(&StatusCallbackAdapter, | 460 base::Bind(&StatusCallbackAdapter, |
| 461 CurrentWorkerId(), | 461 base::ThreadTaskRunnerHandle::Get(), callbacks_id, |
| 462 callbacks_id, | |
| 463 waitable_results)), | 462 waitable_results)), |
| 464 waitable_results.get()); | 463 waitable_results.get()); |
| 465 } | 464 } |
| 466 | 465 |
| 467 void WebFileSystemImpl::move( | 466 void WebFileSystemImpl::move( |
| 468 const blink::WebURL& src_path, | 467 const blink::WebURL& src_path, |
| 469 const blink::WebURL& dest_path, | 468 const blink::WebURL& dest_path, |
| 470 WebFileSystemCallbacks callbacks) { | 469 WebFileSystemCallbacks callbacks) { |
| 471 int callbacks_id = RegisterCallbacks(callbacks); | 470 int callbacks_id = RegisterCallbacks(callbacks); |
| 472 scoped_refptr<WaitableCallbackResults> waitable_results = | 471 scoped_refptr<WaitableCallbackResults> waitable_results = |
| 473 MaybeCreateWaitableResults(callbacks, callbacks_id); | 472 MaybeCreateWaitableResults(callbacks, callbacks_id); |
| 474 CallDispatcherOnMainThread( | 473 CallDispatcherOnMainThread( |
| 475 main_thread_task_runner_, | 474 main_thread_task_runner_, &FileSystemDispatcher::Move, |
| 476 &FileSystemDispatcher::Move, | |
| 477 MakeTuple(GURL(src_path), GURL(dest_path), | 475 MakeTuple(GURL(src_path), GURL(dest_path), |
| 478 base::Bind(&StatusCallbackAdapter, | 476 base::Bind(&StatusCallbackAdapter, |
| 479 CurrentWorkerId(), callbacks_id, waitable_results)), | 477 base::ThreadTaskRunnerHandle::Get(), callbacks_id, |
| 478 waitable_results)), |
| 480 waitable_results.get()); | 479 waitable_results.get()); |
| 481 } | 480 } |
| 482 | 481 |
| 483 void WebFileSystemImpl::copy( | 482 void WebFileSystemImpl::copy( |
| 484 const blink::WebURL& src_path, | 483 const blink::WebURL& src_path, |
| 485 const blink::WebURL& dest_path, | 484 const blink::WebURL& dest_path, |
| 486 WebFileSystemCallbacks callbacks) { | 485 WebFileSystemCallbacks callbacks) { |
| 487 int callbacks_id = RegisterCallbacks(callbacks); | 486 int callbacks_id = RegisterCallbacks(callbacks); |
| 488 scoped_refptr<WaitableCallbackResults> waitable_results = | 487 scoped_refptr<WaitableCallbackResults> waitable_results = |
| 489 MaybeCreateWaitableResults(callbacks, callbacks_id); | 488 MaybeCreateWaitableResults(callbacks, callbacks_id); |
| 490 CallDispatcherOnMainThread( | 489 CallDispatcherOnMainThread( |
| 491 main_thread_task_runner_, | 490 main_thread_task_runner_, &FileSystemDispatcher::Copy, |
| 492 &FileSystemDispatcher::Copy, | |
| 493 MakeTuple(GURL(src_path), GURL(dest_path), | 491 MakeTuple(GURL(src_path), GURL(dest_path), |
| 494 base::Bind(&StatusCallbackAdapter, | 492 base::Bind(&StatusCallbackAdapter, |
| 495 CurrentWorkerId(), callbacks_id, waitable_results)), | 493 base::ThreadTaskRunnerHandle::Get(), callbacks_id, |
| 494 waitable_results)), |
| 496 waitable_results.get()); | 495 waitable_results.get()); |
| 497 } | 496 } |
| 498 | 497 |
| 499 void WebFileSystemImpl::remove( | 498 void WebFileSystemImpl::remove( |
| 500 const blink::WebURL& path, | 499 const blink::WebURL& path, |
| 501 WebFileSystemCallbacks callbacks) { | 500 WebFileSystemCallbacks callbacks) { |
| 502 int callbacks_id = RegisterCallbacks(callbacks); | 501 int callbacks_id = RegisterCallbacks(callbacks); |
| 503 scoped_refptr<WaitableCallbackResults> waitable_results = | 502 scoped_refptr<WaitableCallbackResults> waitable_results = |
| 504 MaybeCreateWaitableResults(callbacks, callbacks_id); | 503 MaybeCreateWaitableResults(callbacks, callbacks_id); |
| 505 CallDispatcherOnMainThread( | 504 CallDispatcherOnMainThread( |
| 506 main_thread_task_runner_, | 505 main_thread_task_runner_, &FileSystemDispatcher::Remove, |
| 507 &FileSystemDispatcher::Remove, | |
| 508 MakeTuple(GURL(path), false /* recursive */, | 506 MakeTuple(GURL(path), false /* recursive */, |
| 509 base::Bind(&StatusCallbackAdapter, | 507 base::Bind(&StatusCallbackAdapter, |
| 510 CurrentWorkerId(), callbacks_id, waitable_results)), | 508 base::ThreadTaskRunnerHandle::Get(), callbacks_id, |
| 509 waitable_results)), |
| 511 waitable_results.get()); | 510 waitable_results.get()); |
| 512 } | 511 } |
| 513 | 512 |
| 514 void WebFileSystemImpl::removeRecursively( | 513 void WebFileSystemImpl::removeRecursively( |
| 515 const blink::WebURL& path, | 514 const blink::WebURL& path, |
| 516 WebFileSystemCallbacks callbacks) { | 515 WebFileSystemCallbacks callbacks) { |
| 517 int callbacks_id = RegisterCallbacks(callbacks); | 516 int callbacks_id = RegisterCallbacks(callbacks); |
| 518 scoped_refptr<WaitableCallbackResults> waitable_results = | 517 scoped_refptr<WaitableCallbackResults> waitable_results = |
| 519 MaybeCreateWaitableResults(callbacks, callbacks_id); | 518 MaybeCreateWaitableResults(callbacks, callbacks_id); |
| 520 CallDispatcherOnMainThread( | 519 CallDispatcherOnMainThread( |
| 521 main_thread_task_runner_, | 520 main_thread_task_runner_, &FileSystemDispatcher::Remove, |
| 522 &FileSystemDispatcher::Remove, | |
| 523 MakeTuple(GURL(path), true /* recursive */, | 521 MakeTuple(GURL(path), true /* recursive */, |
| 524 base::Bind(&StatusCallbackAdapter, | 522 base::Bind(&StatusCallbackAdapter, |
| 525 CurrentWorkerId(), callbacks_id, waitable_results)), | 523 base::ThreadTaskRunnerHandle::Get(), callbacks_id, |
| 524 waitable_results)), |
| 526 waitable_results.get()); | 525 waitable_results.get()); |
| 527 } | 526 } |
| 528 | 527 |
| 529 void WebFileSystemImpl::readMetadata( | 528 void WebFileSystemImpl::readMetadata( |
| 530 const blink::WebURL& path, | 529 const blink::WebURL& path, |
| 531 WebFileSystemCallbacks callbacks) { | 530 WebFileSystemCallbacks callbacks) { |
| 532 int callbacks_id = RegisterCallbacks(callbacks); | 531 int callbacks_id = RegisterCallbacks(callbacks); |
| 533 scoped_refptr<WaitableCallbackResults> waitable_results = | 532 scoped_refptr<WaitableCallbackResults> waitable_results = |
| 534 MaybeCreateWaitableResults(callbacks, callbacks_id); | 533 MaybeCreateWaitableResults(callbacks, callbacks_id); |
| 535 CallDispatcherOnMainThread( | 534 CallDispatcherOnMainThread( |
| 536 main_thread_task_runner_, | 535 main_thread_task_runner_, &FileSystemDispatcher::ReadMetadata, |
| 537 &FileSystemDispatcher::ReadMetadata, | 536 MakeTuple(GURL(path), base::Bind(&ReadMetadataCallbackAdapter, |
| 538 MakeTuple(GURL(path), | 537 base::ThreadTaskRunnerHandle::Get(), |
| 539 base::Bind(&ReadMetadataCallbackAdapter, | 538 callbacks_id, waitable_results), |
| 540 CurrentWorkerId(), callbacks_id, waitable_results), | |
| 541 base::Bind(&StatusCallbackAdapter, | 539 base::Bind(&StatusCallbackAdapter, |
| 542 CurrentWorkerId(), callbacks_id, waitable_results)), | 540 base::ThreadTaskRunnerHandle::Get(), callbacks_id, |
| 541 waitable_results)), |
| 543 waitable_results.get()); | 542 waitable_results.get()); |
| 544 } | 543 } |
| 545 | 544 |
| 546 void WebFileSystemImpl::createFile( | 545 void WebFileSystemImpl::createFile( |
| 547 const blink::WebURL& path, | 546 const blink::WebURL& path, |
| 548 bool exclusive, | 547 bool exclusive, |
| 549 WebFileSystemCallbacks callbacks) { | 548 WebFileSystemCallbacks callbacks) { |
| 550 int callbacks_id = RegisterCallbacks(callbacks); | 549 int callbacks_id = RegisterCallbacks(callbacks); |
| 551 scoped_refptr<WaitableCallbackResults> waitable_results = | 550 scoped_refptr<WaitableCallbackResults> waitable_results = |
| 552 MaybeCreateWaitableResults(callbacks, callbacks_id); | 551 MaybeCreateWaitableResults(callbacks, callbacks_id); |
| 553 CallDispatcherOnMainThread( | 552 CallDispatcherOnMainThread( |
| 554 main_thread_task_runner_, | 553 main_thread_task_runner_, &FileSystemDispatcher::CreateFile, |
| 555 &FileSystemDispatcher::CreateFile, | |
| 556 MakeTuple(GURL(path), exclusive, | 554 MakeTuple(GURL(path), exclusive, |
| 557 base::Bind(&StatusCallbackAdapter, | 555 base::Bind(&StatusCallbackAdapter, |
| 558 CurrentWorkerId(), callbacks_id, waitable_results)), | 556 base::ThreadTaskRunnerHandle::Get(), callbacks_id, |
| 557 waitable_results)), |
| 559 waitable_results.get()); | 558 waitable_results.get()); |
| 560 } | 559 } |
| 561 | 560 |
| 562 void WebFileSystemImpl::createDirectory( | 561 void WebFileSystemImpl::createDirectory( |
| 563 const blink::WebURL& path, | 562 const blink::WebURL& path, |
| 564 bool exclusive, | 563 bool exclusive, |
| 565 WebFileSystemCallbacks callbacks) { | 564 WebFileSystemCallbacks callbacks) { |
| 566 int callbacks_id = RegisterCallbacks(callbacks); | 565 int callbacks_id = RegisterCallbacks(callbacks); |
| 567 scoped_refptr<WaitableCallbackResults> waitable_results = | 566 scoped_refptr<WaitableCallbackResults> waitable_results = |
| 568 MaybeCreateWaitableResults(callbacks, callbacks_id); | 567 MaybeCreateWaitableResults(callbacks, callbacks_id); |
| 569 CallDispatcherOnMainThread( | 568 CallDispatcherOnMainThread( |
| 570 main_thread_task_runner_, | 569 main_thread_task_runner_, &FileSystemDispatcher::CreateDirectory, |
| 571 &FileSystemDispatcher::CreateDirectory, | |
| 572 MakeTuple(GURL(path), exclusive, false /* recursive */, | 570 MakeTuple(GURL(path), exclusive, false /* recursive */, |
| 573 base::Bind(&StatusCallbackAdapter, | 571 base::Bind(&StatusCallbackAdapter, |
| 574 CurrentWorkerId(), callbacks_id, waitable_results)), | 572 base::ThreadTaskRunnerHandle::Get(), callbacks_id, |
| 573 waitable_results)), |
| 575 waitable_results.get()); | 574 waitable_results.get()); |
| 576 } | 575 } |
| 577 | 576 |
| 578 void WebFileSystemImpl::fileExists( | 577 void WebFileSystemImpl::fileExists( |
| 579 const blink::WebURL& path, | 578 const blink::WebURL& path, |
| 580 WebFileSystemCallbacks callbacks) { | 579 WebFileSystemCallbacks callbacks) { |
| 581 int callbacks_id = RegisterCallbacks(callbacks); | 580 int callbacks_id = RegisterCallbacks(callbacks); |
| 582 scoped_refptr<WaitableCallbackResults> waitable_results = | 581 scoped_refptr<WaitableCallbackResults> waitable_results = |
| 583 MaybeCreateWaitableResults(callbacks, callbacks_id); | 582 MaybeCreateWaitableResults(callbacks, callbacks_id); |
| 584 CallDispatcherOnMainThread( | 583 CallDispatcherOnMainThread( |
| 585 main_thread_task_runner_, | 584 main_thread_task_runner_, &FileSystemDispatcher::Exists, |
| 586 &FileSystemDispatcher::Exists, | |
| 587 MakeTuple(GURL(path), false /* directory */, | 585 MakeTuple(GURL(path), false /* directory */, |
| 588 base::Bind(&StatusCallbackAdapter, | 586 base::Bind(&StatusCallbackAdapter, |
| 589 CurrentWorkerId(), callbacks_id, waitable_results)), | 587 base::ThreadTaskRunnerHandle::Get(), callbacks_id, |
| 588 waitable_results)), |
| 590 waitable_results.get()); | 589 waitable_results.get()); |
| 591 } | 590 } |
| 592 | 591 |
| 593 void WebFileSystemImpl::directoryExists( | 592 void WebFileSystemImpl::directoryExists( |
| 594 const blink::WebURL& path, | 593 const blink::WebURL& path, |
| 595 WebFileSystemCallbacks callbacks) { | 594 WebFileSystemCallbacks callbacks) { |
| 596 int callbacks_id = RegisterCallbacks(callbacks); | 595 int callbacks_id = RegisterCallbacks(callbacks); |
| 597 scoped_refptr<WaitableCallbackResults> waitable_results = | 596 scoped_refptr<WaitableCallbackResults> waitable_results = |
| 598 MaybeCreateWaitableResults(callbacks, callbacks_id); | 597 MaybeCreateWaitableResults(callbacks, callbacks_id); |
| 599 CallDispatcherOnMainThread( | 598 CallDispatcherOnMainThread( |
| 600 main_thread_task_runner_, | 599 main_thread_task_runner_, &FileSystemDispatcher::Exists, |
| 601 &FileSystemDispatcher::Exists, | |
| 602 MakeTuple(GURL(path), true /* directory */, | 600 MakeTuple(GURL(path), true /* directory */, |
| 603 base::Bind(&StatusCallbackAdapter, | 601 base::Bind(&StatusCallbackAdapter, |
| 604 CurrentWorkerId(), callbacks_id, waitable_results)), | 602 base::ThreadTaskRunnerHandle::Get(), callbacks_id, |
| 603 waitable_results)), |
| 605 waitable_results.get()); | 604 waitable_results.get()); |
| 606 } | 605 } |
| 607 | 606 |
| 608 int WebFileSystemImpl::readDirectory( | 607 int WebFileSystemImpl::readDirectory( |
| 609 const blink::WebURL& path, | 608 const blink::WebURL& path, |
| 610 WebFileSystemCallbacks callbacks) { | 609 WebFileSystemCallbacks callbacks) { |
| 611 int callbacks_id = RegisterCallbacks(callbacks); | 610 int callbacks_id = RegisterCallbacks(callbacks); |
| 612 scoped_refptr<WaitableCallbackResults> waitable_results = | 611 scoped_refptr<WaitableCallbackResults> waitable_results = |
| 613 MaybeCreateWaitableResults(callbacks, callbacks_id); | 612 MaybeCreateWaitableResults(callbacks, callbacks_id); |
| 614 CallDispatcherOnMainThread( | 613 CallDispatcherOnMainThread( |
| 615 main_thread_task_runner_, | 614 main_thread_task_runner_, &FileSystemDispatcher::ReadDirectory, |
| 616 &FileSystemDispatcher::ReadDirectory, | 615 MakeTuple(GURL(path), base::Bind(&ReadDirectoryCallbackAdapter, |
| 617 MakeTuple(GURL(path), | 616 base::ThreadTaskRunnerHandle::Get(), |
| 618 base::Bind(&ReadDirectoryCallbackAdapter, | 617 callbacks_id, waitable_results), |
| 619 CurrentWorkerId(), callbacks_id, waitable_results), | |
| 620 base::Bind(&StatusCallbackAdapter, | 618 base::Bind(&StatusCallbackAdapter, |
| 621 CurrentWorkerId(), callbacks_id, waitable_results)), | 619 base::ThreadTaskRunnerHandle::Get(), callbacks_id, |
| 620 waitable_results)), |
| 622 waitable_results.get()); | 621 waitable_results.get()); |
| 623 return callbacks_id; | 622 return callbacks_id; |
| 624 } | 623 } |
| 625 | 624 |
| 626 void WebFileSystemImpl::createFileWriter( | 625 void WebFileSystemImpl::createFileWriter( |
| 627 const WebURL& path, | 626 const WebURL& path, |
| 628 blink::WebFileWriterClient* client, | 627 blink::WebFileWriterClient* client, |
| 629 WebFileSystemCallbacks callbacks) { | 628 WebFileSystemCallbacks callbacks) { |
| 630 int callbacks_id = RegisterCallbacks(callbacks); | 629 int callbacks_id = RegisterCallbacks(callbacks); |
| 631 scoped_refptr<WaitableCallbackResults> waitable_results = | 630 scoped_refptr<WaitableCallbackResults> waitable_results = |
| 632 MaybeCreateWaitableResults(callbacks, callbacks_id); | 631 MaybeCreateWaitableResults(callbacks, callbacks_id); |
| 633 CallDispatcherOnMainThread( | 632 CallDispatcherOnMainThread( |
| 634 main_thread_task_runner_, | 633 main_thread_task_runner_, &FileSystemDispatcher::ReadMetadata, |
| 635 &FileSystemDispatcher::ReadMetadata, | |
| 636 MakeTuple(GURL(path), | 634 MakeTuple(GURL(path), |
| 637 base::Bind(&CreateFileWriterCallbackAdapter, | 635 base::Bind(&CreateFileWriterCallbackAdapter, |
| 638 CurrentWorkerId(), callbacks_id, waitable_results, | 636 base::ThreadTaskRunnerHandle::Get(), callbacks_id, |
| 639 main_thread_task_runner_, GURL(path), client), | 637 waitable_results, main_thread_task_runner_, |
| 638 GURL(path), client), |
| 640 base::Bind(&StatusCallbackAdapter, | 639 base::Bind(&StatusCallbackAdapter, |
| 641 CurrentWorkerId(), callbacks_id, waitable_results)), | 640 base::ThreadTaskRunnerHandle::Get(), callbacks_id, |
| 641 waitable_results)), |
| 642 waitable_results.get()); | 642 waitable_results.get()); |
| 643 } | 643 } |
| 644 | 644 |
| 645 void WebFileSystemImpl::createSnapshotFileAndReadMetadata( | 645 void WebFileSystemImpl::createSnapshotFileAndReadMetadata( |
| 646 const blink::WebURL& path, | 646 const blink::WebURL& path, |
| 647 WebFileSystemCallbacks callbacks) { | 647 WebFileSystemCallbacks callbacks) { |
| 648 int callbacks_id = RegisterCallbacks(callbacks); | 648 int callbacks_id = RegisterCallbacks(callbacks); |
| 649 scoped_refptr<WaitableCallbackResults> waitable_results = | 649 scoped_refptr<WaitableCallbackResults> waitable_results = |
| 650 MaybeCreateWaitableResults(callbacks, callbacks_id); | 650 MaybeCreateWaitableResults(callbacks, callbacks_id); |
| 651 CallDispatcherOnMainThread( | 651 CallDispatcherOnMainThread( |
| 652 main_thread_task_runner_, | 652 main_thread_task_runner_, &FileSystemDispatcher::CreateSnapshotFile, |
| 653 &FileSystemDispatcher::CreateSnapshotFile, | |
| 654 MakeTuple(GURL(path), | 653 MakeTuple(GURL(path), |
| 655 base::Bind(&CreateSnapshotFileCallbackAdapter, | 654 base::Bind(&CreateSnapshotFileCallbackAdapter, |
| 656 CurrentWorkerId(), callbacks_id, waitable_results, | 655 base::ThreadTaskRunnerHandle::Get(), callbacks_id, |
| 657 main_thread_task_runner_), | 656 waitable_results, main_thread_task_runner_), |
| 658 base::Bind(&StatusCallbackAdapter, | 657 base::Bind(&StatusCallbackAdapter, |
| 659 CurrentWorkerId(), callbacks_id, waitable_results)), | 658 base::ThreadTaskRunnerHandle::Get(), callbacks_id, |
| 659 waitable_results)), |
| 660 waitable_results.get()); | 660 waitable_results.get()); |
| 661 } | 661 } |
| 662 | 662 |
| 663 bool WebFileSystemImpl::waitForAdditionalResult(int callbacksId) { | 663 bool WebFileSystemImpl::waitForAdditionalResult(int callbacksId) { |
| 664 WaitableCallbackResultsMap::iterator found = | 664 WaitableCallbackResultsMap::iterator found = |
| 665 waitable_results_.find(callbacksId); | 665 waitable_results_.find(callbacksId); |
| 666 if (found == waitable_results_.end()) | 666 if (found == waitable_results_.end()) |
| 667 return false; | 667 return false; |
| 668 | 668 |
| 669 found->second->WaitAndRun(); | 669 found->second->WaitAndRun(); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 697 WaitableCallbackResults* WebFileSystemImpl::MaybeCreateWaitableResults( | 697 WaitableCallbackResults* WebFileSystemImpl::MaybeCreateWaitableResults( |
| 698 const WebFileSystemCallbacks& callbacks, int callbacks_id) { | 698 const WebFileSystemCallbacks& callbacks, int callbacks_id) { |
| 699 if (!callbacks.shouldBlockUntilCompletion()) | 699 if (!callbacks.shouldBlockUntilCompletion()) |
| 700 return NULL; | 700 return NULL; |
| 701 WaitableCallbackResults* results = new WaitableCallbackResults(); | 701 WaitableCallbackResults* results = new WaitableCallbackResults(); |
| 702 waitable_results_[callbacks_id] = results; | 702 waitable_results_[callbacks_id] = results; |
| 703 return results; | 703 return results; |
| 704 } | 704 } |
| 705 | 705 |
| 706 } // namespace content | 706 } // namespace content |
| OLD | NEW |