diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-11 20:32:09 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-11 20:32:09 +0000 |
commit | 42cf7cbe78b0bb4f755f5b6e51e2ef229f3586ec (patch) | |
tree | 6d2187b16e3674b8b219cf164429b5ceb3e54010 | |
parent | e795ab6b7d7630292c1671ca615def7e5d3649eb (diff) | |
download | chromium_src-42cf7cbe78b0bb4f755f5b6e51e2ef229f3586ec.zip chromium_src-42cf7cbe78b0bb4f755f5b6e51e2ef229f3586ec.tar.gz chromium_src-42cf7cbe78b0bb4f755f5b6e51e2ef229f3586ec.tar.bz2 |
Add base:: qualification to some COmmandLine references in content.
TBR=sky
Review URL: https://codereview.chromium.org/456513002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288787 0039d316-1c4b-4281-b951-d872f2087c98
93 files changed, 335 insertions, 253 deletions
diff --git a/content/app/android/library_loader_hooks.cc b/content/app/android/library_loader_hooks.cc index 226a0a0..2b81f9a 100644 --- a/content/app/android/library_loader_hooks.cc +++ b/content/app/android/library_loader_hooks.cc @@ -72,7 +72,7 @@ bool EnsureJniRegistered(JNIEnv* env) { } bool LibraryLoaded(JNIEnv* env, jclass clazz) { - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(switches::kTraceStartup)) { base::debug::CategoryFilter category_filter( diff --git a/content/app/content_main_runner.cc b/content/app/content_main_runner.cc index ba132cb..e9aebce 100644 --- a/content/app/content_main_runner.cc +++ b/content/app/content_main_runner.cc @@ -190,7 +190,7 @@ void CommonSubprocessInit(const std::string& process_type) { // Only needed on Windows for creating stats tables. #if defined(OS_WIN) -static base::ProcessId GetBrowserPid(const CommandLine& command_line) { +static base::ProcessId GetBrowserPid(const base::CommandLine& command_line) { base::ProcessId browser_pid = base::GetCurrentProcId(); if (command_line.HasSwitch(switches::kProcessChannelID)) { std::string channel_name = @@ -205,7 +205,7 @@ static base::ProcessId GetBrowserPid(const CommandLine& command_line) { } #endif -static void InitializeStatsTable(const CommandLine& command_line) { +static void InitializeStatsTable(const base::CommandLine& command_line) { // Initialize the Stats Counters table. With this initialized, // the StatsViewer can be utilized to read counters outside of // Chrome. These lines can be commented out to effectively turn @@ -258,7 +258,7 @@ class ContentClientInitializer { content_client->plugin_ = &g_empty_content_plugin_client.Get(); // Single process not supported in split dll mode. } else if (process_type == switches::kRendererProcess || - CommandLine::ForCurrentProcess()->HasSwitch( + base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kSingleProcess)) { if (delegate) content_client->renderer_ = delegate->CreateContentRendererClient(); @@ -267,7 +267,7 @@ class ContentClientInitializer { } if (process_type == switches::kUtilityProcess || - CommandLine::ForCurrentProcess()->HasSwitch( + base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kSingleProcess)) { if (delegate) content_client->utility_ = delegate->CreateContentUtilityClient(); @@ -320,7 +320,8 @@ int RunZygote(const MainFunctionParams& main_function_params, // Zygote::HandleForkRequest may have reallocated the command // line so update it here with the new version. - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); std::string process_type = command_line.GetSwitchValueASCII(switches::kProcessType); ContentClientInitializer::Set(process_type, delegate); @@ -356,7 +357,7 @@ static void RegisterMainThreadFactories() { GpuProcessHost::RegisterGpuMainThreadFactory( CreateInProcessGpuThread); #else - CommandLine& command_line = *CommandLine::ForCurrentProcess(); + base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess(); if (command_line.HasSwitch(switches::kSingleProcess)) { LOG(FATAL) << "--single-process is not supported in chrome multiple dll browser."; @@ -589,7 +590,7 @@ class ContentMainRunnerImpl : public ContentMainRunner { argv = params.argv; #endif - CommandLine::Init(argc, argv); + base::CommandLine::Init(argc, argv); if (!delegate_ || delegate_->ShouldEnableTerminationOnHeapCorruption()) base::EnableTerminationOnHeapCorruption(); @@ -606,7 +607,8 @@ class ContentMainRunnerImpl : public ContentMainRunner { completed_basic_startup_ = true; - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); std::string process_type = command_line.GetSwitchValueASCII(switches::kProcessType); @@ -745,9 +747,10 @@ class ContentMainRunnerImpl : public ContentMainRunner { virtual int Run() OVERRIDE { DCHECK(is_initialized_); DCHECK(!is_shutdown_); - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); std::string process_type = - command_line.GetSwitchValueASCII(switches::kProcessType); + command_line.GetSwitchValueASCII(switches::kProcessType); MainFunctionParams main_params(command_line); main_params.ui_task = ui_task_; @@ -769,7 +772,8 @@ class ContentMainRunnerImpl : public ContentMainRunner { DCHECK(!is_shutdown_); if (completed_basic_startup_ && delegate_) { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); std::string process_type = command_line.GetSwitchValueASCII(switches::kProcessType); diff --git a/content/app/startup_helper_win.cc b/content/app/startup_helper_win.cc index 17fd323..ab85a43 100644 --- a/content/app/startup_helper_win.cc +++ b/content/app/startup_helper_win.cc @@ -56,7 +56,7 @@ void RegisterInvalidParamHandler() { _set_new_mode(1); } -void SetupCRT(const CommandLine& command_line) { +void SetupCRT(const base::CommandLine& command_line) { #if defined(_CRTDBG_MAP_ALLOC) _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR); _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE); diff --git a/content/browser/accessibility/browser_accessibility_state_impl.cc b/content/browser/accessibility/browser_accessibility_state_impl.cc index 7fdab1a..1e3063e 100644 --- a/content/browser/accessibility/browser_accessibility_state_impl.cc +++ b/content/browser/accessibility/browser_accessibility_state_impl.cc @@ -62,7 +62,7 @@ BrowserAccessibilityStateImpl::~BrowserAccessibilityStateImpl() { } void BrowserAccessibilityStateImpl::OnScreenReaderDetected() { - if (CommandLine::ForCurrentProcess()->HasSwitch( + if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kDisableRendererAccessibility)) { return; } @@ -83,13 +83,13 @@ void BrowserAccessibilityStateImpl::ResetAccessibilityModeValue() { // On Windows 8, always enable accessibility for editable text controls // so we can show the virtual keyboard when one is enabled. if (base::win::GetVersion() >= base::win::VERSION_WIN8 && - !CommandLine::ForCurrentProcess()->HasSwitch( + !base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kDisableRendererAccessibility)) { accessibility_mode_ = AccessibilityModeEditableTextOnly; } #endif // defined(OS_WIN) - if (CommandLine::ForCurrentProcess()->HasSwitch( + if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kForceRendererAccessibility)) { accessibility_mode_ = AccessibilityModeComplete; } @@ -128,7 +128,7 @@ void BrowserAccessibilityStateImpl::UpdateHistograms() { UMA_HISTOGRAM_BOOLEAN("Accessibility.InvertedColors", gfx::IsInvertedColorScheme()); UMA_HISTOGRAM_BOOLEAN("Accessibility.ManuallyEnabled", - CommandLine::ForCurrentProcess()->HasSwitch( + base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kForceRendererAccessibility)); } @@ -139,7 +139,7 @@ void BrowserAccessibilityStateImpl::UpdatePlatformSpecificHistograms() { void BrowserAccessibilityStateImpl::AddAccessibilityMode( AccessibilityMode mode) { - if (CommandLine::ForCurrentProcess()->HasSwitch( + if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kDisableRendererAccessibility)) { return; } @@ -152,7 +152,7 @@ void BrowserAccessibilityStateImpl::AddAccessibilityMode( void BrowserAccessibilityStateImpl::RemoveAccessibilityMode( AccessibilityMode mode) { - if (CommandLine::ForCurrentProcess()->HasSwitch( + if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kForceRendererAccessibility) && mode == AccessibilityModeComplete) { return; diff --git a/content/browser/accessibility/dump_accessibility_tree_browsertest.cc b/content/browser/accessibility/dump_accessibility_tree_browsertest.cc index 4b461be..4939004 100644 --- a/content/browser/accessibility/dump_accessibility_tree_browsertest.cc +++ b/content/browser/accessibility/dump_accessibility_tree_browsertest.cc @@ -146,10 +146,10 @@ class DumpAccessibilityTreeTest : public ContentBrowserTest { } } - virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { + virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE { ContentBrowserTest::SetUpCommandLine(command_line); // Enable <dialog>, which is used in some tests. - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableExperimentalWebPlatformFeatures); } diff --git a/content/browser/android/child_process_launcher_android.cc b/content/browser/android/child_process_launcher_android.cc index baac2b0..0e42fc4 100644 --- a/content/browser/android/child_process_launcher_android.cc +++ b/content/browser/android/child_process_launcher_android.cc @@ -100,7 +100,7 @@ static void OnChildProcessStarted(JNIEnv*, } void StartChildProcess( - const CommandLine::StringVector& argv, + const base::CommandLine::StringVector& argv, int child_process_id, const std::vector<content::FileDescriptorInfo>& files_to_register, const StartChildProcessCallback& callback) { @@ -211,7 +211,8 @@ void UnregisterChildProcessSurfaceTexture(int surface_texture_id, } jboolean IsSingleProcess(JNIEnv* env, jclass clazz) { - return CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess); + return base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kSingleProcess); } bool RegisterChildProcessLauncher(JNIEnv* env) { diff --git a/content/browser/android/content_startup_flags.cc b/content/browser/android/content_startup_flags.cc index d315371..ca3141f 100644 --- a/content/browser/android/content_startup_flags.cc +++ b/content/browser/android/content_startup_flags.cc @@ -26,7 +26,8 @@ void SetContentCommandLineFlags(bool single_process, return; already_initialized = true; - CommandLine* parsed_command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* parsed_command_line = + base::CommandLine::ForCurrentProcess(); int command_line_renderer_limit = -1; if (parsed_command_line->HasSwitch(switches::kRendererProcessLimit)) { diff --git a/content/browser/android/content_video_view.cc b/content/browser/android/content_video_view.cc index 5407032..9e0a830 100644 --- a/content/browser/android/content_video_view.cc +++ b/content/browser/android/content_video_view.cc @@ -211,7 +211,7 @@ gfx::NativeView ContentVideoView::GetNativeView() { JavaObjectWeakGlobalRef ContentVideoView::CreateJavaObject() { ContentViewCoreImpl* content_view_core = manager_->GetContentViewCore(); JNIEnv* env = AttachCurrentThread(); - bool legacyMode = CommandLine::ForCurrentProcess()->HasSwitch( + bool legacyMode = base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kDisableOverlayFullscreenVideoSubtitle); return JavaObjectWeakGlobalRef( env, @@ -224,7 +224,7 @@ JavaObjectWeakGlobalRef ContentVideoView::CreateJavaObject() { } void ContentVideoView::CreatePowerSaveBlocker() { - if (!CommandLine::ForCurrentProcess()->HasSwitch( + if (!base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kDisableOverlayFullscreenVideoSubtitle)) { return; } diff --git a/content/browser/appcache/appcache_database.cc b/content/browser/appcache/appcache_database.cc index 546c1dc..0783efa 100644 --- a/content/browser/appcache/appcache_database.cc +++ b/content/browser/appcache/appcache_database.cc @@ -177,7 +177,8 @@ bool CreateIndex(sql::Connection* db, const IndexInfo& info) { } std::string GetActiveExperimentFlags() { - if (CommandLine::ForCurrentProcess()->HasSwitch(kEnableExecutableHandlers)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + kEnableExecutableHandlers)) return std::string("executableHandlersEnabled"); return std::string(); } @@ -712,7 +713,7 @@ bool AppCacheDatabase::InsertNamespace( int type_with_executable_bit = record->namespace_.type; if (record->namespace_.is_executable) { type_with_executable_bit |= 0x8000000; - DCHECK(CommandLine::ForCurrentProcess()->HasSwitch( + DCHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( kEnableExecutableHandlers)); } @@ -976,7 +977,8 @@ void AppCacheDatabase::ReadNamespaceRecord( record->namespace_.is_executable = (type_with_executable_bit & 0x80000000) != 0; DCHECK(!record->namespace_.is_executable || - CommandLine::ForCurrentProcess()->HasSwitch(kEnableExecutableHandlers)); + base::CommandLine::ForCurrentProcess()->HasSwitch( + kEnableExecutableHandlers)); } void AppCacheDatabase::ReadOnlineWhiteListRecord( diff --git a/content/browser/appcache/manifest_parser.cc b/content/browser/appcache/manifest_parser.cc index fb63f22..2ca3ce8 100644 --- a/content/browser/appcache/manifest_parser.cc +++ b/content/browser/appcache/manifest_parser.cc @@ -272,7 +272,7 @@ bool ParseManifest(const GURL& manifest_url, const char* data, int length, if (type == L"return") { verb = RETURN; } else if (type == L"execute" && - CommandLine::ForCurrentProcess()->HasSwitch( + base::CommandLine::ForCurrentProcess()->HasSwitch( kEnableExecutableHandlers)) { verb = EXECUTE; } diff --git a/content/browser/browser_child_process_host_impl.cc b/content/browser/browser_child_process_host_impl.cc index 7589e5f..de94d33 100644 --- a/content/browser/browser_child_process_host_impl.cc +++ b/content/browser/browser_child_process_host_impl.cc @@ -132,13 +132,14 @@ void BrowserChildProcessHostImpl::TerminateAll() { void BrowserChildProcessHostImpl::Launch( SandboxedProcessLauncherDelegate* delegate, - CommandLine* cmd_line) { + base::CommandLine* cmd_line) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); GetContentClient()->browser()->AppendExtraCommandLineSwitches( cmd_line, data_.id); - const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& browser_command_line = + *base::CommandLine::ForCurrentProcess(); static const char* kForwardSwitches[] = { switches::kDisableLogging, switches::kEnableLogging, diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc index ce7e224..c5c5074 100644 --- a/content/browser/browser_main_loop.cc +++ b/content/browser/browser_main_loop.cc @@ -135,7 +135,7 @@ namespace content { namespace { #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) -void SetupSandbox(const CommandLine& parsed_command_line) { +void SetupSandbox(const base::CommandLine& parsed_command_line) { TRACE_EVENT0("startup", "SetupSandbox"); base::FilePath sandbox_binary; @@ -1135,7 +1135,8 @@ base::FilePath BrowserMainLoop::GetStartupTraceFileName( return trace_file; } -void BrowserMainLoop::InitStartupTracing(const CommandLine& command_line) { +void BrowserMainLoop::InitStartupTracing( + const base::CommandLine& command_line) { DCHECK(is_tracing_startup_); startup_trace_file_ = GetStartupTraceFileName(parsed_command_line_); diff --git a/content/browser/browser_main_runner.cc b/content/browser/browser_main_runner.cc index 8701c07..a06f18a 100644 --- a/content/browser/browser_main_runner.cc +++ b/content/browser/browser_main_runner.cc @@ -146,7 +146,8 @@ class BrowserMainRunnerImpl : public BrowserMainRunner { // The shutdown tracing got enabled in AttemptUserExit earlier, but someone // needs to write the result to disc. For that a dumper needs to get created // which will dump the traces to disc when it gets destroyed. - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); scoped_ptr<BrowserShutdownProfileDumper> shutdown_profiler; if (command_line.HasSwitch(switches::kTraceShutdown)) { shutdown_profiler.reset(new BrowserShutdownProfileDumper( diff --git a/content/browser/browser_shutdown_profile_dumper.cc b/content/browser/browser_shutdown_profile_dumper.cc index a8b9e952..1cb5694 100644 --- a/content/browser/browser_shutdown_profile_dumper.cc +++ b/content/browser/browser_shutdown_profile_dumper.cc @@ -75,7 +75,8 @@ void BrowserShutdownProfileDumper::EndTraceAndFlush( // static base::FilePath BrowserShutdownProfileDumper::GetShutdownProfileFileName() { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); base::FilePath trace_file = command_line.GetSwitchValuePath(switches::kTraceShutdownFile); diff --git a/content/browser/child_process_launcher.cc b/content/browser/child_process_launcher.cc index 5e65042..152cd5c 100644 --- a/content/browser/child_process_launcher.cc +++ b/content/browser/child_process_launcher.cc @@ -76,7 +76,7 @@ class ChildProcessLauncher::Context void Launch( SandboxedProcessLauncherDelegate* delegate, - CommandLine* cmd_line, + base::CommandLine* cmd_line, int child_process_id, Client* client) { client_ = client; @@ -172,7 +172,7 @@ class ChildProcessLauncher::Context BrowserThread::ID client_thread_id, int child_process_id, SandboxedProcessLauncherDelegate* delegate, - CommandLine* cmd_line) { + base::CommandLine* cmd_line) { scoped_ptr<SandboxedProcessLauncherDelegate> delegate_deleter(delegate); #if defined(OS_WIN) bool launch_elevated = delegate->ShouldLaunchElevated(); @@ -186,7 +186,7 @@ class ChildProcessLauncher::Context base::EnvironmentMap env = delegate->GetEnvironment(); int ipcfd = delegate->GetIpcFd(); #endif - scoped_ptr<CommandLine> cmd_line_deleter(cmd_line); + scoped_ptr<base::CommandLine> cmd_line_deleter(cmd_line); base::TimeTicks begin_launch_time = base::TimeTicks::Now(); #if defined(OS_WIN) @@ -436,7 +436,7 @@ class ChildProcessLauncher::Context ChildProcessLauncher::ChildProcessLauncher( SandboxedProcessLauncherDelegate* delegate, - CommandLine* cmd_line, + base::CommandLine* cmd_line, int child_process_id, Client* client) { context_ = new Context(); diff --git a/content/browser/child_process_security_policy_impl.cc b/content/browser/child_process_security_policy_impl.cc index 3f8e216..6ffe46f 100644 --- a/content/browser/child_process_security_policy_impl.cc +++ b/content/browser/child_process_security_policy_impl.cc @@ -241,7 +241,8 @@ class ChildProcessSecurityPolicyImpl::SecurityState { // compatibility with many sites. The similar --site-per-process flag only // blocks JavaScript access to cross-site cookies (in // CanAccessCookiesForOrigin). - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); if (!command_line.HasSwitch(switches::kEnableStrictSiteIsolation)) return true; @@ -585,7 +586,8 @@ bool ChildProcessSecurityPolicyImpl::CanLoadPage(int child_id, ResourceType resource_type) { // If --site-per-process flag is passed, we should enforce // stronger security restrictions on page navigation. - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSitePerProcess) && + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kSitePerProcess) && IsResourceTypeFrame(resource_type)) { // TODO(nasko): Do the proper check for site-per-process, once // out-of-process iframes is ready to go. diff --git a/content/browser/compositor/delegated_frame_host.cc b/content/browser/compositor/delegated_frame_host.cc index ae5f88d..4cfa531 100644 --- a/content/browser/compositor/delegated_frame_host.cc +++ b/content/browser/compositor/delegated_frame_host.cc @@ -738,7 +738,8 @@ void DelegatedFrameHost::CopyFromCompositingSurfaceHasResultForVideo( quality_switch = switches::kTabCaptureUpscaleQuality; std::string switch_value = - CommandLine::ForCurrentProcess()->GetSwitchValueASCII(quality_switch); + base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( + quality_switch); if (switch_value == "fast") quality = GLHelper::SCALER_QUALITY_FAST; else if (switch_value == "good") diff --git a/content/browser/compositor/gpu_process_transport_factory.cc b/content/browser/compositor/gpu_process_transport_factory.cc index 17b0548..ab5317b 100644 --- a/content/browser/compositor/gpu_process_transport_factory.cc +++ b/content/browser/compositor/gpu_process_transport_factory.cc @@ -72,7 +72,7 @@ GpuProcessTransportFactory::GpuProcessTransportFactory() output_surface_proxy_ = new BrowserCompositorOutputSurfaceProxy( &output_surface_map_); #if defined(OS_CHROMEOS) - bool use_thread = !CommandLine::ForCurrentProcess()->HasSwitch( + bool use_thread = !base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kUIDisableThreadedCompositing); #else bool use_thread = false; @@ -124,8 +124,9 @@ scoped_ptr<cc::OverlayCandidateValidator> CreateOverlayCandidateValidator( #if defined(USE_OZONE) ui::OverlayCandidatesOzone* overlay_candidates = ui::SurfaceFactoryOzone::GetInstance()->GetOverlayCandidates(widget); - if (overlay_candidates && CommandLine::ForCurrentProcess()->HasSwitch( - switches::kEnableHardwareOverlays)) { + if (overlay_candidates && + base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableHardwareOverlays)) { return scoped_ptr<cc::OverlayCandidateValidator>( new OverlayCandidateValidatorOzone(widget, overlay_candidates)); } diff --git a/content/browser/compositor/image_transport_factory.cc b/content/browser/compositor/image_transport_factory.cc index 7087d22..6f06a97 100644 --- a/content/browser/compositor/image_transport_factory.cc +++ b/content/browser/compositor/image_transport_factory.cc @@ -37,7 +37,8 @@ void ImageTransportFactory::InitializeForUnitTests( DCHECK(!g_initialized_for_unit_tests); g_initialized_for_unit_tests = true; - CommandLine* command_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* command_line = + base::CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(switches::kEnablePixelOutputInTests)) g_disable_null_draw = new gfx::DisableNullDrawGLBindings; diff --git a/content/browser/download/download_browsertest.cc b/content/browser/download/download_browsertest.cc index 8f35b63..a768c44 100644 --- a/content/browser/download/download_browsertest.cc +++ b/content/browser/download/download_browsertest.cc @@ -1070,7 +1070,7 @@ IN_PROC_BROWSER_TEST_F(DownloadContentTest, ShutdownAtRelease) { } IN_PROC_BROWSER_TEST_F(DownloadContentTest, ResumeInterruptedDownload) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableDownloadResumption); ASSERT_TRUE(test_server()->Start()); @@ -1137,7 +1137,7 @@ IN_PROC_BROWSER_TEST_F(DownloadContentTest, ResumeInterruptedDownload) { // Confirm restart fallback happens if a range request is bounced. IN_PROC_BROWSER_TEST_F(DownloadContentTest, ResumeInterruptedDownloadNoRange) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableDownloadResumption); ASSERT_TRUE(test_server()->Start()); @@ -1186,7 +1186,7 @@ IN_PROC_BROWSER_TEST_F(DownloadContentTest, ResumeInterruptedDownloadNoRange) { // Confirm restart fallback happens if a precondition is failed. IN_PROC_BROWSER_TEST_F(DownloadContentTest, ResumeInterruptedDownloadBadPrecondition) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableDownloadResumption); ASSERT_TRUE(test_server()->Start()); @@ -1238,7 +1238,7 @@ IN_PROC_BROWSER_TEST_F(DownloadContentTest, // Confirm we don't try to resume if we don't have a verifier. IN_PROC_BROWSER_TEST_F(DownloadContentTest, ResumeInterruptedDownloadNoVerifiers) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableDownloadResumption); ASSERT_TRUE(test_server()->Start()); @@ -1282,7 +1282,7 @@ IN_PROC_BROWSER_TEST_F(DownloadContentTest, } IN_PROC_BROWSER_TEST_F(DownloadContentTest, ResumeWithDeletedFile) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableDownloadResumption); ASSERT_TRUE(test_server()->Start()); @@ -1333,7 +1333,7 @@ IN_PROC_BROWSER_TEST_F(DownloadContentTest, ResumeWithDeletedFile) { } IN_PROC_BROWSER_TEST_F(DownloadContentTest, ResumeWithFileInitError) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableDownloadResumption); base::FilePath file(FILE_PATH_LITERAL("download-test.lib")); GURL url(URLRequestMockHTTPJob::GetMockUrl(file)); @@ -1384,7 +1384,7 @@ IN_PROC_BROWSER_TEST_F(DownloadContentTest, ResumeWithFileInitError) { IN_PROC_BROWSER_TEST_F(DownloadContentTest, ResumeWithFileIntermediateRenameError) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableDownloadResumption); base::FilePath file(FILE_PATH_LITERAL("download-test.lib")); GURL url(URLRequestMockHTTPJob::GetMockUrl(file)); @@ -1436,7 +1436,7 @@ IN_PROC_BROWSER_TEST_F(DownloadContentTest, } IN_PROC_BROWSER_TEST_F(DownloadContentTest, ResumeWithFileFinalRenameError) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableDownloadResumption); base::FilePath file(FILE_PATH_LITERAL("download-test.lib")); GURL url(URLRequestMockHTTPJob::GetMockUrl(file)); @@ -1489,7 +1489,7 @@ IN_PROC_BROWSER_TEST_F(DownloadContentTest, ResumeWithFileFinalRenameError) { // An interrupted download should remove the intermediate file when it is // cancelled. IN_PROC_BROWSER_TEST_F(DownloadContentTest, CancelInterruptedDownload) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableDownloadResumption); ASSERT_TRUE(test_server()->Start()); @@ -1519,7 +1519,7 @@ IN_PROC_BROWSER_TEST_F(DownloadContentTest, CancelInterruptedDownload) { } IN_PROC_BROWSER_TEST_F(DownloadContentTest, RemoveDownload) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableDownloadResumption); ASSERT_TRUE(test_server()->Start()); @@ -1574,7 +1574,7 @@ IN_PROC_BROWSER_TEST_F(DownloadContentTest, RemoveDownload) { IN_PROC_BROWSER_TEST_F(DownloadContentTest, RemoveResumingDownload) { SetupEnsureNoPendingDownloads(); - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableDownloadResumption); ASSERT_TRUE(test_server()->Start()); @@ -1621,7 +1621,7 @@ IN_PROC_BROWSER_TEST_F(DownloadContentTest, RemoveResumingDownload) { IN_PROC_BROWSER_TEST_F(DownloadContentTest, CancelResumingDownload) { SetupEnsureNoPendingDownloads(); - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableDownloadResumption); ASSERT_TRUE(test_server()->Start()); diff --git a/content/browser/download/download_item_impl.cc b/content/browser/download/download_item_impl.cc index 15e9512..733df1c 100644 --- a/content/browser/download/download_item_impl.cc +++ b/content/browser/download/download_item_impl.cc @@ -93,7 +93,7 @@ static void DownloadFileCancel(scoped_ptr<DownloadFile> download_file) { } bool IsDownloadResumptionEnabled() { - return CommandLine::ForCurrentProcess()->HasSwitch( + return base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableDownloadResumption); } @@ -1682,7 +1682,8 @@ void DownloadItemImpl::ResumeInterruptedDownload() { // If the flag for downloads resumption isn't enabled, ignore // this request. - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); if (!command_line.HasSwitch(switches::kEnableDownloadResumption)) return; diff --git a/content/browser/download/download_item_impl_unittest.cc b/content/browser/download/download_item_impl_unittest.cc index 1291ce1..86588ba 100644 --- a/content/browser/download/download_item_impl_unittest.cc +++ b/content/browser/download/download_item_impl_unittest.cc @@ -409,7 +409,7 @@ TEST_F(DownloadItemTest, NotificationAfterDestroyed) { } TEST_F(DownloadItemTest, ContinueAfterInterrupted) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableDownloadResumption); DownloadItemImpl* item = CreateDownloadItem(); @@ -437,7 +437,7 @@ TEST_F(DownloadItemTest, ContinueAfterInterrupted) { // Same as above, but with a non-continuable interrupt. TEST_F(DownloadItemTest, RestartAfterInterrupted) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableDownloadResumption); DownloadItemImpl* item = CreateDownloadItem(); @@ -461,7 +461,7 @@ TEST_F(DownloadItemTest, RestartAfterInterrupted) { // Check we do correct cleanup for RESUME_MODE_INVALID interrupts. TEST_F(DownloadItemTest, UnresumableInterrupt) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableDownloadResumption); DownloadItemImpl* item = CreateDownloadItem(); @@ -491,7 +491,7 @@ TEST_F(DownloadItemTest, UnresumableInterrupt) { } TEST_F(DownloadItemTest, LimitRestartsAfterInterrupted) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableDownloadResumption); DownloadItemImpl* item = CreateDownloadItem(); @@ -813,7 +813,7 @@ TEST_F(DownloadItemTest, InterruptedBeforeIntermediateRename_Restart) { // intermediate path should be retained when the download is interrupted after // the intermediate rename succeeds. TEST_F(DownloadItemTest, InterruptedBeforeIntermediateRename_Continue) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableDownloadResumption); DownloadItemImpl* item = CreateDownloadItem(); DownloadItemImplDelegate::DownloadTargetCallback callback; @@ -848,7 +848,7 @@ TEST_F(DownloadItemTest, InterruptedBeforeIntermediateRename_Continue) { // As above. If the intermediate rename fails, then the interrupt reason should // be set to the destination error and the intermediate path should be empty. TEST_F(DownloadItemTest, InterruptedBeforeIntermediateRename_Failed) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableDownloadResumption); DownloadItemImpl* item = CreateDownloadItem(); DownloadItemImplDelegate::DownloadTargetCallback callback; @@ -1248,7 +1248,7 @@ TEST_F(DownloadItemTest, StealDangerousDownload) { } TEST_F(DownloadItemTest, StealInterruptedDangerousDownload) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableDownloadResumption); base::FilePath returned_path; DownloadItemImpl* item = CreateDownloadItem(); @@ -1274,7 +1274,7 @@ TEST_F(DownloadItemTest, StealInterruptedDangerousDownload) { } TEST_F(DownloadItemTest, StealInterruptedNonResumableDangerousDownload) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableDownloadResumption); base::FilePath returned_path; DownloadItemImpl* item = CreateDownloadItem(); diff --git a/content/browser/frame_host/debug_urls.cc b/content/browser/frame_host/debug_urls.cc index b384098..091171a 100644 --- a/content/browser/frame_host/debug_urls.cc +++ b/content/browser/frame_host/debug_urls.cc @@ -110,9 +110,10 @@ bool HandleAsanDebugURL(const GURL& url) { bool HandleDebugURL(const GURL& url, PageTransition transition) { // Ensure that the user explicitly navigated to this URL, unless // kEnableGpuBenchmarking is enabled by Telemetry. - bool is_telemetry_navigation = CommandLine::ForCurrentProcess()->HasSwitch( - cc::switches::kEnableGpuBenchmarking) && - (transition & PAGE_TRANSITION_TYPED); + bool is_telemetry_navigation = + base::CommandLine::ForCurrentProcess()->HasSwitch( + cc::switches::kEnableGpuBenchmarking) && + (transition & PAGE_TRANSITION_TYPED); if (!(transition & PAGE_TRANSITION_FROM_ADDRESS_BAR) && !is_telemetry_navigation) diff --git a/content/browser/frame_host/navigation_entry_screenshot_manager.cc b/content/browser/frame_host/navigation_entry_screenshot_manager.cc index a7cae65..4c52117 100644 --- a/content/browser/frame_host/navigation_entry_screenshot_manager.cc +++ b/content/browser/frame_host/navigation_entry_screenshot_manager.cc @@ -83,7 +83,7 @@ NavigationEntryScreenshotManager::~NavigationEntryScreenshotManager() { } void NavigationEntryScreenshotManager::TakeScreenshot() { - static bool overscroll_enabled = CommandLine::ForCurrentProcess()-> + static bool overscroll_enabled = base::CommandLine::ForCurrentProcess()-> GetSwitchValueASCII(switches::kOverscrollHistoryNavigation) != "0"; if (!overscroll_enabled) return; diff --git a/content/browser/frame_host/navigator_impl.cc b/content/browser/frame_host/navigator_impl.cc index 020404f..0d6bf9d 100644 --- a/content/browser/frame_host/navigator_impl.cc +++ b/content/browser/frame_host/navigator_impl.cc @@ -127,7 +127,8 @@ void MakeNavigateParams(const NavigationEntryImpl& entry, } RenderFrameHostManager* GetRenderManager(RenderFrameHostImpl* rfh) { - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSitePerProcess)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kSitePerProcess)) return rfh->frame_tree_node()->render_manager(); return rfh->frame_tree_node()->frame_tree()->root()->render_manager(); @@ -418,8 +419,8 @@ void NavigatorImpl::DidNavigate( const FrameHostMsg_DidCommitProvisionalLoad_Params& input_params) { FrameHostMsg_DidCommitProvisionalLoad_Params params(input_params); FrameTree* frame_tree = render_frame_host->frame_tree_node()->frame_tree(); - bool use_site_per_process = - CommandLine::ForCurrentProcess()->HasSwitch(switches::kSitePerProcess); + bool use_site_per_process = base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kSitePerProcess); if (use_site_per_process) { // TODO(creis): Until we mirror the frame tree in the subframe's process, @@ -604,7 +605,8 @@ void NavigatorImpl::RequestTransferURL( } int64 frame_tree_node_id = -1; - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSitePerProcess)) { + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kSitePerProcess)) { frame_tree_node_id = render_frame_host->frame_tree_node()->frame_tree_node_id(); } diff --git a/content/browser/gpu/compositor_util.cc b/content/browser/gpu/compositor_util.cc index 844f63d..028de13 100644 --- a/content/browser/gpu/compositor_util.cc +++ b/content/browser/gpu/compositor_util.cc @@ -48,7 +48,8 @@ struct GpuFeatureInfo { }; const GpuFeatureInfo GetGpuFeatureInfo(size_t index, bool* eof) { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); GpuDataManagerImpl* manager = GpuDataManagerImpl::GetInstance(); const GpuFeatureInfo kGpuFeatureInfo[] = { @@ -163,7 +164,8 @@ const GpuFeatureInfo GetGpuFeatureInfo(size_t index, bool* eof) { } // namespace bool IsPinchVirtualViewportEnabled() { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); // Command line switches take precedence over platform default. if (command_line.HasSwitch(cc::switches::kDisablePinchVirtualViewport)) @@ -179,7 +181,8 @@ bool IsPinchVirtualViewportEnabled() { } bool IsDelegatedRendererEnabled() { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); bool enabled = false; #if defined(USE_AURA) || defined(OS_MACOSX) @@ -194,7 +197,8 @@ bool IsDelegatedRendererEnabled() { } bool IsImplSidePaintingEnabled() { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); if (command_line.HasSwitch(switches::kDisableImplSidePainting)) return false; @@ -212,7 +216,8 @@ bool IsImplSidePaintingEnabled() { } bool IsGpuRasterizationEnabled() { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); if (!IsImplSidePaintingEnabled()) return false; @@ -230,7 +235,8 @@ bool IsGpuRasterizationEnabled() { } bool IsForceGpuRasterizationEnabled() { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); if (!IsImplSidePaintingEnabled()) return false; diff --git a/content/browser/gpu/gpu_data_manager_impl_private.cc b/content/browser/gpu/gpu_data_manager_impl_private.cc index f4c6c9c..bbf7231 100644 --- a/content/browser/gpu/gpu_data_manager_impl_private.cc +++ b/content/browser/gpu/gpu_data_manager_impl_private.cc @@ -113,7 +113,8 @@ void UpdateStats(const gpu::GPUInfo& gpu_info, return; } - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); bool disabled = false; // Use entry 0 to capture the total number of times that data @@ -265,7 +266,7 @@ void GpuDataManagerImplPrivate::InitializeForTesting( bool GpuDataManagerImplPrivate::IsFeatureBlacklisted(int feature) const { #if defined(OS_CHROMEOS) if (feature == gpu::GPU_FEATURE_TYPE_PANEL_FITTING && - CommandLine::ForCurrentProcess()->HasSwitch( + base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kDisablePanelFitting)) { return true; } @@ -323,7 +324,7 @@ bool GpuDataManagerImplPrivate::GpuAccessAllowed( if (card_blacklisted_) { if (reason) { *reason = "GPU access is disabled "; - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(switches::kDisableGpu)) *reason += "through commandline switch --disable-gpu."; else @@ -477,7 +478,8 @@ void GpuDataManagerImplPrivate::Initialize() { return; } - const CommandLine* command_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* command_line = + base::CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(switches::kSkipGpuDataLoading)) return; @@ -535,7 +537,7 @@ void GpuDataManagerImplPrivate::UpdateGpuInfoHelper() { gpu::GpuControlList::kOsAny, std::string(), gpu_info_); } gpu::GpuDriverBugList::AppendWorkaroundsFromCommandLine( - &gpu_driver_bugs_, *CommandLine::ForCurrentProcess()); + &gpu_driver_bugs_, *base::CommandLine::ForCurrentProcess()); // We have to update GpuFeatureType before notify all the observers. NotifyGpuInfoUpdate(); @@ -561,7 +563,7 @@ void GpuDataManagerImplPrivate::UpdateVideoMemoryUsageStats( } void GpuDataManagerImplPrivate::AppendRendererCommandLine( - CommandLine* command_line) const { + base::CommandLine* command_line) const { DCHECK(command_line); if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE) && @@ -580,13 +582,14 @@ void GpuDataManagerImplPrivate::AppendRendererCommandLine( } void GpuDataManagerImplPrivate::AppendGpuCommandLine( - CommandLine* command_line) const { + base::CommandLine* command_line) const { DCHECK(command_line); std::string use_gl = - CommandLine::ForCurrentProcess()->GetSwitchValueASCII(switches::kUseGL); + base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( + switches::kUseGL); base::FilePath swiftshader_path = - CommandLine::ForCurrentProcess()->GetSwitchValuePath( + base::CommandLine::ForCurrentProcess()->GetSwitchValuePath( switches::kSwiftShaderPath); if (gpu_driver_bugs_.find(gpu::DISABLE_D3D11) != gpu_driver_bugs_.end()) command_line->AppendSwitch(switches::kDisableD3D11); @@ -645,7 +648,7 @@ void GpuDataManagerImplPrivate::AppendGpuCommandLine( } void GpuDataManagerImplPrivate::AppendPluginCommandLine( - CommandLine* command_line) const { + base::CommandLine* command_line) const { DCHECK(command_line); #if defined(OS_MACOSX) @@ -692,7 +695,7 @@ void GpuDataManagerImplPrivate::UpdateRendererWebPrefs( #endif if (!IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE) && - !CommandLine::ForCurrentProcess()->HasSwitch( + !base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kDisableAcceleratedVideoDecode)) { prefs->pepper_accelerated_video_decode_enabled = true; } @@ -871,7 +874,8 @@ GpuDataManagerImplPrivate::GpuDataManagerImplPrivate( gpu_process_accessible_(true), finalized_(false) { DCHECK(owner_); - CommandLine* command_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* command_line = + base::CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(switches::kDisableGpu)) DisableHardwareAcceleration(); @@ -897,7 +901,7 @@ void GpuDataManagerImplPrivate::InitializeImpl( const std::string& gpu_driver_bug_list_json, const gpu::GPUInfo& gpu_info) { const bool log_gpu_control_list_decisions = - CommandLine::ForCurrentProcess()->HasSwitch( + base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kLogGpuControlListDecisions); if (!gpu_blacklist_json.empty()) { @@ -962,7 +966,7 @@ void GpuDataManagerImplPrivate::EnableSwiftShaderIfNecessary() { if (!GpuAccessAllowed(NULL) || blacklisted_features_.count(gpu::GPU_FEATURE_TYPE_WEBGL)) { if (!swiftshader_path_.empty() && - !CommandLine::ForCurrentProcess()->HasSwitch( + !base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kDisableSoftwareRasterizer)) use_swiftshader_ = true; } diff --git a/content/browser/gpu/gpu_data_manager_impl_private_unittest.cc b/content/browser/gpu/gpu_data_manager_impl_private_unittest.cc index 8955ce1..8babf0e 100644 --- a/content/browser/gpu/gpu_data_manager_impl_private_unittest.cc +++ b/content/browser/gpu/gpu_data_manager_impl_private_unittest.cc @@ -601,7 +601,7 @@ TEST_F(GpuDataManagerImplPrivateTest, GpuDriverBugListSingle) { ScopedGpuDataManagerImplPrivate manager; manager->gpu_driver_bugs_.insert(5); - CommandLine command_line(0, NULL); + base::CommandLine command_line(0, NULL); manager->AppendGpuCommandLine(&command_line); EXPECT_TRUE(command_line.HasSwitch(switches::kGpuDriverBugWorkarounds)); @@ -615,7 +615,7 @@ TEST_F(GpuDataManagerImplPrivateTest, GpuDriverBugListMultiple) { manager->gpu_driver_bugs_.insert(5); manager->gpu_driver_bugs_.insert(7); - CommandLine command_line(0, NULL); + base::CommandLine command_line(0, NULL); manager->AppendGpuCommandLine(&command_line); EXPECT_TRUE(command_line.HasSwitch(switches::kGpuDriverBugWorkarounds)); diff --git a/content/browser/gpu/gpu_internals_ui.cc b/content/browser/gpu/gpu_internals_ui.cc index 88e4b05..d2c3ca5 100644 --- a/content/browser/gpu/gpu_internals_ui.cc +++ b/content/browser/gpu/gpu_internals_ui.cc @@ -328,7 +328,7 @@ base::Value* GpuMessageHandler::OnRequestClientInfo( dict->SetString("version", GetContentClient()->GetProduct()); dict->SetString("command_line", - CommandLine::ForCurrentProcess()->GetCommandLineString()); + base::CommandLine::ForCurrentProcess()->GetCommandLineString()); dict->SetString("operating_system", base::SysInfo::OperatingSystemName() + " " + base::SysInfo::OperatingSystemVersion()); diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc index 27496f5..db55c30 100644 --- a/content/browser/gpu/gpu_process_host.cc +++ b/content/browser/gpu/gpu_process_host.cc @@ -104,7 +104,7 @@ void SendGpuProcessMessage(GpuProcessHost::GpuProcessKind kind, class GpuSandboxedProcessLauncherDelegate : public SandboxedProcessLauncherDelegate { public: - GpuSandboxedProcessLauncherDelegate(CommandLine* cmd_line, + GpuSandboxedProcessLauncherDelegate(base::CommandLine* cmd_line, ChildProcessHost* host) #if defined(OS_WIN) : cmd_line_(cmd_line) {} @@ -216,7 +216,7 @@ class GpuSandboxedProcessLauncherDelegate private: #if defined(OS_WIN) - CommandLine* cmd_line_; + base::CommandLine* cmd_line_; #elif defined(OS_POSIX) int ipc_fd_; #endif // OS_WIN @@ -228,8 +228,10 @@ class GpuSandboxedProcessLauncherDelegate bool GpuProcessHost::ValidateHost(GpuProcessHost* host) { // The Gpu process is invalid if it's not using SwiftShader, the card is // blacklisted, and we can kill it and start over. - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess) || - CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessGPU) || + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kSingleProcess) || + base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kInProcessGPU) || (host->valid_ && (host->swiftshader_rendering_ || !GpuDataManagerImpl::GetInstance()->ShouldUseSwiftShader()))) { @@ -337,8 +339,10 @@ GpuProcessHost::GpuProcessHost(int host_id, GpuProcessKind kind) initialized_(false), gpu_crash_recorded_(false), uma_memory_stats_received_(false) { - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess) || - CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessGPU)) { + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kSingleProcess) || + base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kInProcessGPU)) { in_process_ = true; } @@ -459,7 +463,7 @@ bool GpuProcessHost::Init() { if (in_process_) { DCHECK(g_gpu_main_thread_factory); - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); command_line->AppendSwitch(switches::kDisableGpuWatchdog); GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); @@ -572,7 +576,7 @@ void GpuProcessHost::EstablishGpuChannel( callback.Run(IPC::ChannelHandle(), gpu::GPUInfo()); } - if (!CommandLine::ForCurrentProcess()->HasSwitch( + if (!base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kDisableGpuShaderDiskCache)) { CreateChannelCache(client_id); } @@ -842,9 +846,10 @@ bool GpuProcessHost::LaunchGpuProcess(const std::string& channel_id) { return false; } - const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& browser_command_line = + *base::CommandLine::ForCurrentProcess(); - CommandLine::StringType gpu_launcher = + base::CommandLine::StringType gpu_launcher = browser_command_line.GetSwitchValueNative(switches::kGpuLauncher); #if defined(OS_LINUX) @@ -858,7 +863,7 @@ bool GpuProcessHost::LaunchGpuProcess(const std::string& channel_id) { if (exe_path.empty()) return false; - CommandLine* cmd_line = new CommandLine(exe_path); + base::CommandLine* cmd_line = new base::CommandLine(exe_path); cmd_line->AppendSwitchASCII(switches::kProcessType, switches::kGpuProcess); cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id); @@ -982,7 +987,7 @@ void GpuProcessHost::RecordProcessCrash() { // Last time the GPU process crashed. static base::Time last_gpu_crash_time; - bool disable_crash_limit = CommandLine::ForCurrentProcess()->HasSwitch( + bool disable_crash_limit = base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kDisableGpuProcessCrashLimit); // Ending only acts as a failure if the GPU process was actually started and diff --git a/content/browser/histogram_message_filter.cc b/content/browser/histogram_message_filter.cc index 8a58fff..8eb7c72 100644 --- a/content/browser/histogram_message_filter.cc +++ b/content/browser/histogram_message_filter.cc @@ -45,7 +45,7 @@ void HistogramMessageFilter::OnGetBrowserHistogram( // Security: Only allow access to browser histograms when running in the // context of a test. bool using_stats_collection_controller = - CommandLine::ForCurrentProcess()->HasSwitch( + base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kStatsCollectionController); if (!using_stats_collection_controller) { LOG(ERROR) << "Attempt at reading browser histogram without specifying " diff --git a/content/browser/loader/async_resource_handler.cc b/content/browser/loader/async_resource_handler.cc index 825fc2f4..4038771 100644 --- a/content/browser/loader/async_resource_handler.cc +++ b/content/browser/loader/async_resource_handler.cc @@ -41,7 +41,7 @@ static int kMaxAllocationSize = 1024 * 32; void GetNumericArg(const std::string& name, int* result) { const std::string& value = - CommandLine::ForCurrentProcess()->GetSwitchValueASCII(name); + base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(name); if (!value.empty()) base::StringToInt(value, result); } diff --git a/content/browser/loader/cross_site_resource_handler.cc b/content/browser/loader/cross_site_resource_handler.cc index 3d7862f..03589bf 100644 --- a/content/browser/loader/cross_site_resource_handler.cc +++ b/content/browser/loader/cross_site_resource_handler.cc @@ -194,7 +194,8 @@ bool CrossSiteResourceHandler::OnNormalResponseStarted( // or for WebUI processes for now, since pages like the NTP host multiple // cross-site WebUI iframes. if (!should_transfer && - CommandLine::ForCurrentProcess()->HasSwitch(switches::kSitePerProcess) && + base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kSitePerProcess) && !ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( info->GetChildID())) { return DeferForNavigationPolicyCheck(info, response, defer); diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc index 2123008..17cfcf7 100644 --- a/content/browser/loader/resource_dispatcher_host_impl.cc +++ b/content/browser/loader/resource_dispatcher_host_impl.cc @@ -171,7 +171,8 @@ void AbortRequestBeforeItStarts(ResourceMessageFilter* filter, void SetReferrerForRequest(net::URLRequest* request, const Referrer& referrer) { if (!referrer.url.is_valid() || - CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoReferrers)) { + base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kNoReferrers)) { request->SetReferrer(std::string()); } else { request->SetReferrer(referrer.url.spec()); @@ -1160,7 +1161,8 @@ scoped_ptr<ResourceHandler> ResourceDispatcherHostImpl::CreateResourceHandler( request_data.resource_type == RESOURCE_TYPE_MAIN_FRAME; // If we are using --site-per-process, install it for subframes as well. if (!is_swappable_navigation && - CommandLine::ForCurrentProcess()->HasSwitch(switches::kSitePerProcess)) { + base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kSitePerProcess)) { is_swappable_navigation = request_data.resource_type == RESOURCE_TYPE_SUB_FRAME; } diff --git a/content/browser/mach_broker_mac.mm b/content/browser/mach_broker_mac.mm index e4ee38e..d526d6e 100644 --- a/content/browser/mach_broker_mac.mm +++ b/content/browser/mach_broker_mac.mm @@ -276,7 +276,8 @@ void MachBroker::InvalidatePid(base::ProcessHandle pid) { // static std::string MachBroker::GetMachPortName() { - const CommandLine* command_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* command_line = + base::CommandLine::ForCurrentProcess(); const bool is_child = command_line->HasSwitch(switches::kProcessType); // In non-browser (child) processes, use the parent's pid. diff --git a/content/browser/media/webrtc_browsertest.cc b/content/browser/media/webrtc_browsertest.cc index bfb0cd3..a2d0614 100644 --- a/content/browser/media/webrtc_browsertest.cc +++ b/content/browser/media/webrtc_browsertest.cc @@ -84,7 +84,7 @@ class WebRtcBrowserTest : public WebRtcContentBrowserTest { return; } - ASSERT_TRUE(CommandLine::ForCurrentProcess()->HasSwitch( + ASSERT_TRUE(base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kUseFakeDeviceForMediaStream)) << "Must run with fake devices since the test will explicitly look " << "for the fake device signal."; @@ -195,7 +195,7 @@ IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MAYBE_CanForwardRemoteStream) { // This test fails on Nexus 5 devices. // TODO(henrika): see http://crbug.com/362437 and http://crbug.com/359389 // for details. - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kDisableWebRtcHWDecoding); #endif MakeTypicalPeerConnectionCall( @@ -207,7 +207,7 @@ IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MAYBE_CanForwardRemoteStream720p) { // This test fails on Nexus 5 devices. // TODO(henrika): see http://crbug.com/362437 and http://crbug.com/359389 // for details. - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kDisableWebRtcHWDecoding); #endif const std::string javascript = GenerateGetUserMediaCall( diff --git a/content/browser/net/sqlite_persistent_cookie_store.cc b/content/browser/net/sqlite_persistent_cookie_store.cc index 967101f..420ad92 100644 --- a/content/browser/net/sqlite_persistent_cookie_store.cc +++ b/content/browser/net/sqlite_persistent_cookie_store.cc @@ -1325,8 +1325,8 @@ net::CookieStore* CreateCookieStore(const CookieStoreConfig& config) { // // TODO(ajwong): Remove the InitializedForCurrentProcess() check // once http://crbug.com/331424 is resolved. - if (CommandLine::InitializedForCurrentProcess() && - CommandLine::ForCurrentProcess()->HasSwitch( + if (base::CommandLine::InitializedForCurrentProcess() && + base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableFileCookies)) { cookie_monster->SetEnableFileScheme(true); } diff --git a/content/browser/plugin_process_host.cc b/content/browser/plugin_process_host.cc index 2a68eaf..040fafe 100644 --- a/content/browser/plugin_process_host.cc +++ b/content/browser/plugin_process_host.cc @@ -160,8 +160,9 @@ bool PluginProcessHost::Init(const WebPluginInfo& info) { // Build command line for plugin. When we have a plugin launcher, we can't // allow "self" on linux and we need the real file path. - const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); - CommandLine::StringType plugin_launcher = + const base::CommandLine& browser_command_line = + *base::CommandLine::ForCurrentProcess(); + base::CommandLine::StringType plugin_launcher = browser_command_line.GetSwitchValueNative(switches::kPluginLauncher); #if defined(OS_MACOSX) @@ -180,7 +181,7 @@ bool PluginProcessHost::Init(const WebPluginInfo& info) { if (exe_path.empty()) return false; - CommandLine* cmd_line = new CommandLine(exe_path); + base::CommandLine* cmd_line = new base::CommandLine(exe_path); // Put the process type and plugin path first so they're easier to see // in process listings using native process management tools. cmd_line->AppendSwitchASCII(switches::kProcessType, switches::kPluginProcess); diff --git a/content/browser/plugin_service_impl.cc b/content/browser/plugin_service_impl.cc index a2c3170..00326e3 100644 --- a/content/browser/plugin_service_impl.cc +++ b/content/browser/plugin_service_impl.cc @@ -178,7 +178,8 @@ void PluginServiceImpl::Init() { RegisterPepperPlugins(); // Load any specified on the command line as well. - const CommandLine* command_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* command_line = + base::CommandLine::ForCurrentProcess(); base::FilePath path = command_line->GetSwitchValuePath(switches::kLoadPlugin); if (!path.empty()) diff --git a/content/browser/power_save_blocker_x11.cc b/content/browser/power_save_blocker_x11.cc index e5fb4e5..f1d028c 100644 --- a/content/browser/power_save_blocker_x11.cc +++ b/content/browser/power_save_blocker_x11.cc @@ -200,7 +200,7 @@ void PowerSaveBlockerImpl::Delegate::ApplyBlock(DBusAPI api) { // reason: The reason for the inhibit // flags: Flags that spefify what should be inhibited message_writer->AppendString( - CommandLine::ForCurrentProcess()->GetProgram().value()); + base::CommandLine::ForCurrentProcess()->GetProgram().value()); message_writer->AppendUint32(0); // should be toplevel_xid message_writer->AppendString(reason_); { @@ -228,7 +228,7 @@ void PowerSaveBlockerImpl::Delegate::ApplyBlock(DBusAPI api) { // app_id: The application identifier // reason: The reason for the inhibit message_writer->AppendString( - CommandLine::ForCurrentProcess()->GetProgram().value()); + base::CommandLine::ForCurrentProcess()->GetProgram().value()); message_writer->AppendString(reason_); break; } diff --git a/content/browser/ppapi_plugin_process_host.cc b/content/browser/ppapi_plugin_process_host.cc index fc6a75e..49d3017 100644 --- a/content/browser/ppapi_plugin_process_host.cc +++ b/content/browser/ppapi_plugin_process_host.cc @@ -70,8 +70,9 @@ class PpapiPluginSandboxedProcessLauncherDelegate #elif defined(OS_POSIX) virtual bool ShouldUseZygote() OVERRIDE { - const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); - CommandLine::StringType plugin_launcher = browser_command_line + const base::CommandLine& browser_command_line = + *base::CommandLine::ForCurrentProcess(); + base::CommandLine::StringType plugin_launcher = browser_command_line .GetSwitchValueNative(switches::kPpapiPluginLauncher); return !is_broker_ && plugin_launcher.empty() && info_.is_sandboxed; } @@ -288,8 +289,9 @@ bool PpapiPluginProcessHost::Init(const PepperPluginInfo& info) { return false; } - const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); - CommandLine::StringType plugin_launcher = + const base::CommandLine& browser_command_line = + *base::CommandLine::ForCurrentProcess(); + base::CommandLine::StringType plugin_launcher = browser_command_line.GetSwitchValueNative(switches::kPpapiPluginLauncher); #if defined(OS_LINUX) @@ -304,7 +306,7 @@ bool PpapiPluginProcessHost::Init(const PepperPluginInfo& info) { return false; } - CommandLine* cmd_line = new CommandLine(exe_path); + base::CommandLine* cmd_line = new base::CommandLine(exe_path); cmd_line->AppendSwitchASCII(switches::kProcessType, is_broker_ ? switches::kPpapiBrokerProcess : switches::kPpapiPluginProcess); diff --git a/content/browser/renderer_host/compositor_impl_android.cc b/content/browser/renderer_host/compositor_impl_android.cc index d704f28..3ca74a2 100644 --- a/content/browser/renderer_host/compositor_impl_android.cc +++ b/content/browser/renderer_host/compositor_impl_android.cc @@ -436,7 +436,7 @@ void CompositorImpl::SetVisible(bool visible) { settings.top_controls_height = 0.f; settings.highp_threshold_min = 2048; - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); settings.initial_debug_state.SetRecordRenderingStats( command_line->HasSwitch(cc::switches::kEnableGpuBenchmarking)); settings.initial_debug_state.show_fps_counter = diff --git a/content/browser/renderer_host/input/input_router_config_helper.cc b/content/browser/renderer_host/input/input_router_config_helper.cc index 31b17cf..268b055 100644 --- a/content/browser/renderer_host/input/input_router_config_helper.cc +++ b/content/browser/renderer_host/input/input_router_config_helper.cc @@ -114,7 +114,7 @@ TouchEventQueue::Config GetTouchEventQueueConfig() { TouchEventQueue::TouchScrollingMode GetTouchScrollingMode() { std::string modeString = - CommandLine::ForCurrentProcess()->GetSwitchValueASCII( + base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( switches::kTouchScrollingMode); if (modeString == switches::kTouchScrollingModeAsyncTouchmove) return TouchEventQueue::TOUCH_SCROLLING_MODE_ASYNC_TOUCHMOVE; diff --git a/content/browser/renderer_host/input/input_router_impl_unittest.cc b/content/browser/renderer_host/input/input_router_impl_unittest.cc index 1fa1a7d..713ae5f 100644 --- a/content/browser/renderer_host/input/input_router_impl_unittest.cc +++ b/content/browser/renderer_host/input/input_router_impl_unittest.cc @@ -151,7 +151,7 @@ class InputRouterImplTest : public testing::Test { process_.reset(new MockRenderProcessHost(browser_context_.get())); client_.reset(new MockInputRouterClient()); ack_handler_.reset(new MockInputAckHandler()); - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); command_line->AppendSwitch(switches::kValidateInputEventStream); input_router_.reset(new InputRouterImpl(process_.get(), client_.get(), diff --git a/content/browser/renderer_host/media/audio_renderer_host_unittest.cc b/content/browser/renderer_host/media/audio_renderer_host_unittest.cc index 343c989..9dc99f2 100644 --- a/content/browser/renderer_host/media/audio_renderer_host_unittest.cc +++ b/content/browser/renderer_host/media/audio_renderer_host_unittest.cc @@ -157,7 +157,7 @@ class AudioRendererHostTest : public testing::Test { public: AudioRendererHostTest() { audio_manager_.reset(media::AudioManager::CreateForTesting()); - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kUseFakeDeviceForMediaStream); media_stream_manager_.reset(new MediaStreamManager(audio_manager_.get())); host_ = new MockAudioRendererHost(audio_manager_.get(), diff --git a/content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc b/content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc index 24366a5..1ab6478 100644 --- a/content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc +++ b/content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc @@ -225,7 +225,7 @@ class MediaStreamDispatcherHostTest : public testing::Test { audio_manager_.reset( new media::MockAudioManager(base::MessageLoopProxy::current())); // Make sure we use fake devices to avoid long delays. - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kUseFakeDeviceForMediaStream); // Create our own MediaStreamManager. media_stream_manager_.reset(new MediaStreamManager(audio_manager_.get())); diff --git a/content/browser/renderer_host/media/media_stream_manager_unittest.cc b/content/browser/renderer_host/media/media_stream_manager_unittest.cc index cc19af2..cfaaf94 100644 --- a/content/browser/renderer_host/media/media_stream_manager_unittest.cc +++ b/content/browser/renderer_host/media/media_stream_manager_unittest.cc @@ -79,7 +79,7 @@ class MediaStreamManagerTest : public ::testing::Test { : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP), message_loop_(base::MessageLoopProxy::current()) { // Create our own MediaStreamManager. Use fake devices to run on the bots. - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kUseFakeDeviceForMediaStream); audio_manager_.reset(new MockAudioManager()); media_stream_manager_.reset(new MediaStreamManager(audio_manager_.get())); diff --git a/content/browser/renderer_host/overscroll_controller.cc b/content/browser/renderer_host/overscroll_controller.cc index 3a6e757..01cf766 100644 --- a/content/browser/renderer_host/overscroll_controller.cc +++ b/content/browser/renderer_host/overscroll_controller.cc @@ -15,7 +15,7 @@ using blink::WebInputEvent; namespace { bool IsScrollEndEffectEnabled() { - return CommandLine::ForCurrentProcess()->GetSwitchValueASCII( + return base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( switches::kScrollEndEffect) == "1"; } diff --git a/content/browser/renderer_host/render_message_filter.cc b/content/browser/renderer_host/render_message_filter.cc index 86e3062..59ab5b4 100644 --- a/content/browser/renderer_host/render_message_filter.cc +++ b/content/browser/renderer_host/render_message_filter.cc @@ -990,7 +990,8 @@ bool RenderMessageFilter::CheckPreparsedJsCachingEnabled() const { static bool checked = false; static bool result = false; if (!checked) { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); result = command_line.HasSwitch(switches::kEnablePreparsedJsCaching); checked = true; } diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc index b8d98cd..e230b1e 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc @@ -320,8 +320,9 @@ class RendererSandboxedProcessLauncherDelegate #elif defined(OS_POSIX) virtual bool ShouldUseZygote() OVERRIDE { - const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); - CommandLine::StringType renderer_prefix = + const base::CommandLine& browser_command_line = + *base::CommandLine::ForCurrentProcess(); + base::CommandLine::StringType renderer_prefix = browser_command_line.GetSwitchValueNative(switches::kRendererCmdPrefix); return renderer_prefix.empty(); } @@ -481,7 +482,7 @@ RenderProcessHostImpl::RenderProcessHostImpl( mark_child_process_activity_time(); if (!GetBrowserContext()->IsOffTheRecord() && - !CommandLine::ForCurrentProcess()->HasSwitch( + !base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kDisableGpuShaderDiskCache)) { BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, base::Bind(&CacheShaderInfo, GetID(), @@ -550,7 +551,7 @@ RenderProcessHostImpl::~RenderProcessHostImpl() { UnregisterHost(GetID()); - if (!CommandLine::ForCurrentProcess()->HasSwitch( + if (!base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kDisableGpuShaderDiskCache)) { BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, base::Bind(&RemoveShaderInfo, GetID())); @@ -571,11 +572,12 @@ bool RenderProcessHostImpl::Init() { if (channel_) return true; - CommandLine::StringType renderer_prefix; + base::CommandLine::StringType renderer_prefix; #if defined(OS_POSIX) // A command prefix is something prepended to the command line of the spawned // process. It is supported only on POSIX systems. - const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& browser_command_line = + *base::CommandLine::ForCurrentProcess(); renderer_prefix = browser_command_line.GetSwitchValueNative(switches::kRendererCmdPrefix); #endif // defined(OS_POSIX) @@ -633,7 +635,7 @@ bool RenderProcessHostImpl::Init() { } else { // Build command line for renderer. We call AppendRendererCommandLine() // first so the process type argument will appear first. - CommandLine* cmd_line = new CommandLine(renderer_path); + base::CommandLine* cmd_line = new base::CommandLine(renderer_path); if (!renderer_prefix.empty()) cmd_line->PrependWrapper(renderer_prefix); AppendRendererCommandLine(cmd_line); @@ -677,7 +679,8 @@ void RenderProcessHostImpl::MaybeActivateMojo() { } bool RenderProcessHostImpl::ShouldUseMojoChannel() const { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); return command_line.HasSwitch(switches::kEnableRendererMojoChannel); } @@ -886,7 +889,7 @@ void RenderProcessHostImpl::CreateMessageFilters() { AddFilter(new ProfilerMessageFilter(PROCESS_TYPE_RENDERER)); AddFilter(new HistogramMessageFilter()); #if defined(USE_TCMALLOC) && (defined(OS_LINUX) || defined(OS_ANDROID)) - if (CommandLine::ForCurrentProcess()->HasSwitch( + if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableMemoryBenchmarking)) AddFilter(new MemoryBenchmarkMessageFilter()); #endif @@ -936,8 +939,8 @@ void RenderProcessHostImpl::RemoveRoute(int32 routing_id) { #if defined(OS_WIN) // Dump the handle table if handle auditing is enabled. - const CommandLine& browser_command_line = - *CommandLine::ForCurrentProcess(); + const base::CommandLine& browser_command_line = + *base::CommandLine::ForCurrentProcess(); if (browser_command_line.HasSwitch(switches::kAuditHandles) || browser_command_line.HasSwitch(switches::kAuditAllHandles)) { DumpHandles(); @@ -962,7 +965,7 @@ void RenderProcessHostImpl::RemoveObserver( } void RenderProcessHostImpl::ReceivedBadMessage() { - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(switches::kDisableKillAfterBadIPC)) return; @@ -1010,7 +1013,7 @@ StoragePartition* RenderProcessHostImpl::GetStoragePartition() const { return storage_partition_impl_; } -static void AppendCompositorCommandLineFlags(CommandLine* command_line) { +static void AppendCompositorCommandLineFlags(base::CommandLine* command_line) { if (IsPinchVirtualViewportEnabled()) command_line->AppendSwitch(cc::switches::kEnablePinchVirtualViewport); @@ -1033,13 +1036,14 @@ static void AppendCompositorCommandLineFlags(CommandLine* command_line) { } void RenderProcessHostImpl::AppendRendererCommandLine( - CommandLine* command_line) const { + base::CommandLine* command_line) const { // Pass the process type first, so it shows first in process listings. command_line->AppendSwitchASCII(switches::kProcessType, switches::kRendererProcess); // Now send any options from our own command line we want to propagate. - const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& browser_command_line = + *base::CommandLine::ForCurrentProcess(); PropagateBrowserCommandLineToRenderer(browser_command_line, command_line); // Pass on the browser locale. @@ -1072,8 +1076,8 @@ void RenderProcessHostImpl::AppendRendererCommandLine( } void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( - const CommandLine& browser_cmd, - CommandLine* renderer_cmd) const { + const base::CommandLine& browser_cmd, + base::CommandLine* renderer_cmd) const { // Propagate the following switches to the renderer command line (along // with any associated values) if present in the browser command line. static const char* const kSwitchNames[] = { @@ -1727,7 +1731,7 @@ bool RenderProcessHost::run_renderer_in_process() { void RenderProcessHost::SetRunRendererInProcess(bool value) { g_run_renderer_in_process_ = value; - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); if (value) { if (!command_line->HasSwitch(switches::kLang)) { // Modify the current process' command line to include the browser locale, @@ -1764,7 +1768,8 @@ bool RenderProcessHost::ShouldTryToUseExistingProcessHost( // from the same site to share, if we knew what the given process was // dedicated to. Allowing no sharing is simpler for now.) This may cause // resource exhaustion issues if too many sites are open at once. - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); if (command_line.HasSwitch(switches::kEnableStrictSiteIsolation) || command_line.HasSwitch(switches::kSitePerProcess)) return false; @@ -1821,7 +1826,8 @@ bool RenderProcessHost::ShouldUseProcessPerSite( // the case if the --process-per-site switch is specified, or in // process-per-site-instance for particular sites (e.g., WebUI). // Note that --single-process is handled in ShouldTryToUseExistingProcessHost. - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); if (command_line.HasSwitch(switches::kProcessPerSite)) return true; diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc index 10f72cb..b01f462 100644 --- a/content/browser/renderer_host/render_view_host_impl.cc +++ b/content/browser/renderer_host/render_view_host_impl.cc @@ -334,7 +334,8 @@ WebPreferences RenderViewHostImpl::ComputeWebkitPrefs(const GURL& url) { TRACE_EVENT0("browser", "RenderViewHostImpl::GetWebkitPrefs"); WebPreferences prefs; - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); prefs.javascript_enabled = !command_line.HasSwitch(switches::kDisableJavaScript); @@ -808,7 +809,8 @@ void RenderViewHostImpl::AllowBindings(int bindings_flags) { static_cast<RenderProcessHostImpl*>(GetProcess()); // --single-process only has one renderer. if (process->GetActiveViewCount() > 1 && - !CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)) + !base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kSingleProcess)) return; } diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc index 94bb657..4cf3d03a 100644 --- a/content/browser/renderer_host/render_widget_host_impl.cc +++ b/content/browser/renderer_host/render_widget_host_impl.cc @@ -226,7 +226,7 @@ RenderWidgetHostImpl::RenderWidgetHostImpl(RenderWidgetHostDelegate* delegate, RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( IsRenderView() ? RenderViewHost::From(this) : NULL); if (BrowserPluginGuest::IsGuest(rvh) || - !CommandLine::ForCurrentProcess()->HasSwitch( + !base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kDisableHangMonitor)) { hang_monitor_timeout_.reset(new TimeoutMonitor( base::Bind(&RenderWidgetHostImpl::RendererIsUnresponsive, @@ -1562,7 +1562,7 @@ void RenderWidgetHostImpl::DidUpdateBackingStore( void RenderWidgetHostImpl::OnQueueSyntheticGesture( const SyntheticGesturePacket& gesture_packet) { // Only allow untrustworthy gestures if explicitly enabled. - if (!CommandLine::ForCurrentProcess()->HasSwitch( + if (!base::CommandLine::ForCurrentProcess()->HasSwitch( cc::switches::kEnableGpuBenchmarking)) { RecordAction(base::UserMetricsAction("BadMessageTerminate_RWH7")); GetProcess()->ReceivedBadMessage(); @@ -2166,7 +2166,8 @@ void RenderWidgetHostImpl::WindowOldSnapshotReachedScreen(int snapshot_id) { // This feature is behind the kEnableGpuBenchmarking command line switch // because it poses security concerns and should only be used for testing. - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); if (!command_line.HasSwitch(cc::switches::kEnableGpuBenchmarking)) { Send(new ViewMsg_WindowSnapshotCompleted( GetRoutingID(), snapshot_id, gfx::Size(), png)); diff --git a/content/browser/renderer_host/render_widget_host_unittest.cc b/content/browser/renderer_host/render_widget_host_unittest.cc index 3e060d5..f0e072f 100644 --- a/content/browser/renderer_host/render_widget_host_unittest.cc +++ b/content/browser/renderer_host/render_widget_host_unittest.cc @@ -431,7 +431,7 @@ class RenderWidgetHostTest : public testing::Test { protected: // testing::Test virtual void SetUp() { - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); command_line->AppendSwitch(switches::kValidateInputEventStream); browser_context_.reset(new TestBrowserContext()); diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc index d41cf4e..501eec1 100644 --- a/content/browser/renderer_host/render_widget_host_view_android.cc +++ b/content/browser/renderer_host/render_widget_host_view_android.cc @@ -153,7 +153,8 @@ OverscrollGlow::DisplayParameters CreateOverscrollDisplayParameters( ui::GestureProvider::Config CreateGestureProviderConfig() { ui::GestureProvider::Config config = ui::DefaultGestureProviderConfig(); config.disable_click_delay = - CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableClickDelay); + base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kDisableClickDelay); return config; } @@ -190,8 +191,9 @@ RenderWidgetHostViewAndroid::RenderWidgetHostViewAndroid( cached_background_color_(SK_ColorWHITE), last_output_surface_id_(kUndefinedOutputSurfaceId), weak_ptr_factory_(this), - overscroll_effect_enabled_(!CommandLine::ForCurrentProcess()->HasSwitch( - switches::kDisableOverscrollEdgeEffect)), + overscroll_effect_enabled_( + !base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kDisableOverscrollEdgeEffect)), gesture_provider_(CreateGestureProviderConfig(), this), gesture_text_selector_(this), touch_scrolling_(false), diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc index 63b7b6f..0d41c2a 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc @@ -462,7 +462,7 @@ RenderWidgetHostViewAura::RenderWidgetHostViewAura(RenderWidgetHost* host) window_->set_layer_owner_delegate(delegated_frame_host_.get()); gfx::Screen::GetScreenFor(window_)->AddObserver(this); - bool overscroll_enabled = CommandLine::ForCurrentProcess()-> + bool overscroll_enabled = base::CommandLine::ForCurrentProcess()-> GetSwitchValueASCII(switches::kOverscrollHistoryNavigation) != "0"; SetOverscrollControllerEnabled(overscroll_enabled); } diff --git a/content/browser/renderer_host/render_widget_host_view_browsertest.cc b/content/browser/renderer_host/render_widget_host_view_browsertest.cc index 40c21cc..d12edb3 100644 --- a/content/browser/renderer_host/render_widget_host_view_browsertest.cc +++ b/content/browser/renderer_host/render_widget_host_view_browsertest.cc @@ -778,7 +778,7 @@ class CompositingRenderWidgetHostViewTabCaptureHighDPI CompositingRenderWidgetHostViewTabCaptureHighDPI() : kScale(2.f) {} virtual void SetUpOnMainThread() OVERRIDE { - CommandLine* cmd = CommandLine::ForCurrentProcess(); + base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); cmd->AppendSwitchASCII(switches::kForceDeviceScaleFactor, base::StringPrintf("%f", scale())); #if defined(OS_WIN) diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm index bc89f8e..9be4443 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm @@ -844,7 +844,8 @@ float RenderWidgetHostViewMac::ViewScaleFactor() const { void RenderWidgetHostViewMac::UpdateDisplayLink() { static bool is_vsync_disabled = - CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableGpuVsync); + base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kDisableGpuVsync); if (is_vsync_disabled) return; @@ -2289,7 +2290,8 @@ SkColorType RenderWidgetHostViewMac::PreferredReadbackFormat() { bool RenderWidgetHostViewMac::AcceleratedLayerShouldAckImmediately() const { // If vsync is disabled, then always draw and ack frames immediately. static bool is_vsync_disabled = - CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableGpuVsync); + base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kDisableGpuVsync); if (is_vsync_disabled) return true; diff --git a/content/browser/service_worker/service_worker_browsertest.cc b/content/browser/service_worker/service_worker_browsertest.cc index 6986d5e..ef9be78 100644 --- a/content/browser/service_worker/service_worker_browsertest.cc +++ b/content/browser/service_worker/service_worker_browsertest.cc @@ -178,7 +178,7 @@ class ServiceWorkerBrowserTest : public ContentBrowserTest { protected: typedef ServiceWorkerBrowserTest self; - virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { + virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE { command_line->AppendSwitch( switches::kEnableExperimentalWebPlatformFeatures); } @@ -642,7 +642,7 @@ IN_PROC_BROWSER_TEST_F(ServiceWorkerVersionBrowserTest, } IN_PROC_BROWSER_TEST_F(ServiceWorkerVersionBrowserTest, SyncEventHandled) { - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); command_line->AppendSwitch(switches::kEnableServiceWorkerSync); RunOnIOThread(base::Bind( diff --git a/content/browser/site_instance_impl.cc b/content/browser/site_instance_impl.cc index 102c067..6d5690d 100644 --- a/content/browser/site_instance_impl.cc +++ b/content/browser/site_instance_impl.cc @@ -337,7 +337,8 @@ void SiteInstanceImpl::RenderProcessHostDestroyed(RenderProcessHost* host) { void SiteInstanceImpl::LockToOrigin() { // We currently only restrict this process to a particular site if the // --enable-strict-site-isolation or --site-per-process flags are present. - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); if (command_line.HasSwitch(switches::kEnableStrictSiteIsolation) || command_line.HasSwitch(switches::kSitePerProcess)) { ChildProcessSecurityPolicyImpl* policy = diff --git a/content/browser/site_instance_impl_unittest.cc b/content/browser/site_instance_impl_unittest.cc index 897a09c..ce02db9 100644 --- a/content/browser/site_instance_impl_unittest.cc +++ b/content/browser/site_instance_impl_unittest.cc @@ -405,7 +405,7 @@ TEST_F(SiteInstanceTest, IsSameWebSite) { // Test to ensure that there is only one SiteInstance per site in a given // BrowsingInstance, when process-per-site is not in use. TEST_F(SiteInstanceTest, OneSiteInstancePerSite) { - ASSERT_FALSE(CommandLine::ForCurrentProcess()->HasSwitch( + ASSERT_FALSE(base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kProcessPerSite)); int delete_counter = 0; scoped_ptr<TestBrowserContext> browser_context(new TestBrowserContext()); @@ -479,7 +479,7 @@ TEST_F(SiteInstanceTest, OneSiteInstancePerSite) { // Test to ensure that there is only one RenderProcessHost per site for an // entire BrowserContext, if process-per-site is in use. TEST_F(SiteInstanceTest, OneSiteInstancePerSiteInBrowserContext) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kProcessPerSite); int delete_counter = 0; scoped_ptr<TestBrowserContext> browser_context(new TestBrowserContext()); @@ -570,7 +570,8 @@ static SiteInstanceImpl* CreateSiteInstance(BrowserContext* browser_context, TEST_F(SiteInstanceTest, ProcessSharingByType) { // This test shouldn't run with --site-per-process mode, since it doesn't // allow render process reuse, which this test explicitly exercises. - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSitePerProcess)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kSitePerProcess)) return; // On Android by default the number of renderer hosts is unlimited and process @@ -690,7 +691,7 @@ TEST_F(SiteInstanceTest, HasWrongProcessForURL) { // Test to ensure that HasWrongProcessForURL behaves properly even when // --site-per-process is used (http://crbug.com/160671). TEST_F(SiteInstanceTest, HasWrongProcessForURLInSitePerProcess) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kSitePerProcess); scoped_ptr<TestBrowserContext> browser_context(new TestBrowserContext()); @@ -764,7 +765,7 @@ TEST_F(SiteInstanceTest, ProcessPerSiteWithWrongBindings) { // Test that we do not register processes with empty sites for process-per-site // mode. TEST_F(SiteInstanceTest, NoProcessPerSiteForEmptySite) { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kProcessPerSite); scoped_ptr<TestBrowserContext> browser_context(new TestBrowserContext()); scoped_ptr<RenderProcessHost> host; diff --git a/content/browser/tracing/tracing_ui.cc b/content/browser/tracing/tracing_ui.cc index d977d21..193774a 100644 --- a/content/browser/tracing/tracing_ui.cc +++ b/content/browser/tracing/tracing_ui.cc @@ -317,7 +317,8 @@ void TracingUI::OnMonitoringStateChanged(bool is_monitoring) { } void TracingUI::DoUpload(const base::ListValue* args) { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); std::string upload_url = kUploadURL; if (command_line.HasSwitch(switches::kTraceUploadURL)) { upload_url = diff --git a/content/browser/utility_process_host_impl.cc b/content/browser/utility_process_host_impl.cc index ddc41a7..1a1b942 100644 --- a/content/browser/utility_process_host_impl.cc +++ b/content/browser/utility_process_host_impl.cc @@ -194,7 +194,8 @@ bool UtilityProcessHostImpl::StartProcess() { in_process_thread_.reset(g_utility_main_thread_factory(channel_id)); in_process_thread_->Start(); } else { - const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& browser_command_line = + *base::CommandLine::ForCurrentProcess(); int child_flags = child_flags_; #if defined(OS_POSIX) @@ -216,7 +217,7 @@ bool UtilityProcessHostImpl::StartProcess() { return false; } - CommandLine* cmd_line = new CommandLine(exe_path); + base::CommandLine* cmd_line = new base::CommandLine(exe_path); cmd_line->AppendSwitchASCII(switches::kProcessType, switches::kUtilityProcess); cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id); diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc index d3c5d7a..b048b23 100644 --- a/content/browser/web_contents/web_contents_view_aura.cc +++ b/content/browser/web_contents/web_contents_view_aura.cc @@ -83,7 +83,7 @@ WebContentsView* CreateWebContentsView( namespace { bool IsScrollEndEffectEnabled() { - return CommandLine::ForCurrentProcess()->GetSwitchValueASCII( + return base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( switches::kScrollEndEffect) == "1"; } @@ -790,7 +790,7 @@ void WebContentsViewAura::EndDrag(blink::WebDragOperationsMask ops) { void WebContentsViewAura::InstallOverscrollControllerDelegate( RenderWidgetHostViewAura* view) { - const std::string value = CommandLine::ForCurrentProcess()-> + const std::string value = base::CommandLine::ForCurrentProcess()-> GetSwitchValueASCII(switches::kOverscrollHistoryNavigation); if (value == "0") { navigation_overlay_.reset(); diff --git a/content/browser/zygote_host/zygote_host_impl_linux.cc b/content/browser/zygote_host/zygote_host_impl_linux.cc index 81d0756..2c3467e 100644 --- a/content/browser/zygote_host/zygote_host_impl_linux.cc +++ b/content/browser/zygote_host/zygote_host_impl_linux.cc @@ -100,7 +100,7 @@ void ZygoteHostImpl::Init(const std::string& sandbox_cmd) { base::FilePath chrome_path; CHECK(PathService::Get(base::FILE_EXE, &chrome_path)); - CommandLine cmd_line(chrome_path); + base::CommandLine cmd_line(chrome_path); cmd_line.AppendSwitchASCII(switches::kProcessType, switches::kZygoteProcess); @@ -111,7 +111,8 @@ void ZygoteHostImpl::Init(const std::string& sandbox_cmd) { fds_to_map.push_back(std::make_pair(fds[1], kZygoteSocketPairFd)); base::LaunchOptions options; - const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& browser_command_line = + *base::CommandLine::ForCurrentProcess(); if (browser_command_line.HasSwitch(switches::kZygoteCmdPrefix)) { cmd_line.PrependWrapper( browser_command_line.GetSwitchValueNative(switches::kZygoteCmdPrefix)); diff --git a/content/child/child_thread.cc b/content/child/child_thread.cc index 7c6432a..a9a2fb6 100644 --- a/content/child/child_thread.cc +++ b/content/child/child_thread.cc @@ -193,12 +193,12 @@ void QuitMainThreadMessageLoop() { } // namespace ChildThread::Options::Options() - : channel_name(CommandLine::ForCurrentProcess()->GetSwitchValueASCII( + : channel_name(base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( switches::kProcessChannelID)), use_mojo_channel(false) {} ChildThread::Options::Options(bool mojo) - : channel_name(CommandLine::ForCurrentProcess()->GetSwitchValueASCII( + : channel_name(base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( switches::kProcessChannelID)), use_mojo_channel(mojo) {} @@ -297,7 +297,8 @@ void ChildThread::Init(const Options& options) { channel_->AddFilter(quota_message_filter_->GetFilter()); channel_->AddFilter(service_worker_message_filter_->GetFilter()); - if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)) { + if (!base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kSingleProcess)) { // In single process mode, browser-side tracing will cover the whole // process including renderers. channel_->AddFilter(new tracing::ChildTraceMessageFilter( @@ -317,13 +318,13 @@ void ChildThread::Init(const Options& options) { #if defined(OS_POSIX) // Check that --process-type is specified so we don't do this in unit tests // and single-process mode. - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kProcessType)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kProcessType)) channel_->AddFilter(new SuicideOnChannelErrorFilter()); #endif int connection_timeout = kConnectionTimeoutS; std::string connection_override = - CommandLine::ForCurrentProcess()->GetSwitchValueASCII( + base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( switches::kIPCConnectionTimeout); if (!connection_override.empty()) { int temp; @@ -526,7 +527,7 @@ void ChildThread::OnDumpHandles() { #if defined(OS_WIN) scoped_refptr<HandleEnumerator> handle_enum( new HandleEnumerator( - CommandLine::ForCurrentProcess()->HasSwitch( + base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kAuditAllHandles))); handle_enum->EnumerateHandles(); Send(new ChildProcessHostMsg_DumpHandlesDone); diff --git a/content/child/npapi/npobject_stub.cc b/content/child/npapi/npobject_stub.cc index 298e3cd..fb910d9 100644 --- a/content/child/npapi/npobject_stub.cc +++ b/content/child/npapi/npobject_stub.cc @@ -257,7 +257,7 @@ void NPObjectStub::OnSetProperty(const NPIdentifier_Param& name, if (npobject_->_class->setProperty) { #if defined(OS_WIN) static base::FilePath plugin_path = - CommandLine::ForCurrentProcess()->GetSwitchValuePath( + base::CommandLine::ForCurrentProcess()->GetSwitchValuePath( switches::kPluginPath); static std::wstring filename = base::StringToLowerASCII( plugin_path.BaseName().value()); diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc index 6345f37..9386b8e 100644 --- a/content/child/runtime_features.cc +++ b/content/child/runtime_features.cc @@ -81,7 +81,7 @@ static void SetRuntimeFeatureDefaultsForPlatform() { } void SetRuntimeFeaturesDefaultsAndUpdateFromArgs( - const CommandLine& command_line) { + const base::CommandLine& command_line) { if (command_line.HasSwitch(switches::kEnableExperimentalWebPlatformFeatures)) WebRuntimeFeatures::enableExperimentalFeatures(true); diff --git a/content/common/child_process_host_impl.cc b/content/common/child_process_host_impl.cc index 6fa0199..c4d209e 100644 --- a/content/common/child_process_host_impl.cc +++ b/content/common/child_process_host_impl.cc @@ -93,7 +93,7 @@ ChildProcessHost* ChildProcessHost::Create(ChildProcessHostDelegate* delegate) { base::FilePath ChildProcessHost::GetChildPath(int flags) { base::FilePath child_path; - child_path = CommandLine::ForCurrentProcess()->GetSwitchValuePath( + child_path = base::CommandLine::ForCurrentProcess()->GetSwitchValuePath( switches::kBrowserSubprocessPath); #if defined(OS_LINUX) diff --git a/content/common/content_switches_internal.cc b/content/common/content_switches_internal.cc index 2f0638f..76d8772 100644 --- a/content/common/content_switches_internal.cc +++ b/content/common/content_switches_internal.cc @@ -14,7 +14,8 @@ namespace content { bool IsPinchToZoomEnabled() { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); // --disable-pinch should always disable pinch if (command_line.HasSwitch(switches::kDisablePinch)) diff --git a/content/common/gpu/client/gl_helper_benchmark.cc b/content/common/gpu/client/gl_helper_benchmark.cc index fc41fed..225db42 100644 --- a/content/common/gpu/client/gl_helper_benchmark.cc +++ b/content/common/gpu/client/gl_helper_benchmark.cc @@ -296,7 +296,7 @@ TEST_F(GLHelperTest, DISABLED_ScaleTestImage) { // These tests needs to run against a proper GL environment, so we // need to set it up before we can run the tests. int main(int argc, char** argv) { - CommandLine::Init(argc, argv); + base::CommandLine::Init(argc, argv); base::TestSuite* suite = new content::ContentTestSuite(argc, argv); #if defined(OS_MACOSX) base::mac::ScopedNSAutoreleasePool pool; diff --git a/content/common/gpu/client/gl_helper_unittest.cc b/content/common/gpu/client/gl_helper_unittest.cc index f2a148e..e22c3f7 100644 --- a/content/common/gpu/client/gl_helper_unittest.cc +++ b/content/common/gpu/client/gl_helper_unittest.cc @@ -1698,7 +1698,7 @@ TEST_F(GLHelperTest, CheckOptimizations) { // These tests needs to run against a proper GL environment, so we // need to set it up before we can run the tests. int main(int argc, char** argv) { - CommandLine::Init(argc, argv); + base::CommandLine::Init(argc, argv); base::TestSuite* suite = new content::ContentTestSuite(argc, argv); #if defined(OS_MACOSX) base::mac::ScopedNSAutoreleasePool pool; diff --git a/content/common/gpu/gpu_channel.cc b/content/common/gpu/gpu_channel.cc index 330e3cf..0759e5d 100644 --- a/content/common/gpu/gpu_channel.cc +++ b/content/common/gpu/gpu_channel.cc @@ -417,7 +417,8 @@ GpuChannel::GpuChannel(GpuChannelManager* gpu_channel_manager, DCHECK(client_id); channel_id_ = IPC::Channel::GenerateVerifiedChannelID("gpu"); - const CommandLine* command_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* command_line = + base::CommandLine::ForCurrentProcess(); log_messages_ = command_line->HasSwitch(switches::kLogPluginMessages); } diff --git a/content/common/gpu/gpu_memory_manager.cc b/content/common/gpu/gpu_memory_manager.cc index 9a23375..045210a 100644 --- a/content/common/gpu/gpu_memory_manager.cc +++ b/content/common/gpu/gpu_memory_manager.cc @@ -62,11 +62,11 @@ GpuMemoryManager::~GpuMemoryManager() { void GpuMemoryManager::UpdateAvailableGpuMemory() { // If the value was overridden on the command line, use the specified value. static bool client_hard_limit_bytes_overridden = - CommandLine::ForCurrentProcess()->HasSwitch( + base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kForceGpuMemAvailableMb); if (client_hard_limit_bytes_overridden) { base::StringToUint64( - CommandLine::ForCurrentProcess()->GetSwitchValueASCII( + base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( switches::kForceGpuMemAvailableMb), &client_hard_limit_bytes_); client_hard_limit_bytes_ *= 1024 * 1024; diff --git a/content/common/gpu/image_transport_surface_android.cc b/content/common/gpu/image_transport_surface_android.cc index 5fc9e51..5e0d6ff 100644 --- a/content/common/gpu/image_transport_surface_android.cc +++ b/content/common/gpu/image_transport_surface_android.cc @@ -92,7 +92,8 @@ bool ImageTransportSurfaceAndroid::Initialize() { GpuChannel* parent_channel = GetHelper()->manager()->LookupChannel(parent_client_id_); if (parent_channel) { - const CommandLine* command_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* command_line = + base::CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(switches::kUIPrioritizeInGpuProcess)) GetHelper()->SetPreemptByFlag(parent_channel->GetPreemptionFlag()); } diff --git a/content/common/gpu/media/android_video_encode_accelerator.cc b/content/common/gpu/media/android_video_encode_accelerator.cc index 83593fa..a6406c1 100644 --- a/content/common/gpu/media/android_video_encode_accelerator.cc +++ b/content/common/gpu/media/android_video_encode_accelerator.cc @@ -86,7 +86,7 @@ AndroidVideoEncodeAccelerator::GetSupportedProfiles() { std::vector<SupportedProfile> profiles; #if defined(ENABLE_WEBRTC) - const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); if (cmd_line->HasSwitch(switches::kDisableWebRtcHWEncoding)) return profiles; #endif diff --git a/content/common/gpu/media/gpu_video_encode_accelerator.cc b/content/common/gpu/media/gpu_video_encode_accelerator.cc index 52ecab8..8c12967 100644 --- a/content/common/gpu/media/gpu_video_encode_accelerator.cc +++ b/content/common/gpu/media/gpu_video_encode_accelerator.cc @@ -191,7 +191,7 @@ void GpuVideoEncodeAccelerator::CreateEncoder() { encoder_.reset(new V4L2VideoEncodeAccelerator(device.Pass())); #elif defined(ARCH_CPU_X86_FAMILY) - const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); if (cmd_line->HasSwitch(switches::kEnableVaapiAcceleratedVideoEncode)) encoder_.reset(new VaapiVideoEncodeAccelerator(gfx::GetXDisplay())); #endif diff --git a/content/common/gpu/media/rendering_helper.cc b/content/common/gpu/media/rendering_helper.cc index 3abc30e..7ee9401 100644 --- a/content/common/gpu/media/rendering_helper.cc +++ b/content/common/gpu/media/rendering_helper.cc @@ -62,7 +62,7 @@ RenderingHelperParams::~RenderingHelperParams() {} // static bool RenderingHelper::InitializeOneOff() { - CommandLine* cmd_line = CommandLine::ForCurrentProcess(); + base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); #if GL_VARIANT_GLX cmd_line->AppendSwitchASCII(switches::kUseGL, gfx::kGLImplementationDesktopName); diff --git a/content/common/gpu/media/v4l2_video_encode_accelerator.cc b/content/common/gpu/media/v4l2_video_encode_accelerator.cc index a5cb4fb..b3967ea 100644 --- a/content/common/gpu/media/v4l2_video_encode_accelerator.cc +++ b/content/common/gpu/media/v4l2_video_encode_accelerator.cc @@ -286,7 +286,7 @@ V4L2VideoEncodeAccelerator::GetSupportedProfiles() { std::vector<SupportedProfile> profiles; SupportedProfile profile; - const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); if (cmd_line->HasSwitch(switches::kEnableWebRtcHWVp8Encoding)) { profile.profile = media::VP8PROFILE_MAIN; profile.max_resolution.SetSize(1920, 1088); diff --git a/content/common/gpu/media/vaapi_h264_decoder_unittest.cc b/content/common/gpu/media/vaapi_h264_decoder_unittest.cc index b14c50b..9c7822b 100644 --- a/content/common/gpu/media/vaapi_h264_decoder_unittest.cc +++ b/content/common/gpu/media/vaapi_h264_decoder_unittest.cc @@ -350,7 +350,7 @@ TEST(VaapiH264DecoderTest, TestDecode) { int main(int argc, char** argv) { testing::InitGoogleTest(&argc, argv); // Removes gtest-specific args. - CommandLine::Init(argc, argv); + base::CommandLine::Init(argc, argv); // Needed to enable DVLOG through --vmodule. logging::LoggingSettings settings; @@ -358,11 +358,11 @@ int main(int argc, char** argv) { CHECK(logging::InitLogging(settings)); // Process command line. - CommandLine* cmd_line = CommandLine::ForCurrentProcess(); + base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); CHECK(cmd_line); - CommandLine::SwitchMap switches = cmd_line->GetSwitches(); - for (CommandLine::SwitchMap::const_iterator it = switches.begin(); + base::CommandLine::SwitchMap switches = cmd_line->GetSwitches(); + for (base::CommandLine::SwitchMap::const_iterator it = switches.begin(); it != switches.end(); ++it) { if (it->first == "input_file") { diff --git a/content/common/gpu/media/vaapi_video_encode_accelerator.cc b/content/common/gpu/media/vaapi_video_encode_accelerator.cc index fa45ca9..32f9f4f 100644 --- a/content/common/gpu/media/vaapi_video_encode_accelerator.cc +++ b/content/common/gpu/media/vaapi_video_encode_accelerator.cc @@ -109,7 +109,7 @@ std::vector<media::VideoEncodeAccelerator::SupportedProfile> VaapiVideoEncodeAccelerator::GetSupportedProfiles() { std::vector<SupportedProfile> profiles; - const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); if (!cmd_line->HasSwitch(switches::kEnableVaapiAcceleratedVideoEncode)) return profiles; diff --git a/content/common/gpu/media/video_decode_accelerator_unittest.cc b/content/common/gpu/media/video_decode_accelerator_unittest.cc index c2b77a3..071dced 100644 --- a/content/common/gpu/media/video_decode_accelerator_unittest.cc +++ b/content/common/gpu/media/video_decode_accelerator_unittest.cc @@ -1420,17 +1420,17 @@ TEST_F(VideoDecodeAcceleratorTest, TestDecodeTimeMedian) { int main(int argc, char **argv) { testing::InitGoogleTest(&argc, argv); // Removes gtest-specific args. - CommandLine::Init(argc, argv); + base::CommandLine::Init(argc, argv); // Needed to enable DVLOG through --vmodule. logging::LoggingSettings settings; settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; CHECK(logging::InitLogging(settings)); - CommandLine* cmd_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); DCHECK(cmd_line); - CommandLine::SwitchMap switches = cmd_line->GetSwitches(); + base::CommandLine::SwitchMap switches = cmd_line->GetSwitches(); for (CommandLine::SwitchMap::const_iterator it = switches.begin(); it != switches.end(); ++it) { if (it->first == "test_video_data") { diff --git a/content/common/gpu/media/video_encode_accelerator_unittest.cc b/content/common/gpu/media/video_encode_accelerator_unittest.cc index b07211d..9d1e3b6 100644 --- a/content/common/gpu/media/video_encode_accelerator_unittest.cc +++ b/content/common/gpu/media/video_encode_accelerator_unittest.cc @@ -1029,7 +1029,7 @@ INSTANTIATE_TEST_CASE_P( int main(int argc, char** argv) { testing::InitGoogleTest(&argc, argv); // Removes gtest-specific args. - CommandLine::Init(argc, argv); + base::CommandLine::Init(argc, argv); base::ShadowingAtExitManager at_exit_manager; scoped_ptr<base::FilePath::StringType> test_stream_data( @@ -1043,11 +1043,11 @@ int main(int argc, char** argv) { settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; CHECK(logging::InitLogging(settings)); - CommandLine* cmd_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); DCHECK(cmd_line); - CommandLine::SwitchMap switches = cmd_line->GetSwitches(); - for (CommandLine::SwitchMap::const_iterator it = switches.begin(); + base::CommandLine::SwitchMap switches = cmd_line->GetSwitches(); + for (base::CommandLine::SwitchMap::const_iterator it = switches.begin(); it != switches.end(); ++it) { if (it->first == "test_stream_data") { diff --git a/content/common/gpu/texture_image_transport_surface.cc b/content/common/gpu/texture_image_transport_surface.cc index 0ab94e3..f51f545 100644 --- a/content/common/gpu/texture_image_transport_surface.cc +++ b/content/common/gpu/texture_image_transport_surface.cc @@ -73,7 +73,8 @@ bool TextureImageTransportSurface::Initialize() { GpuChannel* parent_channel = manager->LookupChannel(handle_.parent_client_id); if (parent_channel) { - const CommandLine* command_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* command_line = + base::CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(switches::kUIPrioritizeInGpuProcess)) helper_->SetPreemptByFlag(parent_channel->GetPreemptionFlag()); } diff --git a/content/common/handle_enumerator_win.cc b/content/common/handle_enumerator_win.cc index 0b8cbe5..9816550 100644 --- a/content/common/handle_enumerator_win.cc +++ b/content/common/handle_enumerator_win.cc @@ -52,7 +52,7 @@ const size_t kMaxHandleNameLength = 1024; void HandleEnumerator::EnumerateHandles() { sandbox::HandleTable handles; std::string process_type = - CommandLine::ForCurrentProcess()->GetSwitchValueASCII( + base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( switches::kProcessType); base::string16 output = ASCIIToUTF16(process_type); output.append(ASCIIToUTF16(" process - Handles at shutdown:\n")); diff --git a/content/common/pepper_plugin_list.cc b/content/common/pepper_plugin_list.cc index fac77f6..3a3e0e0 100644 --- a/content/common/pepper_plugin_list.cc +++ b/content/common/pepper_plugin_list.cc @@ -36,11 +36,12 @@ void ComputePluginsFromCommandLine(std::vector<PepperPluginInfo>* plugins) { max_plugins_to_register_from_command_line_exceeds_limit); bool out_of_process = true; - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kPpapiInProcess)) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kPpapiInProcess)) out_of_process = false; const std::string value = - CommandLine::ForCurrentProcess()->GetSwitchValueASCII( + base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( switches::kRegisterPepperPlugins); if (value.empty()) return; diff --git a/content/common/plugin_list.cc b/content/common/plugin_list.cc index e89aaf9..a0f9507 100644 --- a/content/common/plugin_list.cc +++ b/content/common/plugin_list.cc @@ -36,7 +36,7 @@ PluginList* PluginList::Singleton() { // static bool PluginList::DebugPluginLoading() { - return CommandLine::ForCurrentProcess()->HasSwitch( + return base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kDebugPluginLoading); } diff --git a/content/common/sandbox_init_mac.cc b/content/common/sandbox_init_mac.cc index d6f2112..fd96041 100644 --- a/content/common/sandbox_init_mac.cc +++ b/content/common/sandbox_init_mac.cc @@ -31,7 +31,8 @@ bool GetSandboxTypeFromCommandLine(int* sandbox_type, *sandbox_type = -1; *allowed_dir = base::FilePath(); // Empty by default. - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); if (command_line.HasSwitch(switches::kNoSandbox)) return false; diff --git a/content/common/sandbox_init_win.cc b/content/common/sandbox_init_win.cc index 7d9d920..16e3e4a 100644 --- a/content/common/sandbox_init_win.cc +++ b/content/common/sandbox_init_win.cc @@ -14,7 +14,8 @@ namespace content { bool InitializeSandbox(sandbox::SandboxInterfaceInfo* sandbox_info) { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); sandbox::BrokerServices* broker_services = sandbox_info->broker_services; if (broker_services) { if (!InitBrokerServices(broker_services)) diff --git a/content/common/sandbox_linux/bpf_gpu_policy_linux.cc b/content/common/sandbox_linux/bpf_gpu_policy_linux.cc index c30c166a..673e59d 100644 --- a/content/common/sandbox_linux/bpf_gpu_policy_linux.cc +++ b/content/common/sandbox_linux/bpf_gpu_policy_linux.cc @@ -73,7 +73,8 @@ inline bool IsArchitectureArm() { } bool IsAcceleratedVideoEnabled() { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); bool accelerated_encode_enabled = false; #if defined(OS_CHROMEOS) accelerated_encode_enabled = @@ -143,12 +144,13 @@ ResultExpr GpuBrokerProcessPolicy::EvaluateSyscall(int sysno) const { } void UpdateProcessTypeToGpuBroker() { - CommandLine::StringVector exec = CommandLine::ForCurrentProcess()->GetArgs(); - CommandLine::Reset(); - CommandLine::Init(0, NULL); - CommandLine::ForCurrentProcess()->InitFromArgv(exec); - CommandLine::ForCurrentProcess()->AppendSwitchASCII(switches::kProcessType, - "gpu-broker"); + base::CommandLine::StringVector exec = + base::CommandLine::ForCurrentProcess()->GetArgs(); + base::CommandLine::Reset(); + base::CommandLine::Init(0, NULL); + base::CommandLine::ForCurrentProcess()->InitFromArgv(exec); + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( + switches::kProcessType, "gpu-broker"); // Update the process title. The argv was already cached by the call to // SetProcessTitleFromCommandLine in content_main_runner.cc, so we can pass diff --git a/content/common/sandbox_linux/sandbox_linux.cc b/content/common/sandbox_linux/sandbox_linux.cc index 88afef9..e15aa18 100644 --- a/content/common/sandbox_linux/sandbox_linux.cc +++ b/content/common/sandbox_linux/sandbox_linux.cc @@ -52,7 +52,8 @@ struct FDCloser { }; void LogSandboxStarted(const std::string& sandbox_name) { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); const std::string process_type = command_line.GetSwitchValueASCII(switches::kProcessType); const std::string activated_sandbox = @@ -260,7 +261,7 @@ bool LinuxSandbox::StartSeccompBPF(const std::string& process_type) { } bool LinuxSandbox::InitializeSandboxImpl() { - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); const std::string process_type = command_line->GetSwitchValueASCII(switches::kProcessType); @@ -335,7 +336,7 @@ bool LinuxSandbox::seccomp_bpf_supported() const { bool LinuxSandbox::LimitAddressSpace(const std::string& process_type) { (void) process_type; #if !defined(ADDRESS_SANITIZER) && !defined(MEMORY_SANITIZER) - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(switches::kNoSandbox)) { return false; } diff --git a/content/common/sandbox_linux/sandbox_seccomp_bpf_linux.cc b/content/common/sandbox_linux/sandbox_seccomp_bpf_linux.cc index ae856ee..c9fda1d 100644 --- a/content/common/sandbox_linux/sandbox_seccomp_bpf_linux.cc +++ b/content/common/sandbox_linux/sandbox_seccomp_bpf_linux.cc @@ -158,7 +158,8 @@ void StartSandboxWithPolicy(sandbox::SandboxBPFPolicy* policy) { // in its dependencies. Make sure to not link things that are not needed. #if !defined(IN_NACL_HELPER) scoped_ptr<SandboxBPFBasePolicy> GetGpuProcessSandbox() { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); bool allow_sysv_shm = false; if (command_line.HasSwitch(switches::kGpuSandboxAllowSysVShm)) { DCHECK(IsArchitectureArm()); @@ -174,7 +175,7 @@ scoped_ptr<SandboxBPFBasePolicy> GetGpuProcessSandbox() { } // Initialize the seccomp-bpf sandbox. -bool StartBPFSandbox(const CommandLine& command_line, +bool StartBPFSandbox(const base::CommandLine& command_line, const std::string& process_type) { scoped_ptr<SandboxBPFBasePolicy> policy; @@ -199,7 +200,7 @@ bool StartBPFSandbox(const CommandLine& command_line, return true; } #else // defined(IN_NACL_HELPER) -bool StartBPFSandbox(const CommandLine& command_line, +bool StartBPFSandbox(const base::CommandLine& command_line, const std::string& process_type) { NOTREACHED(); // Avoid -Wunused-function with no-op code. @@ -216,7 +217,8 @@ bool StartBPFSandbox(const CommandLine& command_line, // Is seccomp BPF globally enabled? bool SandboxSeccompBPF::IsSeccompBPFDesired() { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); if (!command_line.HasSwitch(switches::kNoSandbox) && !command_line.HasSwitch(switches::kDisableSeccompFilterSandbox)) { return true; @@ -228,7 +230,8 @@ bool SandboxSeccompBPF::IsSeccompBPFDesired() { bool SandboxSeccompBPF::ShouldEnableSeccompBPF( const std::string& process_type) { #if defined(USE_SECCOMP_BPF) - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); if (process_type == switches::kGpuProcess) return !command_line.HasSwitch(switches::kDisableGpuSandbox); @@ -256,7 +259,8 @@ bool SandboxSeccompBPF::SupportsSandbox() { bool SandboxSeccompBPF::StartSandbox(const std::string& process_type) { #if defined(USE_SECCOMP_BPF) - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); if (IsSeccompBPFDesired() && // Global switches policy. ShouldEnableSeccompBPF(process_type) && // Process-specific policy. diff --git a/content/common/sandbox_mac.mm b/content/common/sandbox_mac.mm index f4ea8d5..88a4bcc 100644 --- a/content/common/sandbox_mac.mm +++ b/content/common/sandbox_mac.mm @@ -526,7 +526,8 @@ bool Sandbox::EnableSandbox(int sandbox_type, // Enable verbose logging if enabled on the command line. (See common.sb // for details). - const CommandLine* command_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* command_line = + base::CommandLine::ForCurrentProcess(); bool enable_logging = command_line->HasSwitch(switches::kEnableSandboxLogging);; if (enable_logging) { diff --git a/content/common/sandbox_win.cc b/content/common/sandbox_win.cc index 69b3795..8065621 100644 --- a/content/common/sandbox_win.cc +++ b/content/common/sandbox_win.cc @@ -243,7 +243,7 @@ base::string16 PrependWindowsSessionPath(const base::char16* object) { } // Checks if the sandbox should be let to run without a job object assigned. -bool ShouldSetJobLevel(const CommandLine& cmd_line) { +bool ShouldSetJobLevel(const base::CommandLine& cmd_line) { if (!cmd_line.HasSwitch(switches::kAllowNoSandboxJob)) return true; @@ -379,8 +379,9 @@ bool AddPolicyForSandboxedProcess(sandbox::TargetPolicy* policy) { // Updates the command line arguments with debug-related flags. If debug flags // have been used with this process, they will be filtered and added to // command_line as needed. -void ProcessDebugFlags(CommandLine* command_line) { - const CommandLine& current_cmd_line = *CommandLine::ForCurrentProcess(); +void ProcessDebugFlags(base::CommandLine* command_line) { + const base::CommandLine& current_cmd_line = + *base::CommandLine::ForCurrentProcess(); std::string type = command_line->GetSwitchValueASCII(switches::kProcessType); if (current_cmd_line.HasSwitch(switches::kWaitForDebuggerChildren)) { // Look to pass-on the kWaitForDebugger flag. @@ -500,7 +501,7 @@ BOOL WINAPI DuplicateHandlePatch(HANDLE source_process_handle, } // namespace -void SetJobLevel(const CommandLine& cmd_line, +void SetJobLevel(const base::CommandLine& cmd_line, sandbox::JobLevel job_level, uint32 ui_exceptions, sandbox::TargetPolicy* policy) { @@ -586,7 +587,8 @@ bool ShouldUseDirectWrite() { } // If forced off, don't use it. - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); if (command_line.HasSwitch(switches::kDisableDirectWrite)) return false; @@ -604,8 +606,9 @@ bool ShouldUseDirectWrite() { base::ProcessHandle StartSandboxedProcess( SandboxedProcessLauncherDelegate* delegate, - CommandLine* cmd_line) { - const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); + base::CommandLine* cmd_line) { + const base::CommandLine& browser_command_line = + *base::CommandLine::ForCurrentProcess(); std::string type_str = cmd_line->GetSwitchValueASCII(switches::kProcessType); TRACE_EVENT_BEGIN_ETW("StartProcessWithAccess", 0, type_str); |