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) { | 354 void FileSystemDispatcher::NotifyCloseFile(int file_open_id) { |
367 ChildThread::current()->Send( | 355 ChildThread::current()->Send( |
368 new FileSystemHostMsg_NotifyCloseFile(file_open_id)); | 356 new FileSystemHostMsg_NotifyCloseFile(file_open_id)); |
369 } | 357 } |
370 | 358 |
371 void FileSystemDispatcher::CreateSnapshotFile( | 359 void FileSystemDispatcher::CreateSnapshotFile( |
372 const GURL& file_path, | 360 const GURL& file_path, |
373 const CreateSnapshotFileCallback& success_callback, | 361 const CreateSnapshotFileCallback& success_callback, |
374 const StatusCallback& error_callback) { | 362 const StatusCallback& error_callback) { |
375 int request_id = dispatchers_.Add( | 363 int request_id = dispatchers_.Add( |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 quota::QuotaLimitType quota_policy) { | 446 quota::QuotaLimitType quota_policy) { |
459 CallbackDispatcher* dispatcher = dispatchers_.Lookup(request_id); | 447 CallbackDispatcher* dispatcher = dispatchers_.Lookup(request_id); |
460 DCHECK(dispatcher); | 448 DCHECK(dispatcher); |
461 dispatcher->DidOpenFile(IPC::PlatformFileForTransitToPlatformFile(file), | 449 dispatcher->DidOpenFile(IPC::PlatformFileForTransitToPlatformFile(file), |
462 file_open_id, | 450 file_open_id, |
463 quota_policy); | 451 quota_policy); |
464 dispatchers_.Remove(request_id); | 452 dispatchers_.Remove(request_id); |
465 } | 453 } |
466 | 454 |
467 } // namespace content | 455 } // namespace content |
OLD | NEW |