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

Side by Side 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, 8 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 unified diff | Download patch | Annotate | Revision Log
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/nacl/renderer/ppb_nacl_private_impl.h" 5 #include "components/nacl/renderer/ppb_nacl_private_impl.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/containers/scoped_ptr_hash_map.h" 8 #include "base/containers/scoped_ptr_hash_map.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 DLOG_IF(ERROR, map.count(instance) != 0) << "Instance count should be 0"; 460 DLOG_IF(ERROR, map.count(instance) != 0) << "Instance count should be 0";
461 map.add(instance, new_load_manager.Pass()); 461 map.add(instance, new_load_manager.Pass());
462 } 462 }
463 463
464 void InstanceDestroyed(PP_Instance instance) { 464 void InstanceDestroyed(PP_Instance instance) {
465 NexeLoadManagerMap& map = g_load_manager_map.Get(); 465 NexeLoadManagerMap& map = g_load_manager_map.Get();
466 DLOG_IF(ERROR, map.count(instance) == 0) << "Could not find instance ID"; 466 DLOG_IF(ERROR, map.count(instance) == 0) << "Could not find instance ID";
467 map.erase(instance); 467 map.erase(instance);
468 } 468 }
469 469
470 PP_Bool NaClDebugStubEnabled() { 470 PP_Bool NaClDebugEnabledForURL(const char* alleged_nmf_url) {
471 return PP_FromBool(CommandLine::ForCurrentProcess()->HasSwitch( 471 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableNaClDebug))
472 switches::kEnableNaClDebug)); 472 return PP_FALSE;
473 bool should_debug;
474 IPC::Sender* sender = content::RenderThread::Get();
475 DCHECK(sender);
476 if(!sender->Send(new NaClHostMsg_NaClDebugEnabledForURL(
477 GURL(alleged_nmf_url),
478 &should_debug))) {
479 return PP_FALSE;
480 }
481 return PP_FromBool(should_debug);
473 } 482 }
474 483
475 const char* GetSandboxArch() { 484 const char* GetSandboxArch() {
476 return nacl::GetSandboxArch(); 485 return nacl::GetSandboxArch();
477 } 486 }
478 487
479 PP_UrlSchemeType GetUrlScheme(PP_Var url) { 488 PP_UrlSchemeType GetUrlScheme(PP_Var url) {
480 scoped_refptr<ppapi::StringVar> url_string = ppapi::StringVar::FromPPVar(url); 489 scoped_refptr<ppapi::StringVar> url_string = ppapi::StringVar::FromPPVar(url);
481 if (!url_string) 490 if (!url_string)
482 return PP_SCHEME_OTHER; 491 return PP_SCHEME_OTHER;
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 &GetNumberOfProcessors, 562 &GetNumberOfProcessors,
554 &IsNonSFIModeEnabled, 563 &IsNonSFIModeEnabled,
555 &GetNexeFd, 564 &GetNexeFd,
556 &ReportTranslationFinished, 565 &ReportTranslationFinished,
557 &OpenNaClExecutable, 566 &OpenNaClExecutable,
558 &DispatchEvent, 567 &DispatchEvent,
559 &SetReadOnlyProperty, 568 &SetReadOnlyProperty,
560 &ReportLoadError, 569 &ReportLoadError,
561 &InstanceCreated, 570 &InstanceCreated,
562 &InstanceDestroyed, 571 &InstanceDestroyed,
563 &NaClDebugStubEnabled, 572 &NaClDebugEnabledForURL,
564 &GetSandboxArch, 573 &GetSandboxArch,
565 &GetUrlScheme, 574 &GetUrlScheme,
566 &LogToConsole, 575 &LogToConsole,
567 &GetNexeErrorReported, 576 &GetNexeErrorReported,
568 &SetNexeErrorReported, 577 &SetNexeErrorReported,
569 &GetNaClReadyState, 578 &GetNaClReadyState,
570 &SetNaClReadyState, 579 &SetNaClReadyState,
571 &GetIsInstalled, 580 &GetIsInstalled,
572 &SetIsInstalled 581 &SetIsInstalled
573 }; 582 };
574 583
575 } // namespace 584 } // namespace
576 585
577 namespace nacl { 586 namespace nacl {
578 587
579 const PPB_NaCl_Private* GetNaClPrivateInterface() { 588 const PPB_NaCl_Private* GetNaClPrivateInterface() {
580 return &nacl_interface; 589 return &nacl_interface;
581 } 590 }
582 591
583 } // namespace nacl 592 } // namespace nacl
OLDNEW
« 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