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

Unified Diff: components/nacl/renderer/ppb_nacl_private_impl.cc

Issue 212103002: Check NaCl debug mask (not just flag) before choosing PNaCl debug URL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 9 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 | « components/nacl/common/nacl_host_messages.h ('k') | ppapi/api/private/ppb_nacl_private.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/nacl/renderer/ppb_nacl_private_impl.cc
diff --git a/components/nacl/renderer/ppb_nacl_private_impl.cc b/components/nacl/renderer/ppb_nacl_private_impl.cc
index 3b89d184587e879d7b010da8234af9f46fec9c13..116213340a7acd86d2da52e72fe05fd250abeb6b 100644
--- a/components/nacl/renderer/ppb_nacl_private_impl.cc
+++ b/components/nacl/renderer/ppb_nacl_private_impl.cc
@@ -467,9 +467,18 @@ void InstanceDestroyed(PP_Instance instance) {
map.erase(instance);
}
-PP_Bool NaClDebugStubEnabled() {
- return PP_FromBool(CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableNaClDebug));
+PP_Bool NaClDebugEnabledForURL(const char* alleged_nmf_url) {
+ if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableNaClDebug))
+ return PP_FALSE;
+ bool should_debug;
+ IPC::Sender* sender = content::RenderThread::Get();
+ DCHECK(sender);
+ if(!sender->Send(new NaClHostMsg_NaClDebugEnabledForURL(
+ GURL(alleged_nmf_url),
+ &should_debug))) {
+ return PP_FALSE;
+ }
+ return PP_FromBool(should_debug);
}
const char* GetSandboxArch() {
@@ -560,7 +569,7 @@ const PPB_NaCl_Private nacl_interface = {
&ReportLoadError,
&InstanceCreated,
&InstanceDestroyed,
- &NaClDebugStubEnabled,
+ &NaClDebugEnabledForURL,
&GetSandboxArch,
&GetUrlScheme,
&LogToConsole,
« no previous file with comments | « components/nacl/common/nacl_host_messages.h ('k') | ppapi/api/private/ppb_nacl_private.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698