Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1158)

Unified Diff: content/browser/renderer_host/pepper_file_message_filter.h

Issue 10387195: Open pepper files directly in browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698