Index: ppapi/cpp/private/flash.cc |
diff --git a/ppapi/cpp/private/flash.cc b/ppapi/cpp/private/flash.cc |
index 9cc7870d0d1dfba38c69162d85149ff25648a8ce..501da376e9295f605e1f84dbc612ba48f586502a 100644 |
--- a/ppapi/cpp/private/flash.cc |
+++ b/ppapi/cpp/private/flash.cc |
@@ -8,7 +8,7 @@ |
#include "ppapi/c/pp_errors.h" |
#include "ppapi/cpp/dev/font_dev.h" |
#include "ppapi/cpp/image_data.h" |
-#include "ppapi/cpp/instance.h" |
+#include "ppapi/cpp/instance_handle.h" |
#include "ppapi/cpp/module.h" |
#include "ppapi/cpp/module_impl.h" |
#include "ppapi/cpp/point.h" |
@@ -45,21 +45,22 @@ bool Flash::IsAvailable() { |
} |
// static |
-void Flash::SetInstanceAlwaysOnTop(Instance* instance, bool on_top) { |
+void Flash::SetInstanceAlwaysOnTop(const InstanceHandle& instance, |
+ bool on_top) { |
if (has_interface<PPB_Flash>()) { |
- get_interface<PPB_Flash>()->SetInstanceAlwaysOnTop(instance->pp_instance(), |
+ get_interface<PPB_Flash>()->SetInstanceAlwaysOnTop(instance.pp_instance(), |
PP_FromBool(on_top)); |
} else if (has_interface<PPB_Flash_12_0>()) { |
get_interface<PPB_Flash_12_0>()->SetInstanceAlwaysOnTop( |
- instance->pp_instance(), PP_FromBool(on_top)); |
+ instance.pp_instance(), PP_FromBool(on_top)); |
} else if (has_interface<PPB_Flash_11>()) { |
get_interface<PPB_Flash_11>()->SetInstanceAlwaysOnTop( |
- instance->pp_instance(), PP_FromBool(on_top)); |
+ instance.pp_instance(), PP_FromBool(on_top)); |
} |
} |
// static |
-bool Flash::DrawGlyphs(Instance* instance, |
+bool Flash::DrawGlyphs(const InstanceHandle& instance, |
ImageData* image, |
const FontDescription_Dev& font_desc, |
uint32_t color, |
@@ -73,7 +74,7 @@ bool Flash::DrawGlyphs(Instance* instance, |
bool rv = false; |
if (has_interface<PPB_Flash>()) { |
rv = PP_ToBool(get_interface<PPB_Flash>()->DrawGlyphs( |
- instance->pp_instance(), |
+ instance.pp_instance(), |
image->pp_resource(), |
&font_desc.pp_font_description(), |
color, |
@@ -86,7 +87,7 @@ bool Flash::DrawGlyphs(Instance* instance, |
glyph_advances)); |
} else if (has_interface<PPB_Flash_12_0>()) { |
rv = PP_ToBool(get_interface<PPB_Flash_12_0>()->DrawGlyphs( |
- instance->pp_instance(), |
+ instance.pp_instance(), |
image->pp_resource(), |
&font_desc.pp_font_description(), |
color, |
@@ -99,7 +100,7 @@ bool Flash::DrawGlyphs(Instance* instance, |
glyph_advances)); |
} else if (has_interface<PPB_Flash_11>()) { |
rv = PP_ToBool(get_interface<PPB_Flash_11>()->DrawGlyphs( |
- instance->pp_instance(), |
+ instance.pp_instance(), |
image->pp_resource(), |
&font_desc.pp_font_description(), |
color, |
@@ -114,20 +115,21 @@ bool Flash::DrawGlyphs(Instance* instance, |
} |
// static |
-Var Flash::GetProxyForURL(Instance* instance, const std::string& url) { |
+Var Flash::GetProxyForURL(const InstanceHandle& instance, |
+ const std::string& url) { |
Var rv; |
if (has_interface<PPB_Flash>()) { |
- rv = Var(Var::PassRef(), |
- get_interface<PPB_Flash>()->GetProxyForURL(instance->pp_instance(), |
+ rv = Var(PASS_REF, |
+ get_interface<PPB_Flash>()->GetProxyForURL(instance.pp_instance(), |
url.c_str())); |
} else if (has_interface<PPB_Flash_12_0>()) { |
- rv = Var(Var::PassRef(), |
+ rv = Var(PASS_REF, |
get_interface<PPB_Flash_12_0>()->GetProxyForURL( |
- instance->pp_instance(), url.c_str())); |
+ instance.pp_instance(), url.c_str())); |
} else if (has_interface<PPB_Flash_11>()) { |
- rv = Var(Var::PassRef(), |
+ rv = Var(PASS_REF, |
get_interface<PPB_Flash_11>()->GetProxyForURL( |
- instance->pp_instance(), url.c_str())); |
+ instance.pp_instance(), url.c_str())); |
} |
return rv; |
} |
@@ -155,37 +157,38 @@ int32_t Flash::Navigate(const URLRequestInfo& request_info, |
} |
// static |
-void Flash::RunMessageLoop(Instance* instance) { |
+void Flash::RunMessageLoop(const InstanceHandle& instance) { |
if (has_interface<PPB_Flash>()) |
- get_interface<PPB_Flash>()->RunMessageLoop(instance->pp_instance()); |
+ get_interface<PPB_Flash>()->RunMessageLoop(instance.pp_instance()); |
else if (has_interface<PPB_Flash_12_0>()) |
- get_interface<PPB_Flash_12_0>()->RunMessageLoop(instance->pp_instance()); |
+ get_interface<PPB_Flash_12_0>()->RunMessageLoop(instance.pp_instance()); |
else if (has_interface<PPB_Flash_11>()) |
- get_interface<PPB_Flash_11>()->RunMessageLoop(instance->pp_instance()); |
+ get_interface<PPB_Flash_11>()->RunMessageLoop(instance.pp_instance()); |
} |
// static |
-void Flash::QuitMessageLoop(Instance* instance) { |
+void Flash::QuitMessageLoop(const InstanceHandle& instance) { |
if (has_interface<PPB_Flash>()) |
- get_interface<PPB_Flash>()->QuitMessageLoop(instance->pp_instance()); |
+ get_interface<PPB_Flash>()->QuitMessageLoop(instance.pp_instance()); |
else if (has_interface<PPB_Flash_12_0>()) |
- get_interface<PPB_Flash_12_0>()->QuitMessageLoop(instance->pp_instance()); |
+ get_interface<PPB_Flash_12_0>()->QuitMessageLoop(instance.pp_instance()); |
else if (has_interface<PPB_Flash_11>()) |
- get_interface<PPB_Flash_11>()->QuitMessageLoop(instance->pp_instance()); |
+ get_interface<PPB_Flash_11>()->QuitMessageLoop(instance.pp_instance()); |
} |
// static |
-double Flash::GetLocalTimeZoneOffset(Instance* instance, PP_Time t) { |
+double Flash::GetLocalTimeZoneOffset(const InstanceHandle& instance, |
+ PP_Time t) { |
double rv = 0; |
if (has_interface<PPB_Flash>()) { |
rv = get_interface<PPB_Flash>()->GetLocalTimeZoneOffset( |
- instance->pp_instance(), t); |
+ instance.pp_instance(), t); |
} else if (has_interface<PPB_Flash_12_0>()) { |
rv = get_interface<PPB_Flash_12_0>()->GetLocalTimeZoneOffset( |
- instance->pp_instance(), t); |
+ instance.pp_instance(), t); |
} else if (has_interface<PPB_Flash_11>()) { |
rv = get_interface<PPB_Flash_11>()->GetLocalTimeZoneOffset( |
- instance->pp_instance(), t); |
+ instance.pp_instance(), t); |
} |
return rv; |
} |
@@ -194,15 +197,15 @@ double Flash::GetLocalTimeZoneOffset(Instance* instance, PP_Time t) { |
Var Flash::GetCommandLineArgs(Module* module) { |
Var rv; |
if (has_interface<PPB_Flash>()) { |
- rv = Var(Var::PassRef(), |
+ rv = Var(PASS_REF, |
get_interface<PPB_Flash>()->GetCommandLineArgs( |
module->pp_module())); |
} else if (has_interface<PPB_Flash_12_0>()) { |
- rv = Var(Var::PassRef(), |
+ rv = Var(PASS_REF, |
get_interface<PPB_Flash_12_0>()->GetCommandLineArgs( |
module->pp_module())); |
} else if (has_interface<PPB_Flash_11>()) { |
- rv = Var(Var::PassRef(), |
+ rv = Var(PASS_REF, |
get_interface<PPB_Flash_11>()->GetCommandLineArgs( |
module->pp_module())); |
} |
@@ -218,27 +221,27 @@ void Flash::PreloadFontWin(const void* logfontw) { |
} |
// static |
-bool Flash::IsRectTopmost(Instance* instance, const Rect& rect) { |
+bool Flash::IsRectTopmost(const InstanceHandle& instance, const Rect& rect) { |
bool rv = false; |
if (has_interface<PPB_Flash>()) { |
rv = PP_ToBool(get_interface<PPB_Flash>()->IsRectTopmost( |
- instance->pp_instance(), &rect.pp_rect())); |
+ instance.pp_instance(), &rect.pp_rect())); |
} |
return rv; |
} |
// static |
-int32_t Flash::InvokePrinting(Instance* instance) { |
+int32_t Flash::InvokePrinting(const InstanceHandle& instance) { |
int32_t rv = PP_ERROR_NOTSUPPORTED; |
if (has_interface<PPB_Flash>()) |
- rv = get_interface<PPB_Flash>()->InvokePrinting(instance->pp_instance()); |
+ rv = get_interface<PPB_Flash>()->InvokePrinting(instance.pp_instance()); |
return rv; |
} |
// static |
-void Flash::UpdateActivity(Instance* instance) { |
+void Flash::UpdateActivity(const InstanceHandle& instance) { |
if (has_interface<PPB_Flash>()) |
- get_interface<PPB_Flash>()->UpdateActivity(instance->pp_instance()); |
+ get_interface<PPB_Flash>()->UpdateActivity(instance.pp_instance()); |
} |
} // namespace flash |