Commit 9e7e4122 authored by cdn@chromium.org's avatar cdn@chromium.org

Add interface to set the sub resource crash key from Flash

BUG=N/A
TEST=N/A

Review URL: https://chromiumcodereview.appspot.com/14311004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195188 0039d316-1c4b-4281-b951-d872f2087c98
parent cd5837c3
......@@ -103,7 +103,12 @@ enum PP_FlashCrashKey {
/**
* Specifies the document URL which contains the flash instance.
*/
PP_FLASHCRASHKEY_URL = 1
PP_FLASHCRASHKEY_URL = 1,
/**
* Specifies the URL of the current swf.
*/
PP_FLASHCRASHKEY_RESOURCE_URL = 2
};
/**
......
......@@ -3,7 +3,7 @@
* found in the LICENSE file.
*/
/* From private/ppb_flash.idl modified Thu Mar 28 10:30:53 2013. */
/* From private/ppb_flash.idl modified Thu Apr 18 15:06:12 2013. */
#ifndef PPAPI_C_PRIVATE_PPB_FLASH_H_
#define PPAPI_C_PRIVATE_PPB_FLASH_H_
......@@ -118,7 +118,11 @@ typedef enum {
/**
* Specifies the document URL which contains the flash instance.
*/
PP_FLASHCRASHKEY_URL = 1
PP_FLASHCRASHKEY_URL = 1,
/**
* Specifies the URL of the current swf.
*/
PP_FLASHCRASHKEY_RESOURCE_URL = 2
} PP_FlashCrashKey;
PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_FlashCrashKey, 4);
/**
......
......@@ -7,6 +7,7 @@
#include <cmath>
#include "base/containers/mru_cache.h"
#include "base/debug/crash_logging.h"
#include "base/lazy_instance.h"
#include "base/time.h"
#include "ppapi/c/pp_errors.h"
......@@ -83,14 +84,18 @@ void FlashResource::UpdateActivity(PP_Instance instance) {
PP_Bool FlashResource::SetCrashData(PP_Instance instance,
PP_FlashCrashKey key,
PP_Var value) {
StringVar* url_string_var(StringVar::FromPPVar(value));
if (!url_string_var)
return PP_FALSE;
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;
}
case PP_FLASHCRASHKEY_RESOURCE_URL: {
base::debug::SetCrashKeyValue("subresource_url", url_string_var->value());
return PP_TRUE;
}
}
return PP_FALSE;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment