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

Unified Diff: content/renderer/pepper/pepper_plugin_delegate_impl.cc

Issue 11437038: Revert 171408 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years 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
« no previous file with comments | « content/renderer/pepper/pepper_plugin_delegate_impl.h ('k') | ppapi/c/private/ppb_flash_file.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/pepper_plugin_delegate_impl.cc
diff --git a/content/renderer/pepper/pepper_plugin_delegate_impl.cc b/content/renderer/pepper/pepper_plugin_delegate_impl.cc
index eba8ee32a44b754a8d4da9f6f9ab5dd348b072a7..b890100f2213a785f68c8a2e282fd2478644324c 100644
--- a/content/renderer/pepper/pepper_plugin_delegate_impl.cc
+++ b/content/renderer/pepper/pepper_plugin_delegate_impl.cc
@@ -63,6 +63,7 @@
#include "ppapi/c/private/ppb_flash.h"
#include "ppapi/host/ppapi_host.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"
@@ -1089,6 +1090,86 @@ bool PepperPluginDelegateImpl::AsyncOpenFileSystemURL(
base::Bind(&DoNotifyCloseFile, path)));
}
+base::PlatformFileError PepperPluginDelegateImpl::OpenFile(
+ const ppapi::PepperFilePath& path,
+ int flags,
+ base::PlatformFile* file) {
+ IPC::PlatformFileForTransit transit_file;
+ base::PlatformFileError error;
+ IPC::Message* msg = new PepperFileMsg_OpenFile(
+ path, flags, &error, &transit_file);
+ if (!render_view_->Send(msg)) {
+ *file = base::kInvalidPlatformFileValue;
+ return base::PLATFORM_FILE_ERROR_FAILED;
+ }
+ *file = IPC::PlatformFileForTransitToPlatformFile(transit_file);
+ return error;
+}
+
+base::PlatformFileError PepperPluginDelegateImpl::RenameFile(
+ 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))
+ return base::PLATFORM_FILE_ERROR_FAILED;
+ return error;
+}
+
+base::PlatformFileError PepperPluginDelegateImpl::DeleteFileOrDir(
+ const ppapi::PepperFilePath& path,
+ bool recursive) {
+ base::PlatformFileError error;
+ IPC::Message* msg = new PepperFileMsg_DeleteFileOrDir(
+ path, recursive, &error);
+ if (!render_view_->Send(msg))
+ return base::PLATFORM_FILE_ERROR_FAILED;
+ return error;
+}
+
+base::PlatformFileError PepperPluginDelegateImpl::CreateDir(
+ const ppapi::PepperFilePath& path) {
+ base::PlatformFileError error;
+ IPC::Message* msg = new PepperFileMsg_CreateDir(path, &error);
+ if (!render_view_->Send(msg))
+ return base::PLATFORM_FILE_ERROR_FAILED;
+ return error;
+}
+
+base::PlatformFileError PepperPluginDelegateImpl::QueryFile(
+ const ppapi::PepperFilePath& path,
+ base::PlatformFileInfo* info) {
+ base::PlatformFileError error;
+ IPC::Message* msg = new PepperFileMsg_QueryFile(path, info, &error);
+ if (!render_view_->Send(msg))
+ return base::PLATFORM_FILE_ERROR_FAILED;
+ return error;
+}
+
+base::PlatformFileError PepperPluginDelegateImpl::GetDirContents(
+ const ppapi::PepperFilePath& path,
+ ppapi::DirContents* contents) {
+ base::PlatformFileError error;
+ IPC::Message* msg = new PepperFileMsg_GetDirContents(path, contents, &error);
+ if (!render_view_->Send(msg))
+ return base::PLATFORM_FILE_ERROR_FAILED;
+ return error;
+}
+
+base::PlatformFileError PepperPluginDelegateImpl::CreateTemporaryFile(
+ base::PlatformFile* file) {
+ IPC::PlatformFileForTransit transit_file;
+ base::PlatformFileError error;
+ IPC::Message* msg = new PepperFileMsg_CreateTemporaryFile(&error,
+ &transit_file);
+ if (!render_view_->Send(msg)) {
+ *file = base::kInvalidPlatformFileValue;
+ return base::PLATFORM_FILE_ERROR_FAILED;
+ }
+ *file = IPC::PlatformFileForTransitToPlatformFile(transit_file);
+ return error;
+}
+
void PepperPluginDelegateImpl::SyncGetFileSystemPlatformPath(
const GURL& url, FilePath* platform_path) {
RenderThreadImpl::current()->Send(new FileSystemHostMsg_SyncGetPlatformPath(
« no previous file with comments | « content/renderer/pepper/pepper_plugin_delegate_impl.h ('k') | ppapi/c/private/ppb_flash_file.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698