diff options
author | avi <avi@chromium.org> | 2014-12-22 16:27:27 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-23 00:28:12 +0000 |
commit | 429bbdd261e1530b951ba528081343d2c9947408 (patch) | |
tree | a5c0f82288df21d027b3ea2a3e96acbf99cf3340 /media | |
parent | 3a928a843fe9b2a13885d1f488d95465b5e5d0f1 (diff) | |
download | chromium_src-429bbdd261e1530b951ba528081343d2c9947408.zip chromium_src-429bbdd261e1530b951ba528081343d2c9947408.tar.gz chromium_src-429bbdd261e1530b951ba528081343d2c9947408.tar.bz2 |
Make callers of CommandLine use it via the base:: namespace.
Covers jingle/, media/, ppapi/, remoting/, rlz/, skia/, and sync/.
BUG=422426
TEST=none
TBR=ben@chromium.org
Review URL: https://codereview.chromium.org/819203002
Cr-Commit-Position: refs/heads/master@{#309502}
Diffstat (limited to 'media')
25 files changed, 45 insertions, 41 deletions
diff --git a/media/audio/alsa/audio_manager_alsa.cc b/media/audio/alsa/audio_manager_alsa.cc index 7624834..3d74bb0 100644 --- a/media/audio/alsa/audio_manager_alsa.cc +++ b/media/audio/alsa/audio_manager_alsa.cc @@ -50,7 +50,7 @@ static const char* kInvalidAudioInputDevices[] = { // static void AudioManagerAlsa::ShowLinuxAudioInputSettings() { scoped_ptr<base::Environment> env(base::Environment::Create()); - CommandLine command_line(CommandLine::NO_PROGRAM); + base::CommandLine command_line(base::CommandLine::NO_PROGRAM); switch (base::nix::GetDesktopEnvironment(env.get())) { case base::nix::DESKTOP_ENVIRONMENT_GNOME: command_line.SetProgram(base::FilePath("gnome-volume-control")); @@ -335,9 +335,9 @@ AudioParameters AudioManagerAlsa::GetPreferredOutputStreamParameters( AudioOutputStream* AudioManagerAlsa::MakeOutputStream( const AudioParameters& params) { std::string device_name = AlsaPcmOutputStream::kAutoSelectDevice; - if (CommandLine::ForCurrentProcess()->HasSwitch( + if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kAlsaOutputDevice)) { - device_name = CommandLine::ForCurrentProcess()->GetSwitchValueASCII( + device_name = base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( switches::kAlsaOutputDevice); } return new AlsaPcmOutputStream(device_name, params, wrapper_.get(), this); @@ -347,8 +347,9 @@ AudioInputStream* AudioManagerAlsa::MakeInputStream( const AudioParameters& params, const std::string& device_id) { std::string device_name = (device_id == AudioManagerBase::kDefaultDeviceId) ? AlsaPcmInputStream::kAutoSelectDevice : device_id; - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAlsaInputDevice)) { - device_name = CommandLine::ForCurrentProcess()->GetSwitchValueASCII( + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAlsaInputDevice)) { + device_name = base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( switches::kAlsaInputDevice); } diff --git a/media/audio/audio_manager_base.cc b/media/audio/audio_manager_base.cc index 275ec33..edaabf4 100644 --- a/media/audio/audio_manager_base.cc +++ b/media/audio/audio_manager_base.cc @@ -385,7 +385,7 @@ std::string AudioManagerBase::GetDefaultOutputDeviceID() { } int AudioManagerBase::GetUserBufferSize() { - const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); int buffer_size = 0; std::string buffer_size_str(cmd_line->GetSwitchValueASCII( switches::kAudioBufferSize)); diff --git a/media/audio/fake_audio_input_stream.cc b/media/audio/fake_audio_input_stream.cc index 43804cb..517117a 100644 --- a/media/audio/fake_audio_input_stream.cc +++ b/media/audio/fake_audio_input_stream.cc @@ -151,9 +151,9 @@ bool FakeAudioInputStream::Open() { memset(buffer_.get(), 0, buffer_size_); audio_bus_->Zero(); - if (CommandLine::ForCurrentProcess()->HasSwitch( - switches::kUseFileForFakeAudioCapture)) { - OpenInFileMode(CommandLine::ForCurrentProcess()->GetSwitchValuePath( + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kUseFileForFakeAudioCapture)) { + OpenInFileMode(base::CommandLine::ForCurrentProcess()->GetSwitchValuePath( switches::kUseFileForFakeAudioCapture)); } diff --git a/media/audio/linux/audio_manager_linux.cc b/media/audio/linux/audio_manager_linux.cc index e7824b4..0e7c981 100644 --- a/media/audio/linux/audio_manager_linux.cc +++ b/media/audio/linux/audio_manager_linux.cc @@ -28,7 +28,7 @@ enum LinuxAudioIO { AudioManager* CreateAudioManager(AudioLogFactory* audio_log_factory) { #if defined(USE_CRAS) - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseCras)) { + if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseCras)) { UMA_HISTOGRAM_ENUMERATION("Media.LinuxAudioIO", kCras, kAudioIOMax + 1); return new AudioManagerCras(audio_log_factory); } diff --git a/media/audio/win/audio_low_latency_output_win.cc b/media/audio/win/audio_low_latency_output_win.cc index c3cf9c0..35714f0 100644 --- a/media/audio/win/audio_low_latency_output_win.cc +++ b/media/audio/win/audio_low_latency_output_win.cc @@ -27,7 +27,7 @@ namespace media { // static AUDCLNT_SHAREMODE WASAPIAudioOutputStream::GetShareMode() { - const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); if (cmd_line->HasSwitch(switches::kEnableExclusiveAudio)) return AUDCLNT_SHAREMODE_EXCLUSIVE; return AUDCLNT_SHAREMODE_SHARED; diff --git a/media/audio/win/audio_manager_win.cc b/media/audio/win/audio_manager_win.cc index 926eb3a..c09fb46 100644 --- a/media/audio/win/audio_manager_win.cc +++ b/media/audio/win/audio_manager_win.cc @@ -112,8 +112,9 @@ static base::string16 GetDeviceAndDriverInfo(HDEVINFO device_info, static int NumberOfWaveOutBuffers() { // Use the user provided buffer count if provided. int buffers = 0; - std::string buffers_str(CommandLine::ForCurrentProcess()->GetSwitchValueASCII( - switches::kWaveOutBuffers)); + std::string buffers_str( + base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( + switches::kWaveOutBuffers)); if (base::StringToInt(buffers_str, &buffers) && buffers > 0) { return buffers; } @@ -258,7 +259,7 @@ void AudioManagerWin::ShowAudioInputSettings() { base::FilePath path; PathService::Get(base::DIR_SYSTEM, &path); path = path.Append(program); - CommandLine command_line(path); + base::CommandLine command_line(path); command_line.AppendArg(argument); base::LaunchProcess(command_line, base::LaunchOptions()); } @@ -418,7 +419,7 @@ AudioParameters AudioManagerWin::GetPreferredOutputStreamParameters( DLOG_IF(ERROR, !core_audio_supported() && !output_device_id.empty()) << "CoreAudio is required to open non-default devices."; - const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); ChannelLayout channel_layout = CHANNEL_LAYOUT_STEREO; int sample_rate = 48000; int buffer_size = kFallbackBufferSize; diff --git a/media/audio/win/core_audio_util_win.cc b/media/audio/win/core_audio_util_win.cc index fdf5966..b56d6e6 100644 --- a/media/audio/win/core_audio_util_win.cc +++ b/media/audio/win/core_audio_util_win.cc @@ -158,7 +158,7 @@ static std::string GetDeviceID(IMMDevice* device) { bool CoreAudioUtil::IsSupported() { // It is possible to force usage of WaveXxx APIs by using a command line flag. - const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); if (cmd_line->HasSwitch(switches::kForceWaveAudio)) { DVLOG(1) << "Forcing usage of Windows WaveXxx APIs"; return false; @@ -197,7 +197,7 @@ base::TimeDelta CoreAudioUtil::RefererenceTimeToTimeDelta(REFERENCE_TIME time) { } AUDCLNT_SHAREMODE CoreAudioUtil::GetShareMode() { - const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); if (cmd_line->HasSwitch(switches::kEnableExclusiveAudio)) return AUDCLNT_SHAREMODE_EXCLUSIVE; return AUDCLNT_SHAREMODE_SHARED; diff --git a/media/base/android/browser_cdm_factory_android.cc b/media/base/android/browser_cdm_factory_android.cc index 9fa308e..12fedfe 100644 --- a/media/base/android/browser_cdm_factory_android.cc +++ b/media/base/android/browser_cdm_factory_android.cc @@ -38,7 +38,7 @@ scoped_ptr<BrowserCdm> BrowserCdmFactoryAndroid::CreateBrowserCdm( // TODO(xhwang/ddorwin): Pass the security level from key system. MediaDrmBridge::SecurityLevel security_level = MediaDrmBridge::SECURITY_LEVEL_3; - if (CommandLine::ForCurrentProcess()->HasSwitch( + if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kMediaDrmEnableNonCompositing)) { security_level = MediaDrmBridge::SECURITY_LEVEL_1; } diff --git a/media/base/mac/avfoundation_glue.mm b/media/base/mac/avfoundation_glue.mm index 34b67c9..0c48e4b 100644 --- a/media/base/mac/avfoundation_glue.mm +++ b/media/base/mac/avfoundation_glue.mm @@ -126,7 +126,8 @@ bool IsAVFoundationSupportedHelper() { return false; } - const CommandLine* command_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* command_line = + base::CommandLine::ForCurrentProcess(); // The force-qtkit flag takes precedence over enable-avfoundation. if (command_line->HasSwitch(switches::kForceQTKit)) { LogCaptureApi(CAPTURE_API_QTKIT_FORCED_BY_FLAG); diff --git a/media/base/pipeline.cc b/media/base/pipeline.cc index d6ed651..3d210d4 100644 --- a/media/base/pipeline.cc +++ b/media/base/pipeline.cc @@ -685,7 +685,7 @@ void Pipeline::RunEndedCallbackIfNeeded() { scoped_ptr<TextRenderer> Pipeline::CreateTextRenderer() { DCHECK(task_runner_->BelongsToCurrentThread()); - const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); if (!cmd_line->HasSwitch(switches::kEnableInbandTextTracks)) return scoped_ptr<media::TextRenderer>(); diff --git a/media/cast/test/cast_benchmarks.cc b/media/cast/test/cast_benchmarks.cc index c97bfc6..214f3a5 100644 --- a/media/cast/test/cast_benchmarks.cc +++ b/media/cast/test/cast_benchmarks.cc @@ -698,7 +698,7 @@ class CastBenchmark { threads[i]->Start(); } - if (CommandLine::ForCurrentProcess()->HasSwitch("single-run")) { + if (base::CommandLine::ForCurrentProcess()->HasSwitch("single-run")) { SearchVector a; a.bitrate.base = 100.0; a.bitrate.grade = 1.0; @@ -743,7 +743,7 @@ class CastBenchmark { int main(int argc, char** argv) { base::AtExitManager at_exit; - CommandLine::Init(argc, argv); + base::CommandLine::Init(argc, argv); media::cast::CastBenchmark benchmark; if (getenv("PROFILE_FILE")) { std::string profile_file(getenv("PROFILE_FILE")); diff --git a/media/cast/test/receiver.cc b/media/cast/test/receiver.cc index 72dda69..f30e749 100644 --- a/media/cast/test/receiver.cc +++ b/media/cast/test/receiver.cc @@ -540,7 +540,7 @@ class NaivePlayer : public InProcessReceiver, int main(int argc, char** argv) { base::AtExitManager at_exit; - CommandLine::Init(argc, argv); + base::CommandLine::Init(argc, argv); InitLogging(logging::LoggingSettings()); scoped_refptr<media::cast::CastEnvironment> cast_environment( diff --git a/media/cast/test/sender.cc b/media/cast/test/sender.cc index b61bd3a..d9cee32 100644 --- a/media/cast/test/sender.cc +++ b/media/cast/test/sender.cc @@ -249,7 +249,7 @@ void WriteStatsAndDestroySubscribers( int main(int argc, char** argv) { base::AtExitManager at_exit; - CommandLine::Init(argc, argv); + base::CommandLine::Init(argc, argv); InitLogging(logging::LoggingSettings()); // Load the media module for FFmpeg decoding. @@ -270,7 +270,7 @@ int main(int argc, char** argv) { base::MessageLoopForIO io_message_loop; // Default parameters. - CommandLine* cmd = CommandLine::ForCurrentProcess(); + base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); std::string remote_ip_address = cmd->GetSwitchValueASCII(kSwitchAddress); if (remote_ip_address.empty()) remote_ip_address = "127.0.0.1"; diff --git a/media/cast/test/simulator.cc b/media/cast/test/simulator.cc index 10b56d1..d63f6e5 100644 --- a/media/cast/test/simulator.cc +++ b/media/cast/test/simulator.cc @@ -100,7 +100,7 @@ const char kYuvOutputPath[] = "yuv-output"; int GetIntegerSwitchValue(const char* switch_name, int default_value) { const std::string as_str = - CommandLine::ForCurrentProcess()->GetSwitchValueASCII(switch_name); + base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(switch_name); if (as_str.empty()) return default_value; int as_int; @@ -692,7 +692,7 @@ bool IsModelValid(const NetworkSimulationModel& model) { } NetworkSimulationModel LoadModel(const base::FilePath& model_path) { - if (CommandLine::ForCurrentProcess()->HasSwitch(kNoSimulation)) { + if (base::CommandLine::ForCurrentProcess()->HasSwitch(kNoSimulation)) { NetworkSimulationModel model; model.set_type(media::cast::proto::NO_SIMULATION); return model; @@ -726,10 +726,10 @@ NetworkSimulationModel LoadModel(const base::FilePath& model_path) { int main(int argc, char** argv) { base::AtExitManager at_exit; - CommandLine::Init(argc, argv); + base::CommandLine::Init(argc, argv); InitLogging(logging::LoggingSettings()); - const CommandLine* cmd = CommandLine::ForCurrentProcess(); + const base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); base::FilePath media_path = cmd->GetSwitchValuePath(media::cast::kLibDir); if (media_path.empty()) { if (!PathService::Get(base::DIR_MODULE, &media_path)) { diff --git a/media/cast/test/utility/input_builder.cc b/media/cast/test/utility/input_builder.cc index 73dfb3f..6fbe506 100644 --- a/media/cast/test/utility/input_builder.cc +++ b/media/cast/test/utility/input_builder.cc @@ -29,7 +29,7 @@ InputBuilder::InputBuilder(const std::string& title, InputBuilder::~InputBuilder() {} std::string InputBuilder::GetStringInput() const { - if (!CommandLine::ForCurrentProcess()->HasSwitch(kEnablePromptsSwitch)) + if (!base::CommandLine::ForCurrentProcess()->HasSwitch(kEnablePromptsSwitch)) return default_value_; printf("\n%s\n", title_.c_str()); diff --git a/media/cast/test/utility/tap_proxy.cc b/media/cast/test/utility/tap_proxy.cc index eac7589..6aca4f3 100644 --- a/media/cast/test/utility/tap_proxy.cc +++ b/media/cast/test/utility/tap_proxy.cc @@ -266,7 +266,7 @@ int tun_alloc(char *dev, int flags) { int main(int argc, char **argv) { base::AtExitManager exit_manager; - CommandLine::Init(argc, argv); + base::CommandLine::Init(argc, argv); InitLogging(logging::LoggingSettings()); if (argc < 4) { diff --git a/media/cast/test/utility/udp_proxy_main.cc b/media/cast/test/utility/udp_proxy_main.cc index d2a03c6..c1e269d 100644 --- a/media/cast/test/utility/udp_proxy_main.cc +++ b/media/cast/test/utility/udp_proxy_main.cc @@ -123,7 +123,7 @@ void CheckByteCounters() { int main(int argc, char** argv) { base::AtExitManager at_exit; - CommandLine::Init(argc, argv); + base::CommandLine::Init(argc, argv); logging::LoggingSettings settings; settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; InitLogging(settings); diff --git a/media/filters/ffmpeg_video_decoder.cc b/media/filters/ffmpeg_video_decoder.cc index 93dcee2..fad6379 100644 --- a/media/filters/ffmpeg_video_decoder.cc +++ b/media/filters/ffmpeg_video_decoder.cc @@ -44,7 +44,7 @@ static int GetThreadCount(AVCodecID codec_id) { // Refer to http://crbug.com/93932 for tsan suppressions on decoding. int decode_threads = kDecodeThreads; - const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); std::string threads(cmd_line->GetSwitchValueASCII(switches::kVideoThreads)); if (threads.empty() || !base::StringToInt(threads, &decode_threads)) return decode_threads; diff --git a/media/filters/gpu_video_decoder.cc b/media/filters/gpu_video_decoder.cc index 150dd05..6601db8 100644 --- a/media/filters/gpu_video_decoder.cc +++ b/media/filters/gpu_video_decoder.cc @@ -117,7 +117,7 @@ static bool IsCodedSizeSupported(const gfx::Size& coded_size) { // V4L2VideoDecodeAccelerator. base::CPU cpu; bool hw_large_video_support = - CommandLine::ForCurrentProcess()->HasSwitch( + base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kIgnoreResolutionLimitsForAcceleratedVideoDecode) || ((cpu.vendor_name() == "GenuineIntel") && cpu.model() >= 55); bool os_large_video_support = true; diff --git a/media/filters/vpx_video_decoder.cc b/media/filters/vpx_video_decoder.cc index 2ca957d..b1415ee 100644 --- a/media/filters/vpx_video_decoder.cc +++ b/media/filters/vpx_video_decoder.cc @@ -51,7 +51,7 @@ static int GetThreadCount(const VideoDecoderConfig& config) { // Refer to http://crbug.com/93932 for tsan suppressions on decoding. int decode_threads = kDecodeThreads; - const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); std::string threads(cmd_line->GetSwitchValueASCII(switches::kVideoThreads)); if (threads.empty() || !base::StringToInt(threads, &decode_threads)) { if (config.codec() == kCodecVP9) { diff --git a/media/tools/player_x11/player_x11.cc b/media/tools/player_x11/player_x11.cc index c673723..c1719fa 100644 --- a/media/tools/player_x11/player_x11.cc +++ b/media/tools/player_x11/player_x11.cc @@ -229,8 +229,8 @@ int main(int argc, char** argv) { base::AtExitManager at_exit; media::InitializeMediaLibraryForTesting(); - CommandLine::Init(argc, argv); - CommandLine* command_line = CommandLine::ForCurrentProcess(); + base::CommandLine::Init(argc, argv); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); std::string filename = command_line->GetSwitchValueASCII("file"); if (filename.empty()) { diff --git a/media/video/capture/file_video_capture_device_factory.cc b/media/video/capture/file_video_capture_device_factory.cc index 8edcb4e..4749c2f 100644 --- a/media/video/capture/file_video_capture_device_factory.cc +++ b/media/video/capture/file_video_capture_device_factory.cc @@ -18,7 +18,7 @@ const char kFileVideoCaptureDeviceName[] = // Inspects the command line and retrieves the file path parameter. base::FilePath GetFilePathFromCommandLine() { base::FilePath command_line_file_path = - CommandLine::ForCurrentProcess()->GetSwitchValuePath( + base::CommandLine::ForCurrentProcess()->GetSwitchValuePath( switches::kUseFileForFakeVideoCapture); CHECK(!command_line_file_path.empty()); return command_line_file_path; diff --git a/media/video/capture/mac/video_capture_device_factory_mac_unittest.mm b/media/video/capture/mac/video_capture_device_factory_mac_unittest.mm index e015a2f..529a2fc 100644 --- a/media/video/capture/mac/video_capture_device_factory_mac_unittest.mm +++ b/media/video/capture/mac/video_capture_device_factory_mac_unittest.mm @@ -14,7 +14,7 @@ namespace media { class VideoCaptureDeviceFactoryMacTest : public testing::Test { virtual void SetUp() { - CommandLine::ForCurrentProcess()->AppendSwitch( + base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableAVFoundation); } }; diff --git a/media/video/capture/video_capture_device_factory.cc b/media/video/capture/video_capture_device_factory.cc index 73888e0..c87c39a 100644 --- a/media/video/capture/video_capture_device_factory.cc +++ b/media/video/capture/video_capture_device_factory.cc @@ -14,7 +14,8 @@ namespace media { // static scoped_ptr<VideoCaptureDeviceFactory> VideoCaptureDeviceFactory::CreateFactory( scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { - const CommandLine* command_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* command_line = + base::CommandLine::ForCurrentProcess(); // Use a Fake or File Video Device Factory if the command line flags are // present, otherwise use the normal, platform-dependent, device factory. if (command_line->HasSwitch(switches::kUseFakeDeviceForMediaStream)) { diff --git a/media/video/capture/win/video_capture_device_factory_win.cc b/media/video/capture/win/video_capture_device_factory_win.cc index cbd2eef..4e39c6e 100644 --- a/media/video/capture/win/video_capture_device_factory_win.cc +++ b/media/video/capture/win/video_capture_device_factory_win.cc @@ -383,7 +383,7 @@ VideoCaptureDeviceFactoryWin::VideoCaptureDeviceFactoryWin() { // DirectShow for any other versions, unless forced via flag. Media Foundation // can also be forced if appropriate flag is set and we are in Windows 7 or // 8 in non-Metro mode. - const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); + const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); use_media_foundation_ = (base::win::IsMetroProcess() && !cmd_line->HasSwitch(switches::kForceDirectShowVideoCapture)) || (base::win::GetVersion() >= base::win::VERSION_WIN7 && |