OLD | NEW |
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 Loading... |
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" |
66 #include "ppapi/proxy/ppapi_messages.h" | 67 #include "ppapi/proxy/ppapi_messages.h" |
67 #include "ppapi/shared_impl/file_path.h" | 68 #include "ppapi/shared_impl/file_path.h" |
68 #include "ppapi/shared_impl/platform_file.h" | 69 #include "ppapi/shared_impl/platform_file.h" |
69 #include "ppapi/shared_impl/ppapi_permissions.h" | 70 #include "ppapi/shared_impl/ppapi_permissions.h" |
70 #include "ppapi/shared_impl/ppapi_preferences.h" | 71 #include "ppapi/shared_impl/ppapi_preferences.h" |
71 #include "ppapi/shared_impl/ppb_device_ref_shared.h" | 72 #include "ppapi/shared_impl/ppb_device_ref_shared.h" |
72 #include "ppapi/thunk/enter.h" | 73 #include "ppapi/thunk/enter.h" |
73 #include "ppapi/thunk/ppb_tcp_server_socket_private_api.h" | 74 #include "ppapi/thunk/ppb_tcp_server_socket_private_api.h" |
74 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" | 75 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" |
75 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" | 76 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
(...skipping 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1082 const AsyncOpenFileSystemURLCallback& callback) { | 1083 const AsyncOpenFileSystemURLCallback& callback) { |
1083 | 1084 |
1084 FileSystemDispatcher* file_system_dispatcher = | 1085 FileSystemDispatcher* file_system_dispatcher = |
1085 ChildThread::current()->file_system_dispatcher(); | 1086 ChildThread::current()->file_system_dispatcher(); |
1086 return file_system_dispatcher->OpenFile(path, flags, | 1087 return file_system_dispatcher->OpenFile(path, flags, |
1087 new AsyncOpenFileSystemURLCallbackTranslator( | 1088 new AsyncOpenFileSystemURLCallbackTranslator( |
1088 callback, | 1089 callback, |
1089 base::Bind(&DoNotifyCloseFile, path))); | 1090 base::Bind(&DoNotifyCloseFile, path))); |
1090 } | 1091 } |
1091 | 1092 |
| 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 |
1092 void PepperPluginDelegateImpl::SyncGetFileSystemPlatformPath( | 1173 void PepperPluginDelegateImpl::SyncGetFileSystemPlatformPath( |
1093 const GURL& url, FilePath* platform_path) { | 1174 const GURL& url, FilePath* platform_path) { |
1094 RenderThreadImpl::current()->Send(new FileSystemHostMsg_SyncGetPlatformPath( | 1175 RenderThreadImpl::current()->Send(new FileSystemHostMsg_SyncGetPlatformPath( |
1095 url, platform_path)); | 1176 url, platform_path)); |
1096 } | 1177 } |
1097 | 1178 |
1098 scoped_refptr<base::MessageLoopProxy> | 1179 scoped_refptr<base::MessageLoopProxy> |
1099 PepperPluginDelegateImpl::GetFileThreadMessageLoopProxy() { | 1180 PepperPluginDelegateImpl::GetFileThreadMessageLoopProxy() { |
1100 return RenderThreadImpl::current()->GetFileThreadMessageLoopProxy(); | 1181 return RenderThreadImpl::current()->GetFileThreadMessageLoopProxy(); |
1101 } | 1182 } |
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1740 RenderWidgetFullscreenPepper* container = | 1821 RenderWidgetFullscreenPepper* container = |
1741 static_cast<RenderWidgetFullscreenPepper*>( | 1822 static_cast<RenderWidgetFullscreenPepper*>( |
1742 instance->fullscreen_container()); | 1823 instance->fullscreen_container()); |
1743 return container->mouse_lock_dispatcher(); | 1824 return container->mouse_lock_dispatcher(); |
1744 } else { | 1825 } else { |
1745 return render_view_->mouse_lock_dispatcher(); | 1826 return render_view_->mouse_lock_dispatcher(); |
1746 } | 1827 } |
1747 } | 1828 } |
1748 | 1829 |
1749 } // namespace content | 1830 } // namespace content |
OLD | NEW |