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

Side by Side Diff: chromeos/dbus/dbus_thread_manager.cc

Issue 825473002: Make callers of CommandLine use it via the base:: namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chromeos/dbus/dbus_client_bundle.cc ('k') | chromeos/dbus/fake_shill_manager_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chromeos/dbus/dbus_thread_manager.h" 5 #include "chromeos/dbus/dbus_thread_manager.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/sys_info.h" 8 #include "base/sys_info.h"
9 #include "base/threading/thread.h" 9 #include "base/threading/thread.h"
10 #include "chromeos/chromeos_switches.h" 10 #include "chromeos/chromeos_switches.h"
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 347
348 // static 348 // static
349 void DBusThreadManager::Initialize() { 349 void DBusThreadManager::Initialize() {
350 // If we initialize DBusThreadManager twice we may also be shutting it down 350 // If we initialize DBusThreadManager twice we may also be shutting it down
351 // early; do not allow that. 351 // early; do not allow that.
352 if (g_using_dbus_thread_manager_for_testing) 352 if (g_using_dbus_thread_manager_for_testing)
353 return; 353 return;
354 354
355 CHECK(!g_dbus_thread_manager); 355 CHECK(!g_dbus_thread_manager);
356 bool use_dbus_stub = !base::SysInfo::IsRunningOnChromeOS() || 356 bool use_dbus_stub = !base::SysInfo::IsRunningOnChromeOS() ||
357 CommandLine::ForCurrentProcess()->HasSwitch( 357 base::CommandLine::ForCurrentProcess()->HasSwitch(
358 chromeos::switches::kDbusStub); 358 chromeos::switches::kDbusStub);
359 bool force_unstub_clients = CommandLine::ForCurrentProcess()->HasSwitch( 359 bool force_unstub_clients = base::CommandLine::ForCurrentProcess()->HasSwitch(
360 chromeos::switches::kDbusUnstubClients); 360 chromeos::switches::kDbusUnstubClients);
361 // Determine whether we use stub or real client implementations. 361 // Determine whether we use stub or real client implementations.
362 if (force_unstub_clients) { 362 if (force_unstub_clients) {
363 InitializeWithPartialStub( 363 InitializeWithPartialStub(
364 CommandLine::ForCurrentProcess()->GetSwitchValueASCII( 364 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
365 chromeos::switches::kDbusUnstubClients)); 365 chromeos::switches::kDbusUnstubClients));
366 } else if (use_dbus_stub) { 366 } else if (use_dbus_stub) {
367 InitializeWithStubs(); 367 InitializeWithStubs();
368 } else { 368 } else {
369 InitializeWithRealClients(); 369 InitializeWithRealClients();
370 } 370 }
371 } 371 }
372 372
373 // static 373 // static
374 scoped_ptr<DBusThreadManagerSetter> DBusThreadManager::GetSetterForTesting() { 374 scoped_ptr<DBusThreadManagerSetter> DBusThreadManager::GetSetterForTesting() {
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 client.Pass(); 659 client.Pass();
660 } 660 }
661 661
662 void DBusThreadManagerSetter::SetUpdateEngineClient( 662 void DBusThreadManagerSetter::SetUpdateEngineClient(
663 scoped_ptr<UpdateEngineClient> client) { 663 scoped_ptr<UpdateEngineClient> client) {
664 DBusThreadManager::Get()->client_bundle_->update_engine_client_ = 664 DBusThreadManager::Get()->client_bundle_->update_engine_client_ =
665 client.Pass(); 665 client.Pass();
666 } 666 }
667 667
668 } // namespace chromeos 668 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/dbus_client_bundle.cc ('k') | chromeos/dbus/fake_shill_manager_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698