Chromium Code Reviews| Index: ppapi/proxy/flash_resource.cc |
| diff --git a/ppapi/proxy/flash_resource.cc b/ppapi/proxy/flash_resource.cc |
| index afbe6243c1984dd9cf0b910fcd7b51ffffabb677..aae611e83e462533c54afe71936bdb250695989d 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: |
|
brettw
2012/11/30 23:29:25
Need {} since you declare local vars.
raymes
2012/12/03 17:30:31
Done.
|
| + StringVar *url_string_var(StringVar::FromPPVar(value)); |
|
brettw
2012/11/30 23:29:25
* next to the type instead.
raymes
2012/12/03 17:30:31
Done.
|
| + if (!url_string_var) |
| + return PP_FALSE; |
| + std::string url_string(url_string_var->value()); |
|
brettw
2012/11/30 23:29:25
Can you just pass url_string_var->value() into Set
raymes
2012/12/03 17:30:31
Done.
|
| + PluginGlobals::Get()->SetActiveURL(url_string); |
| + return PP_TRUE; |
| + } |
| + return PP_FALSE; |
| +} |
| + |
| } // namespace proxy |
| } // namespace ppapi |