| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_BROWSER_FILE_SYSTEM_FILE_SYSTEM_DISPATCHER_HOST_H_ | 5 #ifndef CHROME_BROWSER_FILE_SYSTEM_FILE_SYSTEM_DISPATCHER_HOST_H_ |
| 6 #define CHROME_BROWSER_FILE_SYSTEM_FILE_SYSTEM_DISPATCHER_HOST_H_ | 6 #define CHROME_BROWSER_FILE_SYSTEM_FILE_SYSTEM_DISPATCHER_HOST_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/nullable_string16.h" | 9 #include "base/nullable_string16.h" |
| 10 #include "base/process.h" | 10 #include "base/process.h" |
| 11 #include "base/ref_counted.h" | 11 #include "base/ref_counted.h" |
| 12 #include "chrome/common/render_messages.h" | 12 #include "chrome/common/render_messages.h" |
| 13 | 13 |
| 14 class FileSystemHostContext; | |
| 15 class HostContentSettingsMap; | 14 class HostContentSettingsMap; |
| 16 class Receiver; | 15 class Receiver; |
| 17 class ResourceMessageFilter; | 16 class ResourceMessageFilter; |
| 18 | 17 |
| 19 class FileSystemDispatcherHost | 18 class FileSystemDispatcherHost |
| 20 : public base::RefCountedThreadSafe<FileSystemDispatcherHost> { | 19 : public base::RefCountedThreadSafe<FileSystemDispatcherHost> { |
| 21 public: | 20 public: |
| 22 FileSystemDispatcherHost(IPC::Message::Sender* sender, | 21 FileSystemDispatcherHost(IPC::Message::Sender* sender, |
| 23 FileSystemHostContext* file_system_host_context, | |
| 24 HostContentSettingsMap* host_content_settings_map); | 22 HostContentSettingsMap* host_content_settings_map); |
| 25 void Init(base::ProcessHandle process_handle); | 23 void Init(base::ProcessHandle process_handle); |
| 26 void Shutdown(); | 24 void Shutdown(); |
| 27 | 25 |
| 28 bool OnMessageReceived(const IPC::Message& message, bool* message_was_ok); | 26 bool OnMessageReceived(const IPC::Message& message, bool* message_was_ok); |
| 29 | 27 |
| 30 void OnOpenFileSystem(const ViewHostMsg_OpenFileSystemRequest_Params&); | 28 void OnOpenFileSystem(const ViewHostMsg_OpenFileSystemRequest_Params&); |
| 31 void OnMove( | 29 void OnMove( |
| 32 int request_id, | 30 int request_id, |
| 33 const string16& src_path, | 31 const string16& src_path, |
| 34 const string16& dest_path); | 32 const string16& dest_path); |
| 35 | 33 |
| 36 // TODO(kinuko): add more methods. | 34 // TODO(kinuko): add more methods. |
| 37 | 35 |
| 38 void Send(IPC::Message* message); | 36 void Send(IPC::Message* message); |
| 39 | 37 |
| 40 private: | 38 private: |
| 41 void Move(const string16& src, const string16& dest, int operation_id); | 39 void Move(const string16& src, const string16& dest, int operation_id); |
| 42 | 40 |
| 43 // The sender to be used for sending out IPC messages. | 41 // The sender to be used for sending out IPC messages. |
| 44 IPC::Message::Sender* message_sender_; | 42 IPC::Message::Sender* message_sender_; |
| 45 | 43 |
| 46 // The handle of this process. | 44 // The handle of this process. |
| 47 base::ProcessHandle process_handle_; | 45 base::ProcessHandle process_handle_; |
| 48 | 46 |
| 49 bool shutdown_; | 47 bool shutdown_; |
| 50 | 48 |
| 51 scoped_refptr<FileSystemHostContext> context_; | |
| 52 | |
| 53 // Used to look up permissions. | 49 // Used to look up permissions. |
| 54 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; | 50 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; |
| 55 }; | 51 }; |
| 56 | 52 |
| 57 #endif // CHROME_BROWSER_FILE_SYSTEM_FILE_SYSTEM_DISPATCHER_HOST_H_ | 53 #endif // CHROME_BROWSER_FILE_SYSTEM_FILE_SYSTEM_DISPATCHER_HOST_H_ |
| OLD | NEW |