Index: content/browser/renderer_host/pepper_file_message_filter.h |
=================================================================== |
--- content/browser/renderer_host/pepper_file_message_filter.h (revision 138610) |
+++ content/browser/renderer_host/pepper_file_message_filter.h (working copy) |
@@ -31,8 +31,7 @@ |
// A message filter for Pepper-specific File I/O messages. |
class PepperFileMessageFilter : public content::BrowserMessageFilter { |
public: |
- PepperFileMessageFilter(int child_id, |
- content::BrowserContext* browser_context); |
+ explicit PepperFileMessageFilter(int child_id); |
// content::BrowserMessageFilter methods: |
virtual void OverrideThreadForMessage( |
@@ -78,7 +77,7 @@ |
// Validate and convert the Pepper file path to a "real" |FilePath|. Returns |
// an empty |FilePath| on error. |
- FilePath ValidateAndConvertPepperFilePath( |
+ virtual FilePath ValidateAndConvertPepperFilePath( |
const webkit::ppapi::PepperFilePath& pepper_path, int flags); |
// The ID of the child process. |
@@ -88,10 +87,27 @@ |
// owned by this class. |
IPC::Channel* channel_; |
- // The base path for the pepper data. |
- FilePath pepper_path_; |
- |
DISALLOW_COPY_AND_ASSIGN(PepperFileMessageFilter); |
}; |
+// Class for out-of-process plugins providing relaxed path validation. |
+class PepperTrustedFileMessageFilter : public PepperFileMessageFilter { |
+ public: |
+ PepperTrustedFileMessageFilter(int child_id, |
+ const std::string& plugin_name, |
+ const FilePath& profile_data_directory); |
+ |
+ protected: |
+ virtual ~PepperTrustedFileMessageFilter(); |
+ |
+ private: |
+ virtual FilePath ValidateAndConvertPepperFilePath( |
+ const webkit::ppapi::PepperFilePath& pepper_path, int flags) OVERRIDE; |
+ |
+ // The path to the per-plugin directory under the per-profile data directory. |
+ FilePath plugin_data_directory_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(PepperTrustedFileMessageFilter); |
+}; |
+ |
#endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_FILE_MESSAGE_FILTER_H_ |