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

Side by Side Diff: content/renderer/pepper/pepper_plugin_delegate_impl.cc

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 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 unified diff | Download patch | Annotate | Revision Log
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/pepper/pepper_plugin_delegate_impl.h" 5 #include "content/renderer/pepper/pepper_plugin_delegate_impl.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <cstddef> 8 #include <cstddef>
9 #include <map> 9 #include <map>
10 #include <queue> 10 #include <queue>
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 #include "content/renderer/render_widget_fullscreen_pepper.h" 56 #include "content/renderer/render_widget_fullscreen_pepper.h"
57 #include "content/renderer/webplugin_delegate_proxy.h" 57 #include "content/renderer/webplugin_delegate_proxy.h"
58 #include "googleurl/src/gurl.h" 58 #include "googleurl/src/gurl.h"
59 #include "ipc/ipc_channel_handle.h" 59 #include "ipc/ipc_channel_handle.h"
60 #include "media/video/capture/video_capture_proxy.h" 60 #include "media/video/capture/video_capture_proxy.h"
61 #include "ppapi/c/dev/pp_video_dev.h" 61 #include "ppapi/c/dev/pp_video_dev.h"
62 #include "ppapi/c/pp_errors.h" 62 #include "ppapi/c/pp_errors.h"
63 #include "ppapi/c/private/ppb_flash.h" 63 #include "ppapi/c/private/ppb_flash.h"
64 #include "ppapi/host/ppapi_host.h" 64 #include "ppapi/host/ppapi_host.h"
65 #include "ppapi/proxy/host_dispatcher.h" 65 #include "ppapi/proxy/host_dispatcher.h"
66 #include "ppapi/proxy/pepper_file_messages.h"
67 #include "ppapi/proxy/ppapi_messages.h" 66 #include "ppapi/proxy/ppapi_messages.h"
68 #include "ppapi/shared_impl/file_path.h" 67 #include "ppapi/shared_impl/file_path.h"
69 #include "ppapi/shared_impl/platform_file.h" 68 #include "ppapi/shared_impl/platform_file.h"
70 #include "ppapi/shared_impl/ppapi_permissions.h" 69 #include "ppapi/shared_impl/ppapi_permissions.h"
71 #include "ppapi/shared_impl/ppapi_preferences.h" 70 #include "ppapi/shared_impl/ppapi_preferences.h"
72 #include "ppapi/shared_impl/ppb_device_ref_shared.h" 71 #include "ppapi/shared_impl/ppb_device_ref_shared.h"
73 #include "ppapi/thunk/enter.h" 72 #include "ppapi/thunk/enter.h"
74 #include "ppapi/thunk/ppb_tcp_server_socket_private_api.h" 73 #include "ppapi/thunk/ppb_tcp_server_socket_private_api.h"
75 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" 74 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h"
76 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" 75 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h"
(...skipping 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after
1083 const AsyncOpenFileSystemURLCallback& callback) { 1082 const AsyncOpenFileSystemURLCallback& callback) {
1084 1083
1085 FileSystemDispatcher* file_system_dispatcher = 1084 FileSystemDispatcher* file_system_dispatcher =
1086 ChildThread::current()->file_system_dispatcher(); 1085 ChildThread::current()->file_system_dispatcher();
1087 return file_system_dispatcher->OpenFile(path, flags, 1086 return file_system_dispatcher->OpenFile(path, flags,
1088 new AsyncOpenFileSystemURLCallbackTranslator( 1087 new AsyncOpenFileSystemURLCallbackTranslator(
1089 callback, 1088 callback,
1090 base::Bind(&DoNotifyCloseFile, path))); 1089 base::Bind(&DoNotifyCloseFile, path)));
1091 } 1090 }
1092 1091
1093 base::PlatformFileError PepperPluginDelegateImpl::OpenFile(
1094 const ppapi::PepperFilePath& path,
1095 int flags,
1096 base::PlatformFile* file) {
1097 IPC::PlatformFileForTransit transit_file;
1098 base::PlatformFileError error;
1099 IPC::Message* msg = new PepperFileMsg_OpenFile(
1100 path, flags, &error, &transit_file);
1101 if (!render_view_->Send(msg)) {
1102 *file = base::kInvalidPlatformFileValue;
1103 return base::PLATFORM_FILE_ERROR_FAILED;
1104 }
1105 *file = IPC::PlatformFileForTransitToPlatformFile(transit_file);
1106 return error;
1107 }
1108
1109 base::PlatformFileError PepperPluginDelegateImpl::RenameFile(
1110 const ppapi::PepperFilePath& from_path,
1111 const ppapi::PepperFilePath& to_path) {
1112 base::PlatformFileError error;
1113 IPC::Message* msg = new PepperFileMsg_RenameFile(from_path, to_path, &error);
1114 if (!render_view_->Send(msg))
1115 return base::PLATFORM_FILE_ERROR_FAILED;
1116 return error;
1117 }
1118
1119 base::PlatformFileError PepperPluginDelegateImpl::DeleteFileOrDir(
1120 const ppapi::PepperFilePath& path,
1121 bool recursive) {
1122 base::PlatformFileError error;
1123 IPC::Message* msg = new PepperFileMsg_DeleteFileOrDir(
1124 path, recursive, &error);
1125 if (!render_view_->Send(msg))
1126 return base::PLATFORM_FILE_ERROR_FAILED;
1127 return error;
1128 }
1129
1130 base::PlatformFileError PepperPluginDelegateImpl::CreateDir(
1131 const ppapi::PepperFilePath& path) {
1132 base::PlatformFileError error;
1133 IPC::Message* msg = new PepperFileMsg_CreateDir(path, &error);
1134 if (!render_view_->Send(msg))
1135 return base::PLATFORM_FILE_ERROR_FAILED;
1136 return error;
1137 }
1138
1139 base::PlatformFileError PepperPluginDelegateImpl::QueryFile(
1140 const ppapi::PepperFilePath& path,
1141 base::PlatformFileInfo* info) {
1142 base::PlatformFileError error;
1143 IPC::Message* msg = new PepperFileMsg_QueryFile(path, info, &error);
1144 if (!render_view_->Send(msg))
1145 return base::PLATFORM_FILE_ERROR_FAILED;
1146 return error;
1147 }
1148
1149 base::PlatformFileError PepperPluginDelegateImpl::GetDirContents(
1150 const ppapi::PepperFilePath& path,
1151 ppapi::DirContents* contents) {
1152 base::PlatformFileError error;
1153 IPC::Message* msg = new PepperFileMsg_GetDirContents(path, contents, &error);
1154 if (!render_view_->Send(msg))
1155 return base::PLATFORM_FILE_ERROR_FAILED;
1156 return error;
1157 }
1158
1159 base::PlatformFileError PepperPluginDelegateImpl::CreateTemporaryFile(
1160 base::PlatformFile* file) {
1161 IPC::PlatformFileForTransit transit_file;
1162 base::PlatformFileError error;
1163 IPC::Message* msg = new PepperFileMsg_CreateTemporaryFile(&error,
1164 &transit_file);
1165 if (!render_view_->Send(msg)) {
1166 *file = base::kInvalidPlatformFileValue;
1167 return base::PLATFORM_FILE_ERROR_FAILED;
1168 }
1169 *file = IPC::PlatformFileForTransitToPlatformFile(transit_file);
1170 return error;
1171 }
1172
1173 void PepperPluginDelegateImpl::SyncGetFileSystemPlatformPath( 1092 void PepperPluginDelegateImpl::SyncGetFileSystemPlatformPath(
1174 const GURL& url, FilePath* platform_path) { 1093 const GURL& url, FilePath* platform_path) {
1175 RenderThreadImpl::current()->Send(new FileSystemHostMsg_SyncGetPlatformPath( 1094 RenderThreadImpl::current()->Send(new FileSystemHostMsg_SyncGetPlatformPath(
1176 url, platform_path)); 1095 url, platform_path));
1177 } 1096 }
1178 1097
1179 scoped_refptr<base::MessageLoopProxy> 1098 scoped_refptr<base::MessageLoopProxy>
1180 PepperPluginDelegateImpl::GetFileThreadMessageLoopProxy() { 1099 PepperPluginDelegateImpl::GetFileThreadMessageLoopProxy() {
1181 return RenderThreadImpl::current()->GetFileThreadMessageLoopProxy(); 1100 return RenderThreadImpl::current()->GetFileThreadMessageLoopProxy();
1182 } 1101 }
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after
1821 RenderWidgetFullscreenPepper* container = 1740 RenderWidgetFullscreenPepper* container =
1822 static_cast<RenderWidgetFullscreenPepper*>( 1741 static_cast<RenderWidgetFullscreenPepper*>(
1823 instance->fullscreen_container()); 1742 instance->fullscreen_container());
1824 return container->mouse_lock_dispatcher(); 1743 return container->mouse_lock_dispatcher();
1825 } else { 1744 } else {
1826 return render_view_->mouse_lock_dispatcher(); 1745 return render_view_->mouse_lock_dispatcher();
1827 } 1746 }
1828 } 1747 }
1829 1748
1830 } // namespace content 1749 } // namespace content
OLDNEW
« 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