summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authortsepez@chromium.org <tsepez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-04 22:19:46 +0000
committertsepez@chromium.org <tsepez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-04 22:19:46 +0000
commit889636c1b0df6feb74cab6e23aa6ba1c7e65546a (patch)
tree301fec1f14656c1ebbb0b38ebbcc39fdb47cff18 /content
parent90b3ee177b6f4dabf5f10ca10be123da2222ea9d (diff)
downloadchromium_src-889636c1b0df6feb74cab6e23aa6ba1c7e65546a.zip
chromium_src-889636c1b0df6feb74cab6e23aa6ba1c7e65546a.tar.gz
chromium_src-889636c1b0df6feb74cab6e23aa6ba1c7e65546a.tar.bz2
Open pepper files directly in browser.
This CL merges in the changes for the per-profile plugin process from the previously retired CL. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=140093 Review URL: https://chromiumcodereview.appspot.com/10387195 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140399 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/browser/ppapi_plugin_process_host.cc17
-rw-r--r--content/browser/ppapi_plugin_process_host.h13
-rw-r--r--content/browser/renderer_host/pepper_file_message_filter.cc60
-rw-r--r--content/browser/renderer_host/pepper_file_message_filter.h50
-rw-r--r--content/browser/renderer_host/render_process_host_impl.cc2
-rw-r--r--content/common/content_message_generator.h1
-rw-r--r--content/common/pepper_file_messages.cc39
-rw-r--r--content/common/pepper_file_messages.h75
-rw-r--r--content/content_common.gypi2
-rw-r--r--content/renderer/pepper/pepper_plugin_delegate_impl.cc20
-rw-r--r--content/renderer/pepper/pepper_plugin_delegate_impl.h18
11 files changed, 115 insertions, 182 deletions
diff --git a/content/browser/ppapi_plugin_process_host.cc b/content/browser/ppapi_plugin_process_host.cc
index 71cadc4..de2770a 100644
--- a/content/browser/ppapi_plugin_process_host.cc
+++ b/content/browser/ppapi_plugin_process_host.cc
@@ -74,8 +74,8 @@ PpapiPluginProcessHost* PpapiPluginProcessHost::CreatePluginHost(
const content::PepperPluginInfo& info,
const FilePath& profile_data_directory,
net::HostResolver* host_resolver) {
- PpapiPluginProcessHost* plugin_host =
- new PpapiPluginProcessHost(profile_data_directory, host_resolver);
+ PpapiPluginProcessHost* plugin_host = new PpapiPluginProcessHost(
+ info.name, profile_data_directory, host_resolver);
if (plugin_host->Init(info))
return plugin_host;
@@ -112,16 +112,23 @@ void PpapiPluginProcessHost::OpenChannelToPlugin(Client* client) {
}
PpapiPluginProcessHost::PpapiPluginProcessHost(
+ const std::string& plugin_name,
const FilePath& profile_data_directory,
net::HostResolver* host_resolver)
- : filter_(new PepperMessageFilter(PepperMessageFilter::PLUGIN,
- host_resolver)),
- network_observer_(new PluginNetworkObserver(this)),
+ : network_observer_(new PluginNetworkObserver(this)),
profile_data_directory_(profile_data_directory),
is_broker_(false) {
process_.reset(new BrowserChildProcessHostImpl(
content::PROCESS_TYPE_PPAPI_PLUGIN, this));
+
+ filter_ = new PepperMessageFilter(
+ PepperMessageFilter::PLUGIN, host_resolver);
+
+ file_filter_ = new PepperTrustedFileMessageFilter(
+ process_->GetData().id, plugin_name, profile_data_directory);
+
process_->GetHost()->AddFilter(filter_.get());
+ process_->GetHost()->AddFilter(file_filter_.get());
}
PpapiPluginProcessHost::PpapiPluginProcessHost()
diff --git a/content/browser/ppapi_plugin_process_host.h b/content/browser/ppapi_plugin_process_host.h
index 71314b1..f5954f5 100644
--- a/content/browser/ppapi_plugin_process_host.h
+++ b/content/browser/ppapi_plugin_process_host.h
@@ -6,12 +6,14 @@
#define CONTENT_BROWSER_PPAPI_PLUGIN_PROCESS_HOST_H_
#pragma once
+#include <string>
#include <queue>
#include "base/basictypes.h"
#include "base/file_path.h"
-#include "base/memory/scoped_ptr.h"
#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
+#include "content/browser/renderer_host/pepper_file_message_filter.h"
#include "content/browser/renderer_host/pepper_message_filter.h"
#include "content/public/browser/browser_child_process_host_delegate.h"
#include "content/public/browser/browser_child_process_host_iterator.h"
@@ -79,7 +81,8 @@ class PpapiPluginProcessHost : public content::BrowserChildProcessHostDelegate,
const FilePath& plugin_path() const { return plugin_path_; }
const FilePath& profile_data_directory() const {
- return profile_data_directory_; }
+ return profile_data_directory_;
+ }
// The client pointer must remain valid until its callback is issued.
@@ -88,7 +91,8 @@ class PpapiPluginProcessHost : public content::BrowserChildProcessHostDelegate,
// Constructors for plugin and broker process hosts, respectively.
// You must call Init before doing anything else.
- PpapiPluginProcessHost(const FilePath& profile_data_directory,
+ PpapiPluginProcessHost(const std::string& plugin_name,
+ const FilePath& profile_data_directory,
net::HostResolver* host_resolver);
PpapiPluginProcessHost();
@@ -112,6 +116,9 @@ class PpapiPluginProcessHost : public content::BrowserChildProcessHostDelegate,
// Handles most requests from the plugin. May be NULL.
scoped_refptr<PepperMessageFilter> filter_;
+ // Handles filesystem requests from flash plugins. May be NULL.
+ scoped_refptr<PepperFileMessageFilter> file_filter_;
+
// Observes network changes. May be NULL.
scoped_ptr<PluginNetworkObserver> network_observer_;
diff --git a/content/browser/renderer_host/pepper_file_message_filter.cc b/content/browser/renderer_host/pepper_file_message_filter.cc
index e8b3a92..a86542e 100644
--- a/content/browser/renderer_host/pepper_file_message_filter.cc
+++ b/content/browser/renderer_host/pepper_file_message_filter.cc
@@ -11,12 +11,11 @@
#include "base/process_util.h"
#include "content/browser/child_process_security_policy_impl.h"
#include "content/browser/renderer_host/render_process_host_impl.h"
-#include "content/common/pepper_file_messages.h"
-#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/common/content_constants.h"
#include "ipc/ipc_platform_file.h"
-#include "webkit/plugins/ppapi/file_path.h"
+#include "ppapi/proxy/pepper_file_messages.h"
+#include "ppapi/shared_impl/file_path.h"
#if defined(OS_POSIX)
#include "base/file_descriptor_posix.h"
@@ -38,11 +37,9 @@ const int kWritePermissions = base::PLATFORM_FILE_OPEN |
base::PLATFORM_FILE_EXCLUSIVE_WRITE |
base::PLATFORM_FILE_WRITE_ATTRIBUTES;
-PepperFileMessageFilter::PepperFileMessageFilter(
- int child_id, content::BrowserContext* browser_context)
+PepperFileMessageFilter::PepperFileMessageFilter(int child_id)
: child_id_(child_id),
channel_(NULL) {
- pepper_path_ = GetDataDirName(browser_context->GetPath());
}
void PepperFileMessageFilter::OverrideThreadForMessage(
@@ -83,7 +80,7 @@ PepperFileMessageFilter::~PepperFileMessageFilter() {
// Called on the FILE thread:
void PepperFileMessageFilter::OnOpenFile(
- const webkit::ppapi::PepperFilePath& path,
+ const ppapi::PepperFilePath& path,
int flags,
base::PlatformFileError* error,
IPC::PlatformFileForTransit* file) {
@@ -128,8 +125,8 @@ void PepperFileMessageFilter::OnOpenFile(
}
void PepperFileMessageFilter::OnRenameFile(
- const webkit::ppapi::PepperFilePath& from_path,
- const webkit::ppapi::PepperFilePath& to_path,
+ const ppapi::PepperFilePath& from_path,
+ const ppapi::PepperFilePath& to_path,
base::PlatformFileError* error) {
FilePath from_full_path = ValidateAndConvertPepperFilePath(from_path,
kWritePermissions);
@@ -146,7 +143,7 @@ void PepperFileMessageFilter::OnRenameFile(
}
void PepperFileMessageFilter::OnDeleteFileOrDir(
- const webkit::ppapi::PepperFilePath& path,
+ const ppapi::PepperFilePath& path,
bool recursive,
base::PlatformFileError* error) {
FilePath full_path = ValidateAndConvertPepperFilePath(path,
@@ -162,7 +159,7 @@ void PepperFileMessageFilter::OnDeleteFileOrDir(
}
void PepperFileMessageFilter::OnCreateDir(
- const webkit::ppapi::PepperFilePath& path,
+ const ppapi::PepperFilePath& path,
base::PlatformFileError* error) {
FilePath full_path = ValidateAndConvertPepperFilePath(path,
kWritePermissions);
@@ -177,7 +174,7 @@ void PepperFileMessageFilter::OnCreateDir(
}
void PepperFileMessageFilter::OnQueryFile(
- const webkit::ppapi::PepperFilePath& path,
+ const ppapi::PepperFilePath& path,
base::PlatformFileInfo* info,
base::PlatformFileError* error) {
FilePath full_path = ValidateAndConvertPepperFilePath(path, kReadPermissions);
@@ -192,8 +189,8 @@ void PepperFileMessageFilter::OnQueryFile(
}
void PepperFileMessageFilter::OnGetDirContents(
- const webkit::ppapi::PepperFilePath& path,
- webkit::ppapi::DirContents* contents,
+ const ppapi::PepperFilePath& path,
+ ppapi::DirContents* contents,
base::PlatformFileError* error) {
FilePath full_path = ValidateAndConvertPepperFilePath(path, kReadPermissions);
if (full_path.empty()) {
@@ -213,7 +210,7 @@ void PepperFileMessageFilter::OnGetDirContents(
while (!enumerator.Next().empty()) {
file_util::FileEnumerator::FindInfo info;
enumerator.GetFindInfo(&info);
- webkit::ppapi::DirEntry entry = {
+ ppapi::DirEntry entry = {
file_util::FileEnumerator::GetFilename(info),
file_util::FileEnumerator::IsDirectory(info)
};
@@ -224,19 +221,44 @@ void PepperFileMessageFilter::OnGetDirContents(
}
FilePath PepperFileMessageFilter::ValidateAndConvertPepperFilePath(
- const webkit::ppapi::PepperFilePath& pepper_path, int flags) {
+ const ppapi::PepperFilePath& pepper_path, int flags) {
+ FilePath file_path; // Empty path returned on error.
+ if (pepper_path.domain() == ppapi::PepperFilePath::DOMAIN_ABSOLUTE) {
+ if (pepper_path.path().IsAbsolute() &&
+ ChildProcessSecurityPolicyImpl::GetInstance()->HasPermissionsForFile(
+ child_id(), pepper_path.path(), flags))
+ file_path = pepper_path.path();
+ }
+ return file_path;
+}
+
+PepperTrustedFileMessageFilter::PepperTrustedFileMessageFilter(
+ int child_id,
+ const std::string& plugin_name,
+ const FilePath& profile_data_directory)
+ : PepperFileMessageFilter(child_id) {
+ plugin_data_directory_ = GetDataDirName(profile_data_directory).Append(
+ FilePath::FromUTF8Unsafe(plugin_name));
+}
+
+PepperTrustedFileMessageFilter::~PepperTrustedFileMessageFilter() {
+}
+
+FilePath PepperTrustedFileMessageFilter::ValidateAndConvertPepperFilePath(
+ const ppapi::PepperFilePath& pepper_path,
+ int flags) {
FilePath file_path; // Empty path returned on error.
switch(pepper_path.domain()) {
- case webkit::ppapi::PepperFilePath::DOMAIN_ABSOLUTE:
+ case ppapi::PepperFilePath::DOMAIN_ABSOLUTE:
if (pepper_path.path().IsAbsolute() &&
ChildProcessSecurityPolicyImpl::GetInstance()->HasPermissionsForFile(
child_id(), pepper_path.path(), flags))
file_path = pepper_path.path();
break;
- case webkit::ppapi::PepperFilePath::DOMAIN_MODULE_LOCAL:
+ case ppapi::PepperFilePath::DOMAIN_MODULE_LOCAL:
if (!pepper_path.path().IsAbsolute() &&
!pepper_path.path().ReferencesParent())
- file_path = pepper_path_.Append(pepper_path.path());
+ file_path = plugin_data_directory_.Append(pepper_path.path());
break;
default:
NOTREACHED();
diff --git a/content/browser/renderer_host/pepper_file_message_filter.h b/content/browser/renderer_host/pepper_file_message_filter.h
index 09f01f6..167f1f3 100644
--- a/content/browser/renderer_host/pepper_file_message_filter.h
+++ b/content/browser/renderer_host/pepper_file_message_filter.h
@@ -16,23 +16,20 @@
#include "build/build_config.h"
#include "content/public/browser/browser_message_filter.h"
#include "ipc/ipc_platform_file.h"
-#include "webkit/plugins/ppapi/dir_contents.h"
+#include "ppapi/shared_impl/dir_contents.h"
namespace content {
class BrowserContext;
}
-namespace webkit {
namespace ppapi {
class PepperFilePath;
}
-}
// 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(
@@ -57,29 +54,29 @@ class PepperFileMessageFilter : public content::BrowserMessageFilter {
friend class base::DeleteHelper<PepperFileMessageFilter>;
// Called on the FILE thread:
- void OnOpenFile(const webkit::ppapi::PepperFilePath& path,
+ void OnOpenFile(const ppapi::PepperFilePath& path,
int flags,
base::PlatformFileError* error,
IPC::PlatformFileForTransit* file);
- void OnRenameFile(const webkit::ppapi::PepperFilePath& from_path,
- const webkit::ppapi::PepperFilePath& to_path,
+ void OnRenameFile(const ppapi::PepperFilePath& from_path,
+ const ppapi::PepperFilePath& to_path,
base::PlatformFileError* error);
- void OnDeleteFileOrDir(const webkit::ppapi::PepperFilePath& path,
+ void OnDeleteFileOrDir(const ppapi::PepperFilePath& path,
bool recursive,
base::PlatformFileError* error);
- void OnCreateDir(const webkit::ppapi::PepperFilePath& path,
+ void OnCreateDir(const ppapi::PepperFilePath& path,
base::PlatformFileError* error);
- void OnQueryFile(const webkit::ppapi::PepperFilePath& path,
+ void OnQueryFile(const ppapi::PepperFilePath& path,
base::PlatformFileInfo* info,
base::PlatformFileError* error);
- void OnGetDirContents(const webkit::ppapi::PepperFilePath& path,
- webkit::ppapi::DirContents* contents,
+ void OnGetDirContents(const ppapi::PepperFilePath& path,
+ ppapi::DirContents* contents,
base::PlatformFileError* error);
// Validate and convert the Pepper file path to a "real" |FilePath|. Returns
// an empty |FilePath| on error.
- FilePath ValidateAndConvertPepperFilePath(
- const webkit::ppapi::PepperFilePath& pepper_path, int flags);
+ virtual FilePath ValidateAndConvertPepperFilePath(
+ const ppapi::PepperFilePath& pepper_path, int flags);
// The ID of the child process.
const int child_id_;
@@ -88,10 +85,27 @@ class PepperFileMessageFilter : public content::BrowserMessageFilter {
// 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 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_
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 5493eca..9f490bb 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -482,7 +482,7 @@ void RenderProcessHostImpl::CreateMessageFilters() {
channel_->AddFilter(new media_stream::MediaStreamDispatcherHost(
resource_context, GetID(), BrowserMainLoop::GetAudioManager()));
#endif
- channel_->AddFilter(new PepperFileMessageFilter(GetID(), browser_context));
+ channel_->AddFilter(new PepperFileMessageFilter(GetID()));
channel_->AddFilter(new PepperMessageFilter(PepperMessageFilter::RENDERER,
GetID(), browser_context));
#if defined(ENABLE_INPUT_SPEECH)
diff --git a/content/common/content_message_generator.h b/content/common/content_message_generator.h
index 82e650e..2bb605c 100644
--- a/content/common/content_message_generator.h
+++ b/content/common/content_message_generator.h
@@ -30,7 +30,6 @@
#include "content/common/media/video_capture_messages.h"
#include "content/common/mime_registry_messages.h"
#include "content/common/p2p_messages.h"
-#include "content/common/pepper_file_messages.h"
#include "content/common/pepper_messages.h"
#include "content/common/plugin_messages.h"
#include "content/common/quota_messages.h"
diff --git a/content/common/pepper_file_messages.cc b/content/common/pepper_file_messages.cc
deleted file mode 100644
index 313c2b7..0000000
--- a/content/common/pepper_file_messages.cc
+++ /dev/null
@@ -1,39 +0,0 @@
-// 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.
-
-#include "content/common/pepper_file_messages.h"
-
-namespace IPC {
-
-void ParamTraits<webkit::ppapi::PepperFilePath>::Write(Message* m,
- const param_type& p) {
- WriteParam(m, static_cast<unsigned>(p.domain()));
- WriteParam(m, p.path());
-}
-
-bool ParamTraits<webkit::ppapi::PepperFilePath>::Read(const Message* m,
- PickleIterator* iter,
- param_type* p) {
- unsigned domain;
- FilePath path;
- if (!ReadParam(m, iter, &domain) || !ReadParam(m, iter, &path))
- return false;
- if (domain > webkit::ppapi::PepperFilePath::DOMAIN_MAX_VALID)
- return false;
-
- *p = webkit::ppapi::PepperFilePath(
- static_cast<webkit::ppapi::PepperFilePath::Domain>(domain), path);
- return true;
-}
-
-void ParamTraits<webkit::ppapi::PepperFilePath>::Log(const param_type& p,
- std::string* l) {
- l->append("(");
- LogParam(static_cast<unsigned>(p.domain()), l);
- l->append(", ");
- LogParam(p.path(), l);
- l->append(")");
-}
-
-} // namespace IPC
diff --git a/content/common/pepper_file_messages.h b/content/common/pepper_file_messages.h
deleted file mode 100644
index d202d53..0000000
--- a/content/common/pepper_file_messages.h
+++ /dev/null
@@ -1,75 +0,0 @@
-// 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.
-
-// Multiply-included message file, no traditional include guard.
-#include "content/public/common/common_param_traits.h"
-#include "ipc/ipc_message_macros.h"
-#include "ipc/ipc_param_traits.h"
-#include "ipc/ipc_platform_file.h"
-#include "webkit/plugins/ppapi/dir_contents.h"
-#include "webkit/plugins/ppapi/file_path.h"
-
-// Singly-included section since need custom serialization.
-#ifndef CONTENT_COMMON_PEPPER_FILE_MESSAGES_H_
-#define CONTENT_COMMON_PEPPER_FILE_MESSAGES_H_
-
-namespace IPC {
-
-template <>
-struct ParamTraits<webkit::ppapi::PepperFilePath> {
- typedef webkit::ppapi::PepperFilePath param_type;
- static void Write(Message* m, const param_type& p);
- static bool Read(const Message* m, PickleIterator* iter, param_type* p);
- static void Log(const param_type& p, std::string* l);
-};
-
-} // namespace IPC
-
-#endif // CONTENT_COMMON_PEPPER_FILE_MESSAGES_H_
-
-#define IPC_MESSAGE_START PepperFileMsgStart
-
-IPC_STRUCT_TRAITS_BEGIN(webkit::ppapi::DirEntry)
- IPC_STRUCT_TRAITS_MEMBER(name)
- IPC_STRUCT_TRAITS_MEMBER(is_dir)
-IPC_STRUCT_TRAITS_END()
-
-// Trusted Pepper Filesystem messages from the renderer to the browser.
-
-// Open the file.
-IPC_SYNC_MESSAGE_CONTROL2_2(PepperFileMsg_OpenFile,
- webkit::ppapi::PepperFilePath /* path */,
- int /* flags */,
- base::PlatformFileError /* error_code */,
- IPC::PlatformFileForTransit /* result */)
-
-// Rename the file.
-IPC_SYNC_MESSAGE_CONTROL2_1(PepperFileMsg_RenameFile,
- webkit::ppapi::PepperFilePath /* from_path */,
- webkit::ppapi::PepperFilePath /* to_path */,
- base::PlatformFileError /* error_code */)
-
-// Delete the file.
-IPC_SYNC_MESSAGE_CONTROL2_1(PepperFileMsg_DeleteFileOrDir,
- webkit::ppapi::PepperFilePath /* path */,
- bool /* recursive */,
- base::PlatformFileError /* error_code */)
-
-// Create the directory.
-IPC_SYNC_MESSAGE_CONTROL1_1(PepperFileMsg_CreateDir,
- webkit::ppapi::PepperFilePath /* path */,
- base::PlatformFileError /* error_code */)
-
-// Query the file's info.
-IPC_SYNC_MESSAGE_CONTROL1_2(PepperFileMsg_QueryFile,
- webkit::ppapi::PepperFilePath /* path */,
- base::PlatformFileInfo, /* info */
- base::PlatformFileError /* error_code */)
-
-// Get the directory's contents.
-IPC_SYNC_MESSAGE_CONTROL1_2(PepperFileMsg_GetDirContents,
- webkit::ppapi::PepperFilePath /* path */,
- webkit::ppapi::DirContents, /* contents */
- base::PlatformFileError /* error_code */)
-
diff --git a/content/content_common.gypi b/content/content_common.gypi
index 16b13f6..65b025d 100644
--- a/content/content_common.gypi
+++ b/content/content_common.gypi
@@ -269,8 +269,6 @@
'common/p2p_messages.h',
'common/p2p_sockets.h',
'common/page_zoom.cc',
- 'common/pepper_file_messages.cc',
- 'common/pepper_file_messages.h',
'common/pepper_messages.h',
'common/pepper_plugin_registry.cc',
'common/pepper_plugin_registry.h',
diff --git a/content/renderer/pepper/pepper_plugin_delegate_impl.cc b/content/renderer/pepper/pepper_plugin_delegate_impl.cc
index c1ca266..0a30831 100644
--- a/content/renderer/pepper/pepper_plugin_delegate_impl.cc
+++ b/content/renderer/pepper/pepper_plugin_delegate_impl.cc
@@ -24,7 +24,6 @@
#include "content/common/fileapi/file_system_dispatcher.h"
#include "content/common/fileapi/file_system_messages.h"
#include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h"
-#include "content/common/pepper_file_messages.h"
#include "content/common/pepper_plugin_registry.h"
#include "content/common/pepper_messages.h"
#include "content/common/quota_dispatcher.h"
@@ -64,7 +63,9 @@
#include "ppapi/c/pp_errors.h"
#include "ppapi/c/private/ppb_flash.h"
#include "ppapi/proxy/host_dispatcher.h"
+#include "ppapi/proxy/pepper_file_messages.h"
#include "ppapi/proxy/ppapi_messages.h"
+#include "ppapi/shared_impl/file_path.h"
#include "ppapi/shared_impl/platform_file.h"
#include "ppapi/shared_impl/ppapi_preferences.h"
#include "ppapi/shared_impl/ppb_device_ref_shared.h"
@@ -82,7 +83,6 @@
#include "ui/gfx/size.h"
#include "webkit/fileapi/file_system_callback_dispatcher.h"
#include "webkit/plugins/npapi/webplugin.h"
-#include "webkit/plugins/ppapi/file_path.h"
#include "webkit/plugins/ppapi/ppb_file_io_impl.h"
#include "webkit/plugins/ppapi/plugin_module.h"
#include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
@@ -913,7 +913,7 @@ bool PepperPluginDelegateImpl::AsyncOpenFileSystemURL(
}
base::PlatformFileError PepperPluginDelegateImpl::OpenFile(
- const webkit::ppapi::PepperFilePath& path,
+ const ppapi::PepperFilePath& path,
int flags,
base::PlatformFile* file) {
IPC::PlatformFileForTransit transit_file;
@@ -929,8 +929,8 @@ base::PlatformFileError PepperPluginDelegateImpl::OpenFile(
}
base::PlatformFileError PepperPluginDelegateImpl::RenameFile(
- const webkit::ppapi::PepperFilePath& from_path,
- const webkit::ppapi::PepperFilePath& to_path) {
+ const ppapi::PepperFilePath& from_path,
+ const ppapi::PepperFilePath& to_path) {
base::PlatformFileError error;
IPC::Message* msg = new PepperFileMsg_RenameFile(from_path, to_path, &error);
if (!render_view_->Send(msg))
@@ -939,7 +939,7 @@ base::PlatformFileError PepperPluginDelegateImpl::RenameFile(
}
base::PlatformFileError PepperPluginDelegateImpl::DeleteFileOrDir(
- const webkit::ppapi::PepperFilePath& path,
+ const ppapi::PepperFilePath& path,
bool recursive) {
base::PlatformFileError error;
IPC::Message* msg = new PepperFileMsg_DeleteFileOrDir(
@@ -950,7 +950,7 @@ base::PlatformFileError PepperPluginDelegateImpl::DeleteFileOrDir(
}
base::PlatformFileError PepperPluginDelegateImpl::CreateDir(
- const webkit::ppapi::PepperFilePath& path) {
+ const ppapi::PepperFilePath& path) {
base::PlatformFileError error;
IPC::Message* msg = new PepperFileMsg_CreateDir(path, &error);
if (!render_view_->Send(msg))
@@ -959,7 +959,7 @@ base::PlatformFileError PepperPluginDelegateImpl::CreateDir(
}
base::PlatformFileError PepperPluginDelegateImpl::QueryFile(
- const webkit::ppapi::PepperFilePath& path,
+ const ppapi::PepperFilePath& path,
base::PlatformFileInfo* info) {
base::PlatformFileError error;
IPC::Message* msg = new PepperFileMsg_QueryFile(path, info, &error);
@@ -969,8 +969,8 @@ base::PlatformFileError PepperPluginDelegateImpl::QueryFile(
}
base::PlatformFileError PepperPluginDelegateImpl::GetDirContents(
- const webkit::ppapi::PepperFilePath& path,
- webkit::ppapi::DirContents* contents) {
+ const ppapi::PepperFilePath& path,
+ ppapi::DirContents* contents) {
base::PlatformFileError error;
IPC::Message* msg = new PepperFileMsg_GetDirContents(path, contents, &error);
if (!render_view_->Send(msg))
diff --git a/content/renderer/pepper/pepper_plugin_delegate_impl.h b/content/renderer/pepper/pepper_plugin_delegate_impl.h
index 21b2f1e..c013402 100644
--- a/content/renderer/pepper/pepper_plugin_delegate_impl.h
+++ b/content/renderer/pepper/pepper_plugin_delegate_impl.h
@@ -42,6 +42,7 @@ struct ChannelHandle;
}
namespace ppapi {
+class PepperFilePath;
class PPB_X509Certificate_Fields;
}
@@ -52,7 +53,6 @@ class Range;
namespace webkit {
struct WebPluginInfo;
namespace ppapi {
-class PepperFilePath;
class PluginInstance;
class PluginModule;
}
@@ -251,23 +251,23 @@ class PepperPluginDelegateImpl
virtual void WillUpdateFile(const GURL& file_path) OVERRIDE;
virtual void DidUpdateFile(const GURL& file_path, int64_t delta) OVERRIDE;
virtual base::PlatformFileError OpenFile(
- const webkit::ppapi::PepperFilePath& path,
+ const ppapi::PepperFilePath& path,
int flags,
base::PlatformFile* file) OVERRIDE;
virtual base::PlatformFileError RenameFile(
- const webkit::ppapi::PepperFilePath& from_path,
- const webkit::ppapi::PepperFilePath& to_path) OVERRIDE;
+ const ppapi::PepperFilePath& from_path,
+ const ppapi::PepperFilePath& to_path) OVERRIDE;
virtual base::PlatformFileError DeleteFileOrDir(
- const webkit::ppapi::PepperFilePath& path,
+ const ppapi::PepperFilePath& path,
bool recursive) OVERRIDE;
virtual base::PlatformFileError CreateDir(
- const webkit::ppapi::PepperFilePath& path) OVERRIDE;
+ const ppapi::PepperFilePath& path) OVERRIDE;
virtual base::PlatformFileError QueryFile(
- const webkit::ppapi::PepperFilePath& path,
+ const ppapi::PepperFilePath& path,
base::PlatformFileInfo* info) OVERRIDE;
virtual base::PlatformFileError GetDirContents(
- const webkit::ppapi::PepperFilePath& path,
- webkit::ppapi::DirContents* contents) OVERRIDE;
+ const ppapi::PepperFilePath& path,
+ ppapi::DirContents* contents) OVERRIDE;
virtual void SyncGetFileSystemPlatformPath(
const GURL& url,
FilePath* platform_path) OVERRIDE;