diff options
author | tsepez@chromium.org <tsepez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-04 22:29:44 +0000 |
---|---|---|
committer | tsepez@chromium.org <tsepez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-04 22:29:44 +0000 |
commit | ec3cbea1d64c344f4686725daba1ef34b630e439 (patch) | |
tree | df16c66639b513ddb9001c4293683d996e3c6c8c /content | |
parent | 7fdb6ee3c2dc1858acef47bda53f36c2df53cb24 (diff) | |
download | chromium_src-ec3cbea1d64c344f4686725daba1ef34b630e439.zip chromium_src-ec3cbea1d64c344f4686725daba1ef34b630e439.tar.gz chromium_src-ec3cbea1d64c344f4686725daba1ef34b630e439.tar.bz2 |
Revert 140399 - 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
TBR=tsepez@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10521012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140402 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r-- | content/browser/ppapi_plugin_process_host.cc | 17 | ||||
-rw-r--r-- | content/browser/ppapi_plugin_process_host.h | 13 | ||||
-rw-r--r-- | content/browser/renderer_host/pepper_file_message_filter.cc | 60 | ||||
-rw-r--r-- | content/browser/renderer_host/pepper_file_message_filter.h | 50 | ||||
-rw-r--r-- | content/browser/renderer_host/render_process_host_impl.cc | 2 | ||||
-rw-r--r-- | content/common/content_message_generator.h | 1 | ||||
-rw-r--r-- | content/common/pepper_file_messages.cc | 39 | ||||
-rw-r--r-- | content/common/pepper_file_messages.h | 75 | ||||
-rw-r--r-- | content/content_common.gypi | 2 | ||||
-rw-r--r-- | content/renderer/pepper/pepper_plugin_delegate_impl.cc | 20 | ||||
-rw-r--r-- | content/renderer/pepper/pepper_plugin_delegate_impl.h | 18 |
11 files changed, 182 insertions, 115 deletions
diff --git a/content/browser/ppapi_plugin_process_host.cc b/content/browser/ppapi_plugin_process_host.cc index de2770a..71cadc4 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( - info.name, profile_data_directory, host_resolver); + PpapiPluginProcessHost* plugin_host = + new PpapiPluginProcessHost(profile_data_directory, host_resolver); if (plugin_host->Init(info)) return plugin_host; @@ -112,23 +112,16 @@ void PpapiPluginProcessHost::OpenChannelToPlugin(Client* client) { } PpapiPluginProcessHost::PpapiPluginProcessHost( - const std::string& plugin_name, const FilePath& profile_data_directory, net::HostResolver* host_resolver) - : network_observer_(new PluginNetworkObserver(this)), + : filter_(new PepperMessageFilter(PepperMessageFilter::PLUGIN, + host_resolver)), + 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 f5954f5..71314b1 100644 --- a/content/browser/ppapi_plugin_process_host.h +++ b/content/browser/ppapi_plugin_process_host.h @@ -6,14 +6,12 @@ #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/ref_counted.h" #include "base/memory/scoped_ptr.h" -#include "content/browser/renderer_host/pepper_file_message_filter.h" +#include "base/memory/ref_counted.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" @@ -81,8 +79,7 @@ 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. @@ -91,8 +88,7 @@ class PpapiPluginProcessHost : public content::BrowserChildProcessHostDelegate, // Constructors for plugin and broker process hosts, respectively. // You must call Init before doing anything else. - PpapiPluginProcessHost(const std::string& plugin_name, - const FilePath& profile_data_directory, + PpapiPluginProcessHost(const FilePath& profile_data_directory, net::HostResolver* host_resolver); PpapiPluginProcessHost(); @@ -116,9 +112,6 @@ 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 a86542e..e8b3a92 100644 --- a/content/browser/renderer_host/pepper_file_message_filter.cc +++ b/content/browser/renderer_host/pepper_file_message_filter.cc @@ -11,11 +11,12 @@ #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 "ppapi/proxy/pepper_file_messages.h" -#include "ppapi/shared_impl/file_path.h" +#include "webkit/plugins/ppapi/file_path.h" #if defined(OS_POSIX) #include "base/file_descriptor_posix.h" @@ -37,9 +38,11 @@ const int kWritePermissions = base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_EXCLUSIVE_WRITE | base::PLATFORM_FILE_WRITE_ATTRIBUTES; -PepperFileMessageFilter::PepperFileMessageFilter(int child_id) +PepperFileMessageFilter::PepperFileMessageFilter( + int child_id, content::BrowserContext* browser_context) : child_id_(child_id), channel_(NULL) { + pepper_path_ = GetDataDirName(browser_context->GetPath()); } void PepperFileMessageFilter::OverrideThreadForMessage( @@ -80,7 +83,7 @@ PepperFileMessageFilter::~PepperFileMessageFilter() { // Called on the FILE thread: void PepperFileMessageFilter::OnOpenFile( - const ppapi::PepperFilePath& path, + const webkit::ppapi::PepperFilePath& path, int flags, base::PlatformFileError* error, IPC::PlatformFileForTransit* file) { @@ -125,8 +128,8 @@ void PepperFileMessageFilter::OnOpenFile( } void PepperFileMessageFilter::OnRenameFile( - const ppapi::PepperFilePath& from_path, - const ppapi::PepperFilePath& to_path, + const webkit::ppapi::PepperFilePath& from_path, + const webkit::ppapi::PepperFilePath& to_path, base::PlatformFileError* error) { FilePath from_full_path = ValidateAndConvertPepperFilePath(from_path, kWritePermissions); @@ -143,7 +146,7 @@ void PepperFileMessageFilter::OnRenameFile( } void PepperFileMessageFilter::OnDeleteFileOrDir( - const ppapi::PepperFilePath& path, + const webkit::ppapi::PepperFilePath& path, bool recursive, base::PlatformFileError* error) { FilePath full_path = ValidateAndConvertPepperFilePath(path, @@ -159,7 +162,7 @@ void PepperFileMessageFilter::OnDeleteFileOrDir( } void PepperFileMessageFilter::OnCreateDir( - const ppapi::PepperFilePath& path, + const webkit::ppapi::PepperFilePath& path, base::PlatformFileError* error) { FilePath full_path = ValidateAndConvertPepperFilePath(path, kWritePermissions); @@ -174,7 +177,7 @@ void PepperFileMessageFilter::OnCreateDir( } void PepperFileMessageFilter::OnQueryFile( - const ppapi::PepperFilePath& path, + const webkit::ppapi::PepperFilePath& path, base::PlatformFileInfo* info, base::PlatformFileError* error) { FilePath full_path = ValidateAndConvertPepperFilePath(path, kReadPermissions); @@ -189,8 +192,8 @@ void PepperFileMessageFilter::OnQueryFile( } void PepperFileMessageFilter::OnGetDirContents( - const ppapi::PepperFilePath& path, - ppapi::DirContents* contents, + const webkit::ppapi::PepperFilePath& path, + webkit::ppapi::DirContents* contents, base::PlatformFileError* error) { FilePath full_path = ValidateAndConvertPepperFilePath(path, kReadPermissions); if (full_path.empty()) { @@ -210,7 +213,7 @@ void PepperFileMessageFilter::OnGetDirContents( while (!enumerator.Next().empty()) { file_util::FileEnumerator::FindInfo info; enumerator.GetFindInfo(&info); - ppapi::DirEntry entry = { + webkit::ppapi::DirEntry entry = { file_util::FileEnumerator::GetFilename(info), file_util::FileEnumerator::IsDirectory(info) }; @@ -221,44 +224,19 @@ void PepperFileMessageFilter::OnGetDirContents( } FilePath PepperFileMessageFilter::ValidateAndConvertPepperFilePath( - 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) { + const webkit::ppapi::PepperFilePath& pepper_path, int flags) { FilePath file_path; // Empty path returned on error. switch(pepper_path.domain()) { - case ppapi::PepperFilePath::DOMAIN_ABSOLUTE: + case webkit::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 ppapi::PepperFilePath::DOMAIN_MODULE_LOCAL: + case webkit::ppapi::PepperFilePath::DOMAIN_MODULE_LOCAL: if (!pepper_path.path().IsAbsolute() && !pepper_path.path().ReferencesParent()) - file_path = plugin_data_directory_.Append(pepper_path.path()); + file_path = pepper_path_.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 167f1f3..09f01f6 100644 --- a/content/browser/renderer_host/pepper_file_message_filter.h +++ b/content/browser/renderer_host/pepper_file_message_filter.h @@ -16,20 +16,23 @@ #include "build/build_config.h" #include "content/public/browser/browser_message_filter.h" #include "ipc/ipc_platform_file.h" -#include "ppapi/shared_impl/dir_contents.h" +#include "webkit/plugins/ppapi/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: - explicit PepperFileMessageFilter(int child_id); + PepperFileMessageFilter(int child_id, + content::BrowserContext* browser_context); // content::BrowserMessageFilter methods: virtual void OverrideThreadForMessage( @@ -54,29 +57,29 @@ class PepperFileMessageFilter : public content::BrowserMessageFilter { friend class base::DeleteHelper<PepperFileMessageFilter>; // Called on the FILE thread: - void OnOpenFile(const ppapi::PepperFilePath& path, + void OnOpenFile(const webkit::ppapi::PepperFilePath& path, int flags, base::PlatformFileError* error, IPC::PlatformFileForTransit* file); - void OnRenameFile(const ppapi::PepperFilePath& from_path, - const ppapi::PepperFilePath& to_path, + void OnRenameFile(const webkit::ppapi::PepperFilePath& from_path, + const webkit::ppapi::PepperFilePath& to_path, base::PlatformFileError* error); - void OnDeleteFileOrDir(const ppapi::PepperFilePath& path, + void OnDeleteFileOrDir(const webkit::ppapi::PepperFilePath& path, bool recursive, base::PlatformFileError* error); - void OnCreateDir(const ppapi::PepperFilePath& path, + void OnCreateDir(const webkit::ppapi::PepperFilePath& path, base::PlatformFileError* error); - void OnQueryFile(const ppapi::PepperFilePath& path, + void OnQueryFile(const webkit::ppapi::PepperFilePath& path, base::PlatformFileInfo* info, base::PlatformFileError* error); - void OnGetDirContents(const ppapi::PepperFilePath& path, - ppapi::DirContents* contents, + void OnGetDirContents(const webkit::ppapi::PepperFilePath& path, + webkit::ppapi::DirContents* contents, base::PlatformFileError* error); // Validate and convert the Pepper file path to a "real" |FilePath|. Returns // an empty |FilePath| on error. - virtual FilePath ValidateAndConvertPepperFilePath( - const ppapi::PepperFilePath& pepper_path, int flags); + FilePath ValidateAndConvertPepperFilePath( + const webkit::ppapi::PepperFilePath& pepper_path, int flags); // The ID of the child process. const int child_id_; @@ -85,27 +88,10 @@ class PepperFileMessageFilter : public content::BrowserMessageFilter { // owned by this class. IPC::Channel* channel_; - 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); + // The base path for the pepper data. + FilePath pepper_path_; - 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); + DISALLOW_COPY_AND_ASSIGN(PepperFileMessageFilter); }; #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 9f490bb..5493eca 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())); + channel_->AddFilter(new PepperFileMessageFilter(GetID(), browser_context)); 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 2bb605c..82e650e 100644 --- a/content/common/content_message_generator.h +++ b/content/common/content_message_generator.h @@ -30,6 +30,7 @@ #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 new file mode 100644 index 0000000..313c2b7 --- /dev/null +++ b/content/common/pepper_file_messages.cc @@ -0,0 +1,39 @@ +// 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 new file mode 100644 index 0000000..d202d53 --- /dev/null +++ b/content/common/pepper_file_messages.h @@ -0,0 +1,75 @@ +// 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 65b025d..16b13f6 100644 --- a/content/content_common.gypi +++ b/content/content_common.gypi @@ -269,6 +269,8 @@ '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 0a30831..c1ca266 100644 --- a/content/renderer/pepper/pepper_plugin_delegate_impl.cc +++ b/content/renderer/pepper/pepper_plugin_delegate_impl.cc @@ -24,6 +24,7 @@ #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" @@ -63,9 +64,7 @@ #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" @@ -83,6 +82,7 @@ #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 ppapi::PepperFilePath& path, + const webkit::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 ppapi::PepperFilePath& from_path, - const ppapi::PepperFilePath& to_path) { + const webkit::ppapi::PepperFilePath& from_path, + const webkit::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 ppapi::PepperFilePath& path, + const webkit::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 ppapi::PepperFilePath& path) { + const webkit::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 ppapi::PepperFilePath& path, + const webkit::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 ppapi::PepperFilePath& path, - ppapi::DirContents* contents) { + const webkit::ppapi::PepperFilePath& path, + webkit::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 c013402..21b2f1e 100644 --- a/content/renderer/pepper/pepper_plugin_delegate_impl.h +++ b/content/renderer/pepper/pepper_plugin_delegate_impl.h @@ -42,7 +42,6 @@ struct ChannelHandle; } namespace ppapi { -class PepperFilePath; class PPB_X509Certificate_Fields; } @@ -53,6 +52,7 @@ 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 ppapi::PepperFilePath& path, + const webkit::ppapi::PepperFilePath& path, int flags, base::PlatformFile* file) OVERRIDE; virtual base::PlatformFileError RenameFile( - const ppapi::PepperFilePath& from_path, - const ppapi::PepperFilePath& to_path) OVERRIDE; + const webkit::ppapi::PepperFilePath& from_path, + const webkit::ppapi::PepperFilePath& to_path) OVERRIDE; virtual base::PlatformFileError DeleteFileOrDir( - const ppapi::PepperFilePath& path, + const webkit::ppapi::PepperFilePath& path, bool recursive) OVERRIDE; virtual base::PlatformFileError CreateDir( - const ppapi::PepperFilePath& path) OVERRIDE; + const webkit::ppapi::PepperFilePath& path) OVERRIDE; virtual base::PlatformFileError QueryFile( - const ppapi::PepperFilePath& path, + const webkit::ppapi::PepperFilePath& path, base::PlatformFileInfo* info) OVERRIDE; virtual base::PlatformFileError GetDirContents( - const ppapi::PepperFilePath& path, - ppapi::DirContents* contents) OVERRIDE; + const webkit::ppapi::PepperFilePath& path, + webkit::ppapi::DirContents* contents) OVERRIDE; virtual void SyncGetFileSystemPlatformPath( const GURL& url, FilePath* platform_path) OVERRIDE; |