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

Unified Diff: ppapi/proxy/flash_resource.cc

Issue 11415140: Refactor 3 PPB_Flash functions to the new 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/proxy/flash_resource.h ('k') | ppapi/proxy/ppapi_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/flash_resource.cc
diff --git a/ppapi/proxy/flash_resource.cc b/ppapi/proxy/flash_resource.cc
index afbe6243c1984dd9cf0b910fcd7b51ffffabb677..be5acd3a851eb26532aa54b95d96768e90bea998 100644
--- a/ppapi/proxy/flash_resource.cc
+++ b/ppapi/proxy/flash_resource.cc
@@ -4,7 +4,11 @@
#include "ppapi/proxy/flash_resource.h"
+#include "ppapi/c/pp_errors.h"
+#include "ppapi/c/private/ppb_flash.h"
+#include "ppapi/proxy/plugin_globals.h"
#include "ppapi/proxy/ppapi_messages.h"
+#include "ppapi/shared_impl/var.h"
namespace ppapi {
namespace proxy {
@@ -12,6 +16,7 @@ namespace proxy {
FlashResource::FlashResource(Connection connection, PP_Instance instance)
: PluginResource(connection, instance) {
SendCreate(RENDERER, PpapiHostMsg_Flash_Create());
+ SendCreate(BROWSER, PpapiHostMsg_Flash_Create());
}
FlashResource::~FlashResource() {
@@ -21,5 +26,35 @@ thunk::PPB_Flash_Functions_API* FlashResource::AsPPB_Flash_Functions_API() {
return this;
}
+PP_Var FlashResource::GetProxyForURL(PP_Instance instance,
+ const std::string& url) {
+ std::string proxy;
+ int32_t result = SyncCall<PpapiPluginMsg_Flash_GetProxyForURLReply>(RENDERER,
+ PpapiHostMsg_Flash_GetProxyForURL(url), &proxy);
+
+ if (result == PP_OK)
+ return StringVar::StringToPPVar(proxy);
+ return PP_MakeUndefined();
+}
+
+void FlashResource::UpdateActivity(PP_Instance instance) {
+ Post(BROWSER, PpapiHostMsg_Flash_UpdateActivity());
+}
+
+PP_Bool FlashResource::SetCrashData(PP_Instance instance,
+ PP_FlashCrashKey key,
+ PP_Var value) {
+ switch (key) {
+ case PP_FLASHCRASHKEY_URL: {
+ StringVar* url_string_var(StringVar::FromPPVar(value));
+ if (!url_string_var)
+ return PP_FALSE;
+ PluginGlobals::Get()->SetActiveURL(url_string_var->value());
+ return PP_TRUE;
+ }
+ }
+ return PP_FALSE;
+}
+
} // namespace proxy
} // namespace ppapi
« no previous file with comments | « ppapi/proxy/flash_resource.h ('k') | ppapi/proxy/ppapi_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698