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

Unified Diff: ppapi/proxy/ppb_instance_proxy.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, 1 month 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
Index: ppapi/proxy/ppb_instance_proxy.cc
diff --git a/ppapi/proxy/ppb_instance_proxy.cc b/ppapi/proxy/ppb_instance_proxy.cc
index cb8389051226f958fd05363f56c29527a1849c14..b6a62acfbdb99dd7b0e86e8f1ff95a78a83739bb 100644
--- a/ppapi/proxy/ppb_instance_proxy.cc
+++ b/ppapi/proxy/ppb_instance_proxy.cc
@@ -16,6 +16,7 @@
#include "ppapi/proxy/content_decryptor_private_serializer.h"
#include "ppapi/proxy/enter_proxy.h"
#include "ppapi/proxy/flash_clipboard_resource.h"
+#include "ppapi/proxy/flash_file_resource.h"
#include "ppapi/proxy/flash_resource.h"
#include "ppapi/proxy/gamepad_resource.h"
#include "ppapi/proxy/host_dispatcher.h"
@@ -333,7 +334,7 @@ thunk::PPB_Flash_API* PPB_Instance_Proxy::GetFlashAPI() {
// TODO(raymes): We can most likely cut down this boilerplate for grabbing
// singleton resource APIs.
-thunk::PPB_Flash_Functions_API* PPB_Instance_Proxy::GetFlashFunctionsAPI(
+thunk::PPB_Flash_Clipboard_API* PPB_Instance_Proxy::GetFlashClipboardAPI(
PP_Instance instance) {
#if !defined(OS_NACL) && !defined(NACL_WIN64)
InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())->
@@ -341,13 +342,14 @@ thunk::PPB_Flash_Functions_API* PPB_Instance_Proxy::GetFlashFunctionsAPI(
if (!data)
return NULL;
- if (!data->flash_resource.get()) {
+ if (!data->flash_clipboard_resource.get()) {
Connection connection(
PluginGlobals::Get()->plugin_proxy_delegate()->GetBrowserSender(),
dispatcher());
- data->flash_resource = new FlashResource(connection, instance);
+ data->flash_clipboard_resource =
+ new FlashClipboardResource(connection, instance);
}
- return data->flash_resource.get();
+ return data->flash_clipboard_resource.get();
#else
// Flash functions aren't implemented for nacl.
NOTIMPLEMENTED();
@@ -355,7 +357,7 @@ thunk::PPB_Flash_Functions_API* PPB_Instance_Proxy::GetFlashFunctionsAPI(
#endif // !defined(OS_NACL) && !defined(NACL_WIN64)
}
-thunk::PPB_Flash_Clipboard_API* PPB_Instance_Proxy::GetFlashClipboardAPI(
+thunk::PPB_Flash_File_API* PPB_Instance_Proxy::GetFlashFileAPI(
PP_Instance instance) {
#if !defined(OS_NACL) && !defined(NACL_WIN64)
InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())->
@@ -363,14 +365,36 @@ thunk::PPB_Flash_Clipboard_API* PPB_Instance_Proxy::GetFlashClipboardAPI(
if (!data)
return NULL;
- if (!data->flash_clipboard_resource.get()) {
+ if (!data->flash_file_resource.get()) {
Connection connection(
PluginGlobals::Get()->plugin_proxy_delegate()->GetBrowserSender(),
dispatcher());
- data->flash_clipboard_resource =
- new FlashClipboardResource(connection, instance);
+ data->flash_file_resource =
+ new FlashFileResource(connection, instance);
}
- return data->flash_clipboard_resource.get();
+ return data->flash_file_resource.get();
+#else
+ // Flash functions aren't implemented for nacl.
+ NOTIMPLEMENTED();
+ return NULL;
+#endif // !defined(OS_NACL) && !defined(NACL_WIN64)
+}
+
+thunk::PPB_Flash_Functions_API* PPB_Instance_Proxy::GetFlashFunctionsAPI(
+ PP_Instance instance) {
+#if !defined(OS_NACL) && !defined(NACL_WIN64)
+ InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())->
+ GetInstanceData(instance);
+ if (!data)
+ return NULL;
+
+ if (!data->flash_resource.get()) {
+ Connection connection(
+ PluginGlobals::Get()->plugin_proxy_delegate()->GetBrowserSender(),
+ dispatcher());
+ data->flash_resource = new FlashResource(connection, instance);
+ }
+ return data->flash_resource.get();
#else
// Flash functions aren't implemented for nacl.
NOTIMPLEMENTED();

Powered by Google App Engine
This is Rietveld 408576698