Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_FLASH_FILE_HOST_H_ | |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_FLASH_FILE_HOST_H_ | |
| 7 | |
| 8 #include "base/compiler_specific.h" | |
| 9 #include "base/file_path.h" | |
| 10 #include "base/memory/ref_counted.h" | |
| 11 #include "base/process.h" | |
| 12 #include "ppapi/host/resource_host.h" | |
| 13 #include "ppapi/host/resource_message_filter.h" | |
| 14 | |
| 15 namespace ppapi { | |
| 16 class PepperFilePath; | |
| 17 } | |
| 18 | |
| 19 namespace ppapi { | |
| 20 namespace host { | |
| 21 struct ReplyMessageContext; | |
| 22 } | |
| 23 } | |
| 24 | |
| 25 namespace content { | |
| 26 | |
| 27 class BrowserPpapiHost; | |
| 28 | |
| 29 class PepperFlashFileHost : public ppapi::host::ResourceHost { | |
| 30 public: | |
| 31 PepperFlashFileHost(BrowserPpapiHost* host, | |
| 32 PP_Instance instance, | |
| 33 PP_Resource resource); | |
| 34 virtual ~PepperFlashFileHost(); | |
| 35 | |
| 36 static FilePath GetDataDirName(const FilePath& profile_path); | |
| 37 | |
| 38 private: | |
| 39 DISALLOW_COPY_AND_ASSIGN(PepperFlashFileHost); | |
| 40 }; | |
| 41 | |
| 42 // All file messages are handled on the file thread by this message filter. | |
|
yzshen1
2012/11/21 00:38:59
These messages are not handled on the FILE thread.
raymes
2012/11/21 22:44:53
Done.
| |
| 43 class FileThreadMessageFilter : public ppapi::host::ResourceMessageFilter { | |
|
yzshen1
2012/11/21 00:38:59
- Please move this to the .cc file.
- nit, optiona
raymes
2012/11/21 22:44:53
Done.
| |
| 44 public: | |
| 45 FileThreadMessageFilter(const std::string& plugin_name, | |
| 46 const FilePath& profile_data_directory, | |
| 47 int plugin_process_id, | |
| 48 base::ProcessHandle plugin_process_handle); | |
| 49 protected: | |
| 50 // ppapi::host::ResourceMessageFilter implementation. | |
| 51 virtual scoped_refptr<base::TaskRunner> OverrideTaskRunnerForMessage( | |
| 52 const IPC::Message& msg) OVERRIDE; | |
| 53 virtual int32_t OnResourceMessageReceived( | |
| 54 const IPC::Message& msg, | |
| 55 ppapi::host::HostMessageContext* context) OVERRIDE; | |
| 56 | |
| 57 private: | |
| 58 virtual ~FileThreadMessageFilter(); | |
| 59 | |
| 60 int32_t OnOpenFile(ppapi::host::HostMessageContext* context, | |
| 61 const ppapi::PepperFilePath& path, | |
| 62 int flags); | |
| 63 int32_t OnRenameFile(ppapi::host::HostMessageContext* context, | |
| 64 const ppapi::PepperFilePath& from_path, | |
| 65 const ppapi::PepperFilePath& to_path); | |
| 66 int32_t OnDeleteFileOrDir(ppapi::host::HostMessageContext* context, | |
| 67 const ppapi::PepperFilePath& path, | |
| 68 bool recursive); | |
| 69 int32_t OnCreateDir(ppapi::host::HostMessageContext* context, | |
| 70 const ppapi::PepperFilePath& path); | |
| 71 int32_t OnQueryFile(ppapi::host::HostMessageContext* context, | |
| 72 const ppapi::PepperFilePath& path); | |
| 73 int32_t OnGetDirContents(ppapi::host::HostMessageContext* context, | |
| 74 const ppapi::PepperFilePath& path); | |
| 75 int32_t OnCreateTemporaryFile(ppapi::host::HostMessageContext* context); | |
| 76 | |
| 77 FilePath ValidateAndConvertPepperFilePath( | |
| 78 const ppapi::PepperFilePath& pepper_path, | |
| 79 int flags); | |
| 80 | |
| 81 FilePath plugin_data_directory_; | |
| 82 int plugin_process_id_; | |
| 83 base::ProcessHandle plugin_process_handle_; | |
| 84 }; | |
| 85 | |
| 86 } // namespace content | |
| 87 | |
| 88 #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_FLASH_FILE_HOST_H_ | |
| OLD | NEW |