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" | |
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 978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1055 const AsyncOpenFileSystemURLCallback& callback) { | 1054 const AsyncOpenFileSystemURLCallback& callback) { |
1056 | 1055 |
1057 FileSystemDispatcher* file_system_dispatcher = | 1056 FileSystemDispatcher* file_system_dispatcher = |
1058 ChildThread::current()->file_system_dispatcher(); | 1057 ChildThread::current()->file_system_dispatcher(); |
1059 return file_system_dispatcher->OpenFile(path, flags, | 1058 return file_system_dispatcher->OpenFile(path, flags, |
1060 new AsyncOpenFileSystemURLCallbackTranslator( | 1059 new AsyncOpenFileSystemURLCallbackTranslator( |
1061 callback, | 1060 callback, |
1062 base::Bind(&DoNotifyCloseFile, path))); | 1061 base::Bind(&DoNotifyCloseFile, path))); |
1063 } | 1062 } |
1064 | 1063 |
1065 base::PlatformFileError PepperPluginDelegateImpl::OpenFile( | |
1066 const ppapi::PepperFilePath& path, | |
1067 int flags, | |
1068 base::PlatformFile* file) { | |
1069 IPC::PlatformFileForTransit transit_file; | |
1070 base::PlatformFileError error; | |
1071 IPC::Message* msg = new PepperFileMsg_OpenFile( | |
1072 path, flags, &error, &transit_file); | |
1073 if (!render_view_->Send(msg)) { | |
1074 *file = base::kInvalidPlatformFileValue; | |
1075 return base::PLATFORM_FILE_ERROR_FAILED; | |
1076 } | |
1077 *file = IPC::PlatformFileForTransitToPlatformFile(transit_file); | |
1078 return error; | |
1079 } | |
1080 | |
1081 base::PlatformFileError PepperPluginDelegateImpl::RenameFile( | |
1082 const ppapi::PepperFilePath& from_path, | |
1083 const ppapi::PepperFilePath& to_path) { | |
1084 base::PlatformFileError error; | |
1085 IPC::Message* msg = new PepperFileMsg_RenameFile(from_path, to_path, &error); | |
1086 if (!render_view_->Send(msg)) | |
1087 return base::PLATFORM_FILE_ERROR_FAILED; | |
1088 return error; | |
1089 } | |
1090 | |
1091 base::PlatformFileError PepperPluginDelegateImpl::DeleteFileOrDir( | |
1092 const ppapi::PepperFilePath& path, | |
1093 bool recursive) { | |
1094 base::PlatformFileError error; | |
1095 IPC::Message* msg = new PepperFileMsg_DeleteFileOrDir( | |
1096 path, recursive, &error); | |
1097 if (!render_view_->Send(msg)) | |
1098 return base::PLATFORM_FILE_ERROR_FAILED; | |
1099 return error; | |
1100 } | |
1101 | |
1102 base::PlatformFileError PepperPluginDelegateImpl::CreateDir( | |
1103 const ppapi::PepperFilePath& path) { | |
1104 base::PlatformFileError error; | |
1105 IPC::Message* msg = new PepperFileMsg_CreateDir(path, &error); | |
1106 if (!render_view_->Send(msg)) | |
1107 return base::PLATFORM_FILE_ERROR_FAILED; | |
1108 return error; | |
1109 } | |
1110 | |
1111 base::PlatformFileError PepperPluginDelegateImpl::QueryFile( | |
1112 const ppapi::PepperFilePath& path, | |
1113 base::PlatformFileInfo* info) { | |
1114 base::PlatformFileError error; | |
1115 IPC::Message* msg = new PepperFileMsg_QueryFile(path, info, &error); | |
1116 if (!render_view_->Send(msg)) | |
1117 return base::PLATFORM_FILE_ERROR_FAILED; | |
1118 return error; | |
1119 } | |
1120 | |
1121 base::PlatformFileError PepperPluginDelegateImpl::GetDirContents( | |
1122 const ppapi::PepperFilePath& path, | |
1123 ppapi::DirContents* contents) { | |
1124 base::PlatformFileError error; | |
1125 IPC::Message* msg = new PepperFileMsg_GetDirContents(path, contents, &error); | |
1126 if (!render_view_->Send(msg)) | |
1127 return base::PLATFORM_FILE_ERROR_FAILED; | |
1128 return error; | |
1129 } | |
1130 | |
1131 base::PlatformFileError PepperPluginDelegateImpl::CreateTemporaryFile( | |
1132 base::PlatformFile* file) { | |
1133 IPC::PlatformFileForTransit transit_file; | |
1134 base::PlatformFileError error; | |
1135 IPC::Message* msg = new PepperFileMsg_CreateTemporaryFile(&error, | |
1136 &transit_file); | |
1137 if (!render_view_->Send(msg)) { | |
1138 *file = base::kInvalidPlatformFileValue; | |
1139 return base::PLATFORM_FILE_ERROR_FAILED; | |
1140 } | |
1141 *file = IPC::PlatformFileForTransitToPlatformFile(transit_file); | |
1142 return error; | |
1143 } | |
1144 | |
1145 void PepperPluginDelegateImpl::SyncGetFileSystemPlatformPath( | 1064 void PepperPluginDelegateImpl::SyncGetFileSystemPlatformPath( |
1146 const GURL& url, FilePath* platform_path) { | 1065 const GURL& url, FilePath* platform_path) { |
1147 RenderThreadImpl::current()->Send(new FileSystemHostMsg_SyncGetPlatformPath( | 1066 RenderThreadImpl::current()->Send(new FileSystemHostMsg_SyncGetPlatformPath( |
1148 url, platform_path)); | 1067 url, platform_path)); |
1149 } | 1068 } |
1150 | 1069 |
1151 scoped_refptr<base::MessageLoopProxy> | 1070 scoped_refptr<base::MessageLoopProxy> |
1152 PepperPluginDelegateImpl::GetFileThreadMessageLoopProxy() { | 1071 PepperPluginDelegateImpl::GetFileThreadMessageLoopProxy() { |
1153 return RenderThreadImpl::current()->GetFileThreadMessageLoopProxy(); | 1072 return RenderThreadImpl::current()->GetFileThreadMessageLoopProxy(); |
1154 } | 1073 } |
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1804 RenderWidgetFullscreenPepper* container = | 1723 RenderWidgetFullscreenPepper* container = |
1805 static_cast<RenderWidgetFullscreenPepper*>( | 1724 static_cast<RenderWidgetFullscreenPepper*>( |
1806 instance->fullscreen_container()); | 1725 instance->fullscreen_container()); |
1807 return container->mouse_lock_dispatcher(); | 1726 return container->mouse_lock_dispatcher(); |
1808 } else { | 1727 } else { |
1809 return render_view_->mouse_lock_dispatcher(); | 1728 return render_view_->mouse_lock_dispatcher(); |
1810 } | 1729 } |
1811 } | 1730 } |
1812 | 1731 |
1813 } // namespace content | 1732 } // namespace content |
OLD | NEW |