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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 const GURL& path, | 317 const GURL& path, |
318 const base::Time& last_access_time, | 318 const base::Time& last_access_time, |
319 const base::Time& last_modified_time, | 319 const base::Time& last_modified_time, |
320 const StatusCallback& callback) { | 320 const StatusCallback& callback) { |
321 int request_id = dispatchers_.Add(CallbackDispatcher::Create(callback)); | 321 int request_id = dispatchers_.Add(CallbackDispatcher::Create(callback)); |
322 ChildThread::current()->Send( | 322 ChildThread::current()->Send( |
323 new FileSystemHostMsg_TouchFile( | 323 new FileSystemHostMsg_TouchFile( |
324 request_id, path, last_access_time, last_modified_time)); | 324 request_id, path, last_access_time, last_modified_time)); |
325 } | 325 } |
326 | 326 |
327 void FileSystemDispatcher::OpenFile( | 327 void FileSystemDispatcher::OpenPepperFile( |
328 const GURL& file_path, | 328 const GURL& file_path, |
329 int file_flags, | 329 int pp_open_flags, |
330 const OpenFileCallback& success_callback, | 330 const OpenFileCallback& success_callback, |
331 const StatusCallback& error_callback) { | 331 const StatusCallback& error_callback) { |
332 int request_id = dispatchers_.Add( | 332 int request_id = dispatchers_.Add( |
333 CallbackDispatcher::Create(success_callback, error_callback)); | 333 CallbackDispatcher::Create(success_callback, error_callback)); |
334 ChildThread::current()->Send( | 334 ChildThread::current()->Send( |
335 new FileSystemHostMsg_OpenFile( | 335 new FileSystemHostMsg_OpenPepperFile( |
336 request_id, file_path, file_flags)); | 336 request_id, file_path, pp_open_flags)); |
337 } | 337 } |
338 | 338 |
339 void FileSystemDispatcher::NotifyCloseFile(int file_open_id) { | 339 void FileSystemDispatcher::NotifyCloseFile(int file_open_id) { |
340 ChildThread::current()->Send( | 340 ChildThread::current()->Send( |
341 new FileSystemHostMsg_NotifyCloseFile(file_open_id)); | 341 new FileSystemHostMsg_NotifyCloseFile(file_open_id)); |
342 } | 342 } |
343 | 343 |
344 void FileSystemDispatcher::CreateSnapshotFile( | 344 void FileSystemDispatcher::CreateSnapshotFile( |
345 const GURL& file_path, | 345 const GURL& file_path, |
346 const CreateSnapshotFileCallback& success_callback, | 346 const CreateSnapshotFileCallback& success_callback, |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 quota::QuotaLimitType quota_policy) { | 420 quota::QuotaLimitType quota_policy) { |
421 CallbackDispatcher* dispatcher = dispatchers_.Lookup(request_id); | 421 CallbackDispatcher* dispatcher = dispatchers_.Lookup(request_id); |
422 DCHECK(dispatcher); | 422 DCHECK(dispatcher); |
423 dispatcher->DidOpenFile(IPC::PlatformFileForTransitToPlatformFile(file), | 423 dispatcher->DidOpenFile(IPC::PlatformFileForTransitToPlatformFile(file), |
424 file_open_id, | 424 file_open_id, |
425 quota_policy); | 425 quota_policy); |
426 dispatchers_.Remove(request_id); | 426 dispatchers_.Remove(request_id); |
427 } | 427 } |
428 | 428 |
429 } // namespace content | 429 } // namespace content |
OLD | NEW |