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/common/fileapi/file_system_dispatcher.h" | 5 #include "content/common/fileapi/file_system_dispatcher.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/process.h" | 8 #include "base/process.h" |
9 #include "content/common/child_thread.h" | 9 #include "content/common/child_thread.h" |
10 #include "content/common/fileapi/file_system_messages.h" | 10 #include "content/common/fileapi/file_system_messages.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 } | 26 } |
27 } | 27 } |
28 | 28 |
29 bool FileSystemDispatcher::OnMessageReceived(const IPC::Message& msg) { | 29 bool FileSystemDispatcher::OnMessageReceived(const IPC::Message& msg) { |
30 bool handled = true; | 30 bool handled = true; |
31 IPC_BEGIN_MESSAGE_MAP(FileSystemDispatcher, msg) | 31 IPC_BEGIN_MESSAGE_MAP(FileSystemDispatcher, msg) |
32 IPC_MESSAGE_HANDLER(FileSystemMsg_DidOpenFileSystem, OnDidOpenFileSystem) | 32 IPC_MESSAGE_HANDLER(FileSystemMsg_DidOpenFileSystem, OnDidOpenFileSystem) |
33 IPC_MESSAGE_HANDLER(FileSystemMsg_DidSucceed, OnDidSucceed) | 33 IPC_MESSAGE_HANDLER(FileSystemMsg_DidSucceed, OnDidSucceed) |
34 IPC_MESSAGE_HANDLER(FileSystemMsg_DidReadDirectory, OnDidReadDirectory) | 34 IPC_MESSAGE_HANDLER(FileSystemMsg_DidReadDirectory, OnDidReadDirectory) |
35 IPC_MESSAGE_HANDLER(FileSystemMsg_DidReadMetadata, OnDidReadMetadata) | 35 IPC_MESSAGE_HANDLER(FileSystemMsg_DidReadMetadata, OnDidReadMetadata) |
| 36 IPC_MESSAGE_HANDLER(FileSystemMsg_DidCreateSnapshotFile, |
| 37 OnDidCreateSnapshotFile) |
36 IPC_MESSAGE_HANDLER(FileSystemMsg_DidFail, OnDidFail) | 38 IPC_MESSAGE_HANDLER(FileSystemMsg_DidFail, OnDidFail) |
37 IPC_MESSAGE_HANDLER(FileSystemMsg_DidWrite, OnDidWrite) | 39 IPC_MESSAGE_HANDLER(FileSystemMsg_DidWrite, OnDidWrite) |
38 IPC_MESSAGE_HANDLER(FileSystemMsg_DidOpenFile, OnDidOpenFile) | 40 IPC_MESSAGE_HANDLER(FileSystemMsg_DidOpenFile, OnDidOpenFile) |
39 IPC_MESSAGE_UNHANDLED(handled = false) | 41 IPC_MESSAGE_UNHANDLED(handled = false) |
40 IPC_END_MESSAGE_MAP() | 42 IPC_END_MESSAGE_MAP() |
41 return handled; | 43 return handled; |
42 } | 44 } |
43 | 45 |
44 bool FileSystemDispatcher::OpenFileSystem( | 46 bool FileSystemDispatcher::OpenFileSystem( |
45 const GURL& origin_url, fileapi::FileSystemType type, | 47 const GURL& origin_url, fileapi::FileSystemType type, |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 void FileSystemDispatcher::OnDidOpenFile( | 353 void FileSystemDispatcher::OnDidOpenFile( |
352 int request_id, IPC::PlatformFileForTransit file) { | 354 int request_id, IPC::PlatformFileForTransit file) { |
353 fileapi::FileSystemCallbackDispatcher* dispatcher = | 355 fileapi::FileSystemCallbackDispatcher* dispatcher = |
354 dispatchers_.Lookup(request_id); | 356 dispatchers_.Lookup(request_id); |
355 DCHECK(dispatcher); | 357 DCHECK(dispatcher); |
356 dispatcher->DidOpenFile(IPC::PlatformFileForTransitToPlatformFile(file)); | 358 dispatcher->DidOpenFile(IPC::PlatformFileForTransitToPlatformFile(file)); |
357 dispatchers_.Remove(request_id); | 359 dispatchers_.Remove(request_id); |
358 } | 360 } |
359 | 361 |
360 } // namespace content | 362 } // namespace content |
OLD | NEW |