OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/file_system_dispatcher.h" | 5 #include "content/child/fileapi/file_system_dispatcher.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
10 #include "base/process/process.h" | 10 #include "base/process/process.h" |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 const GURL& path, | 344 const GURL& path, |
345 const base::Time& last_access_time, | 345 const base::Time& last_access_time, |
346 const base::Time& last_modified_time, | 346 const base::Time& last_modified_time, |
347 const StatusCallback& callback) { | 347 const StatusCallback& callback) { |
348 int request_id = dispatchers_.Add(CallbackDispatcher::Create(callback)); | 348 int request_id = dispatchers_.Add(CallbackDispatcher::Create(callback)); |
349 ChildThread::current()->Send( | 349 ChildThread::current()->Send( |
350 new FileSystemHostMsg_TouchFile( | 350 new FileSystemHostMsg_TouchFile( |
351 request_id, path, last_access_time, last_modified_time)); | 351 request_id, path, last_access_time, last_modified_time)); |
352 } | 352 } |
353 | 353 |
| 354 void FileSystemDispatcher::OpenPepperFile( |
| 355 const GURL& file_path, |
| 356 int pp_open_flags, |
| 357 const OpenFileCallback& success_callback, |
| 358 const StatusCallback& error_callback) { |
| 359 int request_id = dispatchers_.Add( |
| 360 CallbackDispatcher::Create(success_callback, error_callback)); |
| 361 ChildThread::current()->Send( |
| 362 new FileSystemHostMsg_OpenPepperFile( |
| 363 request_id, file_path, pp_open_flags)); |
| 364 } |
| 365 |
| 366 void FileSystemDispatcher::NotifyCloseFile(int file_open_id) { |
| 367 ChildThread::current()->Send( |
| 368 new FileSystemHostMsg_NotifyCloseFile(file_open_id)); |
| 369 } |
| 370 |
354 void FileSystemDispatcher::CreateSnapshotFile( | 371 void FileSystemDispatcher::CreateSnapshotFile( |
355 const GURL& file_path, | 372 const GURL& file_path, |
356 const CreateSnapshotFileCallback& success_callback, | 373 const CreateSnapshotFileCallback& success_callback, |
357 const StatusCallback& error_callback) { | 374 const StatusCallback& error_callback) { |
358 int request_id = dispatchers_.Add( | 375 int request_id = dispatchers_.Add( |
359 CallbackDispatcher::Create(success_callback, error_callback)); | 376 CallbackDispatcher::Create(success_callback, error_callback)); |
360 ChildThread::current()->Send( | 377 ChildThread::current()->Send( |
361 new FileSystemHostMsg_CreateSnapshotFile( | 378 new FileSystemHostMsg_CreateSnapshotFile( |
362 request_id, file_path)); | 379 request_id, file_path)); |
363 } | 380 } |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 quota::QuotaLimitType quota_policy) { | 458 quota::QuotaLimitType quota_policy) { |
442 CallbackDispatcher* dispatcher = dispatchers_.Lookup(request_id); | 459 CallbackDispatcher* dispatcher = dispatchers_.Lookup(request_id); |
443 DCHECK(dispatcher); | 460 DCHECK(dispatcher); |
444 dispatcher->DidOpenFile(IPC::PlatformFileForTransitToPlatformFile(file), | 461 dispatcher->DidOpenFile(IPC::PlatformFileForTransitToPlatformFile(file), |
445 file_open_id, | 462 file_open_id, |
446 quota_policy); | 463 quota_policy); |
447 dispatchers_.Remove(request_id); | 464 dispatchers_.Remove(request_id); |
448 } | 465 } |
449 | 466 |
450 } // namespace content | 467 } // namespace content |
OLD | NEW |