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

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
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 46b2823564d446797ee57f1b98bf58472c0dcf08..644737e85e00300312c3564e48dac94d8cf51eac 100644
--- a/components/nacl/renderer/ppb_nacl_private_impl.cc
+++ b/components/nacl/renderer/ppb_nacl_private_impl.cc
@@ -470,9 +470,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() {
@@ -518,7 +527,7 @@ const PPB_NaCl_Private nacl_interface = {
&ReportLoadError,
&InstanceCreated,
&InstanceDestroyed,
- &NaClDebugStubEnabled,
+ &NaClDebugEnabledForURL,
&GetSandboxArch,
&GetUrlScheme,
&LogToConsole

Powered by Google App Engine
This is Rietveld 408576698