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 | |
371 void FileSystemDispatcher::CreateSnapshotFile( | 354 void FileSystemDispatcher::CreateSnapshotFile( |
372 const GURL& file_path, | 355 const GURL& file_path, |
373 const CreateSnapshotFileCallback& success_callback, | 356 const CreateSnapshotFileCallback& success_callback, |
374 const StatusCallback& error_callback) { | 357 const StatusCallback& error_callback) { |
375 int request_id = dispatchers_.Add( | 358 int request_id = dispatchers_.Add( |
376 CallbackDispatcher::Create(success_callback, error_callback)); | 359 CallbackDispatcher::Create(success_callback, error_callback)); |
377 ChildThread::current()->Send( | 360 ChildThread::current()->Send( |
378 new FileSystemHostMsg_CreateSnapshotFile( | 361 new FileSystemHostMsg_CreateSnapshotFile( |
379 request_id, file_path)); | 362 request_id, file_path)); |
380 } | 363 } |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 quota::QuotaLimitType quota_policy) { | 441 quota::QuotaLimitType quota_policy) { |
459 CallbackDispatcher* dispatcher = dispatchers_.Lookup(request_id); | 442 CallbackDispatcher* dispatcher = dispatchers_.Lookup(request_id); |
460 DCHECK(dispatcher); | 443 DCHECK(dispatcher); |
461 dispatcher->DidOpenFile(IPC::PlatformFileForTransitToPlatformFile(file), | 444 dispatcher->DidOpenFile(IPC::PlatformFileForTransitToPlatformFile(file), |
462 file_open_id, | 445 file_open_id, |
463 quota_policy); | 446 quota_policy); |
464 dispatchers_.Remove(request_id); | 447 dispatchers_.Remove(request_id); |
465 } | 448 } |
466 | 449 |
467 } // namespace content | 450 } // namespace content |
OLD | NEW |