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

Unified Diff: content/browser/renderer_host/pepper/pepper_flash_file_host.h

Issue 11359097: Refactored the PPB_Flash_File_ModuleLocal/FileRef to the new ppapi resource model (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 1 month 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/pepper_flash_file_host.h
diff --git a/content/browser/renderer_host/pepper/pepper_flash_file_host.h b/content/browser/renderer_host/pepper/pepper_flash_file_host.h
new file mode 100644
index 0000000000000000000000000000000000000000..9288b514b3062d1b47f6d4eaf40c6d27f5e824d1
--- /dev/null
+++ b/content/browser/renderer_host/pepper/pepper_flash_file_host.h
@@ -0,0 +1,88 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_FLASH_FILE_HOST_H_
+#define CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_FLASH_FILE_HOST_H_
+
+#include "base/compiler_specific.h"
+#include "base/file_path.h"
+#include "base/memory/ref_counted.h"
+#include "base/process.h"
+#include "ppapi/host/resource_host.h"
+#include "ppapi/host/resource_message_filter.h"
+
+namespace ppapi {
+class PepperFilePath;
+}
+
+namespace ppapi {
+namespace host {
+struct ReplyMessageContext;
+}
+}
+
+namespace content {
+
+class BrowserPpapiHost;
+
+class PepperFlashFileHost : public ppapi::host::ResourceHost {
+ public:
+ PepperFlashFileHost(BrowserPpapiHost* host,
+ PP_Instance instance,
+ PP_Resource resource);
+ virtual ~PepperFlashFileHost();
+
+ static FilePath GetDataDirName(const FilePath& profile_path);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(PepperFlashFileHost);
+};
+
+// 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.
+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.
+ public:
+ FileThreadMessageFilter(const std::string& plugin_name,
+ const FilePath& profile_data_directory,
+ int plugin_process_id,
+ base::ProcessHandle plugin_process_handle);
+ protected:
+ // ppapi::host::ResourceMessageFilter implementation.
+ virtual scoped_refptr<base::TaskRunner> OverrideTaskRunnerForMessage(
+ const IPC::Message& msg) OVERRIDE;
+ virtual int32_t OnResourceMessageReceived(
+ const IPC::Message& msg,
+ ppapi::host::HostMessageContext* context) OVERRIDE;
+
+ private:
+ virtual ~FileThreadMessageFilter();
+
+ int32_t OnOpenFile(ppapi::host::HostMessageContext* context,
+ const ppapi::PepperFilePath& path,
+ int flags);
+ int32_t OnRenameFile(ppapi::host::HostMessageContext* context,
+ const ppapi::PepperFilePath& from_path,
+ const ppapi::PepperFilePath& to_path);
+ int32_t OnDeleteFileOrDir(ppapi::host::HostMessageContext* context,
+ const ppapi::PepperFilePath& path,
+ bool recursive);
+ int32_t OnCreateDir(ppapi::host::HostMessageContext* context,
+ const ppapi::PepperFilePath& path);
+ int32_t OnQueryFile(ppapi::host::HostMessageContext* context,
+ const ppapi::PepperFilePath& path);
+ int32_t OnGetDirContents(ppapi::host::HostMessageContext* context,
+ const ppapi::PepperFilePath& path);
+ int32_t OnCreateTemporaryFile(ppapi::host::HostMessageContext* context);
+
+ FilePath ValidateAndConvertPepperFilePath(
+ const ppapi::PepperFilePath& pepper_path,
+ int flags);
+
+ FilePath plugin_data_directory_;
+ int plugin_process_id_;
+ base::ProcessHandle plugin_process_handle_;
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_FLASH_FILE_HOST_H_

Powered by Google App Engine
This is Rietveld 408576698