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

Unified Diff: ppapi/cpp/private/flash.cc

Issue 10681006: Add ppapi interface for setting crash data (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 6 months 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/cpp/private/flash.h ('k') | ppapi/proxy/plugin_proxy_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/cpp/private/flash.cc
diff --git a/ppapi/cpp/private/flash.cc b/ppapi/cpp/private/flash.cc
index 6af7c3d05da91ce07ce4c5bb317799f103b2b209..2c914316e16d1a0fb1aeab2d1f882b965f4fe7c3 100644
--- a/ppapi/cpp/private/flash.cc
+++ b/ppapi/cpp/private/flash.cc
@@ -24,6 +24,10 @@ namespace pp {
namespace {
+template <> const char* interface_name<PPB_Flash_12_5>() {
+ return PPB_FLASH_INTERFACE_12_5;
+}
+
template <> const char* interface_name<PPB_Flash_12_4>() {
return PPB_FLASH_INTERFACE_12_4;
}
@@ -61,7 +65,10 @@ PPB_Flash flash_12_combined_interface;
void InitializeCombinedInterface() {
if (initialized_combined_interface)
return;
- if (has_interface<PPB_Flash_12_4>()) {
+ if (has_interface<PPB_Flash_12_5>()) {
+ memcpy(&flash_12_combined_interface, get_interface<PPB_Flash_12_5>(),
+ sizeof(PPB_Flash_12_5));
+ } else if (has_interface<PPB_Flash_12_4>()) {
memcpy(&flash_12_combined_interface, get_interface<PPB_Flash_12_4>(),
sizeof(PPB_Flash_12_4));
} else if (has_interface<PPB_Flash_12_3>()) {
@@ -86,7 +93,8 @@ namespace flash {
// static
bool Flash::IsAvailable() {
- return has_interface<PPB_Flash_12_4>() ||
+ return has_interface<PPB_Flash_12_5>() ||
+ has_interface<PPB_Flash_12_4>() ||
has_interface<PPB_Flash_12_3>() ||
has_interface<PPB_Flash_12_2>() ||
has_interface<PPB_Flash_12_1>() ||
@@ -249,6 +257,19 @@ Var Flash::GetSetting(const InstanceHandle& instance, PP_FlashSetting setting) {
}
// static
+bool Flash::SetCrashData(const InstanceHandle& instance,
+ PP_FlashCrashKey key,
+ const pp::Var& value) {
+ InitializeCombinedInterface();
+ if (flash_12_combined_interface.SetCrashData) {
+ return PP_ToBool(
+ flash_12_combined_interface.SetCrashData(instance.pp_instance(),
+ key, value.pp_var()));
+ }
+ return false;
+}
+
+// static
bool Flash::InvokePrinting(const InstanceHandle& instance) {
if (has_interface<PPB_Flash_Print_1_0>()) {
get_interface<PPB_Flash_Print_1_0>()->InvokePrinting(
« no previous file with comments | « ppapi/cpp/private/flash.h ('k') | ppapi/proxy/plugin_proxy_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698