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 #ifndef CONTENT_COMMON_FILEAPI_FILE_SYSTEM_DISPATCHER_H_ | 5 #ifndef CONTENT_COMMON_FILEAPI_FILE_SYSTEM_DISPATCHER_H_ |
6 #define CONTENT_COMMON_FILEAPI_FILE_SYSTEM_DISPATCHER_H_ | 6 #define CONTENT_COMMON_FILEAPI_FILE_SYSTEM_DISPATCHER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/file_util_proxy.h" | 12 #include "base/file_util_proxy.h" |
13 #include "base/id_map.h" | 13 #include "base/id_map.h" |
14 #include "base/process.h" | 14 #include "base/process.h" |
15 #include "ipc/ipc_channel.h" | 15 #include "ipc/ipc_listener.h" |
16 #include "ipc/ipc_message.h" | |
17 #include "ipc/ipc_platform_file.h" | 16 #include "ipc/ipc_platform_file.h" |
18 #include "webkit/fileapi/file_system_callback_dispatcher.h" | 17 #include "webkit/fileapi/file_system_callback_dispatcher.h" |
19 #include "webkit/fileapi/file_system_types.h" | 18 #include "webkit/fileapi/file_system_types.h" |
20 | 19 |
21 namespace base { | 20 namespace base { |
22 struct PlatformFileInfo; | 21 struct PlatformFileInfo; |
23 } | 22 } |
24 | 23 |
25 class FilePath; | 24 class FilePath; |
26 class GURL; | 25 class GURL; |
27 | 26 |
28 // Dispatches and sends file system related messages sent to/from a child | 27 // Dispatches and sends file system related messages sent to/from a child |
29 // process from/to the main browser process. There is one instance | 28 // process from/to the main browser process. There is one instance |
30 // per child process. Messages are dispatched on the main child thread. | 29 // per child process. Messages are dispatched on the main child thread. |
31 class FileSystemDispatcher : public IPC::Channel::Listener { | 30 class FileSystemDispatcher : public IPC::Listener { |
32 public: | 31 public: |
33 FileSystemDispatcher(); | 32 FileSystemDispatcher(); |
34 virtual ~FileSystemDispatcher(); | 33 virtual ~FileSystemDispatcher(); |
35 | 34 |
36 // IPC::Channel::Listener implementation. | 35 // IPC::Listener implementation. |
37 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 36 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
38 | 37 |
39 bool OpenFileSystem(const GURL& origin_url, | 38 bool OpenFileSystem(const GURL& origin_url, |
40 fileapi::FileSystemType type, | 39 fileapi::FileSystemType type, |
41 long long size, | 40 long long size, |
42 bool create, | 41 bool create, |
43 fileapi::FileSystemCallbackDispatcher* dispatcher); | 42 fileapi::FileSystemCallbackDispatcher* dispatcher); |
44 bool Move(const GURL& src_path, | 43 bool Move(const GURL& src_path, |
45 const GURL& dest_path, | 44 const GURL& dest_path, |
46 fileapi::FileSystemCallbackDispatcher* dispatcher); | 45 fileapi::FileSystemCallbackDispatcher* dispatcher); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 void OnDidOpenFile( | 104 void OnDidOpenFile( |
106 int request_id, | 105 int request_id, |
107 IPC::PlatformFileForTransit file); | 106 IPC::PlatformFileForTransit file); |
108 | 107 |
109 IDMap<fileapi::FileSystemCallbackDispatcher, IDMapOwnPointer> dispatchers_; | 108 IDMap<fileapi::FileSystemCallbackDispatcher, IDMapOwnPointer> dispatchers_; |
110 | 109 |
111 DISALLOW_COPY_AND_ASSIGN(FileSystemDispatcher); | 110 DISALLOW_COPY_AND_ASSIGN(FileSystemDispatcher); |
112 }; | 111 }; |
113 | 112 |
114 #endif // CONTENT_COMMON_FILEAPI_FILE_SYSTEM_DISPATCHER_H_ | 113 #endif // CONTENT_COMMON_FILEAPI_FILE_SYSTEM_DISPATCHER_H_ |
OLD | NEW |