diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-02 05:12:33 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-02 05:12:33 +0000 |
commit | a3ef4830d5b5fdc52e5d7d0cb33dae8844f0961e (patch) | |
tree | bdd4dac76e6034ef6cf33450e203269a715ea0e6 /remoting/host | |
parent | 8bc574c57115e9ffd0169f33131c0865997dcb35 (diff) | |
download | chromium_src-a3ef4830d5b5fdc52e5d7d0cb33dae8844f0961e.zip chromium_src-a3ef4830d5b5fdc52e5d7d0cb33dae8844f0961e.tar.gz chromium_src-a3ef4830d5b5fdc52e5d7d0cb33dae8844f0961e.tar.bz2 |
Add FilePath to base namespace.
This updates headers that forward-declare it and a few random places to use the namespace explicitly. There us a using declaration in file_path.h that makes the rest compile, which we can do in future passes.
Review URL: https://codereview.chromium.org/12163003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180245 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host')
35 files changed, 117 insertions, 114 deletions
diff --git a/remoting/host/audio_capturer_linux.cc b/remoting/host/audio_capturer_linux.cc index 59e30e4..3dd6d68 100644 --- a/remoting/host/audio_capturer_linux.cc +++ b/remoting/host/audio_capturer_linux.cc @@ -27,7 +27,7 @@ base::LazyInstance<scoped_refptr<AudioPipeReader> >::Leaky // See crbug.com/161373 and crbug.com/104544. void AudioCapturerLinux::InitializePipeReader( scoped_refptr<base::SingleThreadTaskRunner> task_runner, - const FilePath& pipe_name) { + const base::FilePath& pipe_name) { scoped_refptr<AudioPipeReader> pipe_reader; if (!pipe_name.empty()) pipe_reader = AudioPipeReader::Create(task_runner, pipe_name); diff --git a/remoting/host/audio_capturer_linux.h b/remoting/host/audio_capturer_linux.h index b52f1ff..466ccf6 100644 --- a/remoting/host/audio_capturer_linux.h +++ b/remoting/host/audio_capturer_linux.h @@ -10,7 +10,9 @@ #include "remoting/host/audio_silence_detector.h" #include "remoting/host/linux/audio_pipe_reader.h" +namespace base { class FilePath; +} namespace remoting { @@ -24,7 +26,7 @@ class AudioCapturerLinux : public AudioCapturer, // to read from the pipe. static void InitializePipeReader( scoped_refptr<base::SingleThreadTaskRunner> task_runner, - const FilePath& pipe_name); + const base::FilePath& pipe_name); explicit AudioCapturerLinux( scoped_refptr<AudioPipeReader> pipe_reader); diff --git a/remoting/host/branding.cc b/remoting/host/branding.cc index c049854..908d9bc 100644 --- a/remoting/host/branding.cc +++ b/remoting/host/branding.cc @@ -16,17 +16,17 @@ namespace { // command-line switches are absent. #if defined(OS_WIN) #ifdef OFFICIAL_BUILD -const FilePath::CharType kConfigDir[] = +const base::FilePath::CharType kConfigDir[] = FILE_PATH_LITERAL("Google\\Chrome Remote Desktop"); #else -const FilePath::CharType kConfigDir[] = +const base::FilePath::CharType kConfigDir[] = FILE_PATH_LITERAL("Chromoting"); #endif #elif defined(OS_MACOSX) -const FilePath::CharType kConfigDir[] = +const base::FilePath::CharType kConfigDir[] = FILE_PATH_LITERAL("Chrome Remote Desktop"); #else -const FilePath::CharType kConfigDir[] = +const base::FilePath::CharType kConfigDir[] = FILE_PATH_LITERAL(".config/chrome-remote-desktop"); #endif @@ -38,8 +38,8 @@ namespace remoting { const wchar_t kWindowsServiceName[] = L"chromoting"; #endif -FilePath GetConfigDir() { - FilePath app_data_dir; +base::FilePath GetConfigDir() { + base::FilePath app_data_dir; #if defined(OS_WIN) PathService::Get(base::DIR_COMMON_APP_DATA, &app_data_dir); diff --git a/remoting/host/branding.h b/remoting/host/branding.h index c139fb4..a076bda 100644 --- a/remoting/host/branding.h +++ b/remoting/host/branding.h @@ -15,7 +15,7 @@ extern const wchar_t kWindowsServiceName[]; #endif // Returns the location of the host configuration directory. -FilePath GetConfigDir(); +base::FilePath GetConfigDir(); } // namespace remoting diff --git a/remoting/host/config_file_watcher.cc b/remoting/host/config_file_watcher.cc index 4e6b77a..0850460 100644 --- a/remoting/host/config_file_watcher.cc +++ b/remoting/host/config_file_watcher.cc @@ -21,7 +21,7 @@ namespace remoting { // file to use. const char kHostConfigSwitchName[] = "host-config"; -const FilePath::CharType kDefaultHostConfigFile[] = +const base::FilePath::CharType kDefaultHostConfigFile[] = FILE_PATH_LITERAL("host.json"); class ConfigFileWatcherImpl @@ -35,7 +35,7 @@ class ConfigFileWatcherImpl ConfigFileWatcher::Delegate* delegate); // Starts watching |config_path|. - void Watch(const FilePath& config_path); + void Watch(const base::FilePath& config_path); // Stops watching the configuration file. void StopWatching(); @@ -47,13 +47,13 @@ class ConfigFileWatcherImpl void FinishStopping(); // Called every time the host configuration file is updated. - void OnConfigUpdated(const FilePath& path, bool error); + void OnConfigUpdated(const base::FilePath& path, bool error); // Reads the configuration file and passes it to the delegate. void ReloadConfig(); std::string config_; - FilePath config_path_; + base::FilePath config_path_; scoped_ptr<base::DelayTimer<ConfigFileWatcherImpl> > config_updated_timer_; @@ -85,7 +85,7 @@ ConfigFileWatcher::~ConfigFileWatcher() { impl_ = NULL; } -void ConfigFileWatcher::Watch(const FilePath& config_path) { +void ConfigFileWatcher::Watch(const base::FilePath& config_path) { impl_->Watch(config_path); } @@ -100,7 +100,7 @@ ConfigFileWatcherImpl::ConfigFileWatcherImpl( DCHECK(main_task_runner_->BelongsToCurrentThread()); } -void ConfigFileWatcherImpl::Watch(const FilePath& config_path) { +void ConfigFileWatcherImpl::Watch(const base::FilePath& config_path) { if (!io_task_runner_->BelongsToCurrentThread()) { io_task_runner_->PostTask( FROM_HERE, @@ -156,7 +156,8 @@ void ConfigFileWatcherImpl::FinishStopping() { config_watcher_.reset(NULL); } -void ConfigFileWatcherImpl::OnConfigUpdated(const FilePath& path, bool error) { +void ConfigFileWatcherImpl::OnConfigUpdated(const base::FilePath& path, + bool error) { DCHECK(io_task_runner_->BelongsToCurrentThread()); // Call ReloadConfig() after a short delay, so that we will not try to read diff --git a/remoting/host/config_file_watcher.h b/remoting/host/config_file_watcher.h index 83e971a..9762296 100644 --- a/remoting/host/config_file_watcher.h +++ b/remoting/host/config_file_watcher.h @@ -17,7 +17,7 @@ class SingleThreadTaskRunner; namespace remoting { extern const char kHostConfigSwitchName[]; -extern const FilePath::CharType kDefaultHostConfigFile[]; +extern const base::FilePath::CharType kDefaultHostConfigFile[]; class ConfigFileWatcherImpl; @@ -44,7 +44,7 @@ class ConfigFileWatcher { virtual ~ConfigFileWatcher(); // Starts watching |config_path|. - void Watch(const FilePath& config_path); + void Watch(const base::FilePath& config_path); private: scoped_refptr<ConfigFileWatcherImpl> impl_; diff --git a/remoting/host/daemon_process.cc b/remoting/host/daemon_process.cc index e97341b..84f5b916 100644 --- a/remoting/host/daemon_process.cc +++ b/remoting/host/daemon_process.cc @@ -151,8 +151,8 @@ void DaemonProcess::Initialize() { DCHECK(caller_task_runner()->BelongsToCurrentThread()); // Get the name of the host configuration file. - FilePath default_config_dir = remoting::GetConfigDir(); - FilePath config_path = default_config_dir.Append(kDefaultHostConfigFile); + base::FilePath default_config_dir = remoting::GetConfigDir(); + base::FilePath config_path = default_config_dir.Append(kDefaultHostConfigFile); const CommandLine* command_line = CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(kHostConfigSwitchName)) { config_path = command_line->GetSwitchValuePath(kHostConfigSwitchName); diff --git a/remoting/host/daemon_process.h b/remoting/host/daemon_process.h index 801e271..45952bb 100644 --- a/remoting/host/daemon_process.h +++ b/remoting/host/daemon_process.h @@ -20,8 +20,6 @@ #include "remoting/host/config_file_watcher.h" #include "remoting/host/worker_process_ipc_delegate.h" -class FilePath; - namespace remoting { class AutoThreadTaskRunner; diff --git a/remoting/host/daemon_process_win.cc b/remoting/host/daemon_process_win.cc index 378eb52..51ee12a 100644 --- a/remoting/host/daemon_process_win.cc +++ b/remoting/host/daemon_process_win.cc @@ -143,7 +143,7 @@ void DaemonProcessWin::LaunchNetworkProcess() { DCHECK(!network_launcher_); // Construct the host binary name. - FilePath host_binary; + base::FilePath host_binary; if (!GetInstalledBinaryPath(kHostBinaryName, &host_binary)) { Stop(); return; diff --git a/remoting/host/desktop_process_main.cc b/remoting/host/desktop_process_main.cc index fa678de..5801c8d 100644 --- a/remoting/host/desktop_process_main.cc +++ b/remoting/host/desktop_process_main.cc @@ -47,7 +47,7 @@ const char kUsageMessage[] = "Options:\n" " --help, --? - Print this message.\n"; -void Usage(const FilePath& program_name) { +void Usage(const base::FilePath& program_name) { std::string display_name = UTF16ToUTF8(program_name.LossyDisplayName()); LOG(INFO) << StringPrintf(kUsageMessage, display_name.c_str()); } @@ -125,7 +125,7 @@ int CALLBACK WinMain(HINSTANCE instance, // Mark the process as DPI-aware, so Windows won't scale coordinates in APIs. // N.B. This API exists on Vista and above. if (base::win::GetVersion() >= base::win::VERSION_VISTA) { - FilePath path(base::GetNativeLibraryName(UTF8ToUTF16("user32"))); + base::FilePath path(base::GetNativeLibraryName(UTF8ToUTF16("user32"))); base::ScopedNativeLibrary user32(path); CHECK(user32.is_valid()); diff --git a/remoting/host/desktop_session_win.cc b/remoting/host/desktop_session_win.cc index ac28764..288aba5 100644 --- a/remoting/host/desktop_session_win.cc +++ b/remoting/host/desktop_session_win.cc @@ -18,7 +18,7 @@ using base::win::ScopedHandle; namespace { -const FilePath::CharType kDesktopBinaryName[] = +const base::FilePath::CharType kDesktopBinaryName[] = FILE_PATH_LITERAL("remoting_desktop.exe"); // The security descriptor of the daemon IPC endpoint. It gives full access @@ -95,7 +95,7 @@ void DesktopSessionWin::OnSessionAttached(uint32 session_id) { // Construct the host binary name. if (desktop_binary_.empty()) { - FilePath dir_path; + base::FilePath dir_path; if (!PathService::Get(base::DIR_EXE, &dir_path)) { LOG(ERROR) << "Failed to get the executable file name."; OnPermanentError(); diff --git a/remoting/host/desktop_session_win.h b/remoting/host/desktop_session_win.h index 89343c9..53b2fef 100644 --- a/remoting/host/desktop_session_win.h +++ b/remoting/host/desktop_session_win.h @@ -74,7 +74,7 @@ class DesktopSessionWin scoped_refptr<AutoThreadTaskRunner> io_task_runner_; // Contains the full path to the desktop binary. - FilePath desktop_binary_; + base::FilePath desktop_binary_; // Handle of the desktop process. base::win::ScopedHandle desktop_process_; diff --git a/remoting/host/host_key_pair_unittest.cc b/remoting/host/host_key_pair_unittest.cc index f19674f..2aa921c 100644 --- a/remoting/host/host_key_pair_unittest.cc +++ b/remoting/host/host_key_pair_unittest.cc @@ -33,7 +33,7 @@ class HostKeyPairTest : public testing::Test { protected: virtual void SetUp() { ASSERT_TRUE(test_dir_.CreateUniqueTempDir()); - FilePath config_path = test_dir_.path().AppendASCII("test_config.json"); + base::FilePath config_path = test_dir_.path().AppendASCII("test_config.json"); config_.reset(new JsonHostConfig(config_path)); } diff --git a/remoting/host/ipc_constants.cc b/remoting/host/ipc_constants.cc index 36d4bea..9aac903 100644 --- a/remoting/host/ipc_constants.cc +++ b/remoting/host/ipc_constants.cc @@ -12,20 +12,21 @@ namespace remoting { const char kDaemonPipeSwitchName[] = "daemon-pipe"; -const FilePath::CharType kDaemonBinaryName[] = +const base::FilePath::CharType kDaemonBinaryName[] = FILE_PATH_LITERAL("remoting_daemon"); -const FilePath::CharType kHostBinaryName[] = FILE_PATH_LITERAL("remoting_host"); +const base::FilePath::CharType kHostBinaryName[] = + FILE_PATH_LITERAL("remoting_host"); -bool GetInstalledBinaryPath(const FilePath::StringType& binary, - FilePath* full_path) { - FilePath dir_path; +bool GetInstalledBinaryPath(const base::FilePath::StringType& binary, + base::FilePath* full_path) { + base::FilePath dir_path; if (!PathService::Get(base::DIR_EXE, &dir_path)) { LOG(ERROR) << "Failed to get the executable file name."; return false; } - FilePath path = dir_path.Append(binary); + base::FilePath path = dir_path.Append(binary); #if defined(OS_WIN) path = path.ReplaceExtension(FILE_PATH_LITERAL("exe")); diff --git a/remoting/host/ipc_constants.h b/remoting/host/ipc_constants.h index 0e6ddc6..d990206 100644 --- a/remoting/host/ipc_constants.h +++ b/remoting/host/ipc_constants.h @@ -13,14 +13,14 @@ namespace remoting { extern const char kDaemonPipeSwitchName[]; // Name of the daemon process binary. -extern const FilePath::CharType kDaemonBinaryName[]; +extern const base::FilePath::CharType kDaemonBinaryName[]; // Name of the host process binary. -extern const FilePath::CharType kHostBinaryName[]; +extern const base::FilePath::CharType kHostBinaryName[]; // Returns the full path to an installed |binary| in |full_path|. -bool GetInstalledBinaryPath(const FilePath::StringType& binary, - FilePath* full_path); +bool GetInstalledBinaryPath(const base::FilePath::StringType& binary, + base::FilePath* full_path); } // namespace remoting diff --git a/remoting/host/json_host_config.cc b/remoting/host/json_host_config.cc index 82a9cf7..d25f4b5 100644 --- a/remoting/host/json_host_config.cc +++ b/remoting/host/json_host_config.cc @@ -15,7 +15,7 @@ namespace remoting { -JsonHostConfig::JsonHostConfig(const FilePath& filename) +JsonHostConfig::JsonHostConfig(const base::FilePath& filename) : filename_(filename) { } diff --git a/remoting/host/json_host_config.h b/remoting/host/json_host_config.h index c0148cc..c8a4aba 100644 --- a/remoting/host/json_host_config.h +++ b/remoting/host/json_host_config.h @@ -19,7 +19,7 @@ namespace remoting { // JsonHostConfig implements MutableHostConfig for JSON file. class JsonHostConfig : public InMemoryHostConfig { public: - JsonHostConfig(const FilePath& filename); + JsonHostConfig(const base::FilePath& filename); virtual ~JsonHostConfig(); virtual bool Read(); @@ -34,7 +34,7 @@ class JsonHostConfig : public InMemoryHostConfig { bool SetSerializedData(const std::string& config); private: - FilePath filename_; + base::FilePath filename_; DISALLOW_COPY_AND_ASSIGN(JsonHostConfig); }; diff --git a/remoting/host/json_host_config_unittest.cc b/remoting/host/json_host_config_unittest.cc index 4aedf3d..76f2912 100644 --- a/remoting/host/json_host_config_unittest.cc +++ b/remoting/host/json_host_config_unittest.cc @@ -24,7 +24,7 @@ const char* kTestConfig = class JsonHostConfigTest : public testing::Test { protected: - static void WriteTestFile(const FilePath& filename) { + static void WriteTestFile(const base::FilePath& filename) { file_util::WriteFile(filename, kTestConfig, std::strlen(kTestConfig)); } @@ -34,7 +34,7 @@ class JsonHostConfigTest : public testing::Test { TEST_F(JsonHostConfigTest, InvalidFile) { ASSERT_TRUE(test_dir_.CreateUniqueTempDir()); - FilePath non_existent_file = + base::FilePath non_existent_file = test_dir_.path().AppendASCII("non_existent.json"); JsonHostConfig target(non_existent_file); EXPECT_FALSE(target.Read()); @@ -42,7 +42,7 @@ TEST_F(JsonHostConfigTest, InvalidFile) { TEST_F(JsonHostConfigTest, Read) { ASSERT_TRUE(test_dir_.CreateUniqueTempDir()); - FilePath test_file = test_dir_.path().AppendASCII("read.json"); + base::FilePath test_file = test_dir_.path().AppendASCII("read.json"); WriteTestFile(test_file); JsonHostConfig target(test_file); ASSERT_TRUE(target.Read()); @@ -65,7 +65,7 @@ TEST_F(JsonHostConfigTest, Read) { TEST_F(JsonHostConfigTest, Write) { ASSERT_TRUE(test_dir_.CreateUniqueTempDir()); - FilePath test_file = test_dir_.path().AppendASCII("write.json"); + base::FilePath test_file = test_dir_.path().AppendASCII("write.json"); WriteTestFile(test_file); JsonHostConfig target(test_file); ASSERT_TRUE(target.Read()); diff --git a/remoting/host/linux/audio_pipe_reader.cc b/remoting/host/linux/audio_pipe_reader.cc index d396e89..c66839b 100644 --- a/remoting/host/linux/audio_pipe_reader.cc +++ b/remoting/host/linux/audio_pipe_reader.cc @@ -47,7 +47,7 @@ const int kPipeBufferSizeBytes = kPipeBufferSizeMs * kSampleBytesPerSecond / // static scoped_refptr<AudioPipeReader> AudioPipeReader::Create( scoped_refptr<base::SingleThreadTaskRunner> task_runner, - const FilePath& pipe_name) { + const base::FilePath& pipe_name) { // Create a reference to the new AudioPipeReader before posting the // StartOnAudioThread task, otherwise it may be deleted on the audio // thread before we return. @@ -58,7 +58,7 @@ scoped_refptr<AudioPipeReader> AudioPipeReader::Create( return pipe_reader; } -void AudioPipeReader::StartOnAudioThread(const FilePath& pipe_name) { +void AudioPipeReader::StartOnAudioThread(const base::FilePath& pipe_name) { DCHECK(task_runner_->BelongsToCurrentThread()); pipe_fd_ = HANDLE_EINTR(open( diff --git a/remoting/host/linux/audio_pipe_reader.h b/remoting/host/linux/audio_pipe_reader.h index b0c56e7..a373ac3 100644 --- a/remoting/host/linux/audio_pipe_reader.h +++ b/remoting/host/linux/audio_pipe_reader.h @@ -12,7 +12,9 @@ #include "base/time.h" #include "base/timer.h" +namespace base { class FilePath; +} namespace remoting { @@ -33,7 +35,7 @@ class AudioPipeReader // |task_runner| specifies the IO thread to use to read data from the pipe. static scoped_refptr<AudioPipeReader> Create( scoped_refptr<base::SingleThreadTaskRunner> task_runner, - const FilePath& pipe_name); + const base::FilePath& pipe_name); // Register or unregister an observer. Each observer receives data on the // thread on which it was registered and guaranteed not to be called after @@ -53,7 +55,7 @@ class AudioPipeReader AudioPipeReader(scoped_refptr<base::SingleThreadTaskRunner> task_runner); virtual ~AudioPipeReader(); - void StartOnAudioThread(const FilePath& pipe_name); + void StartOnAudioThread(const base::FilePath& pipe_name); void StartTimer(); void DoCapture(); void WaitForPipeReadable(); diff --git a/remoting/host/policy_hack/policy_watcher_linux.cc b/remoting/host/policy_hack/policy_watcher_linux.cc index 0df6120..1dc7b21 100644 --- a/remoting/host/policy_hack/policy_watcher_linux.cc +++ b/remoting/host/policy_hack/policy_watcher_linux.cc @@ -32,7 +32,7 @@ namespace policy_hack { namespace { -const FilePath::CharType kPolicyDir[] = +const base::FilePath::CharType kPolicyDir[] = // Always read the Chrome policies (even on Chromium) so that policy // enforcement can't be bypassed by running Chromium. FILE_PATH_LITERAL("/etc/opt/chrome/policies/managed"); @@ -47,7 +47,7 @@ const int kSettleIntervalSeconds = 5; class PolicyWatcherLinux : public PolicyWatcher { public: PolicyWatcherLinux(scoped_refptr<base::SingleThreadTaskRunner> task_runner, - const FilePath& config_dir) + const base::FilePath& config_dir) : PolicyWatcher(task_runner), config_dir_(config_dir), ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { @@ -89,7 +89,7 @@ class PolicyWatcherLinux : public PolicyWatcher { } private: - void OnFilePathChanged(const FilePath& path, bool error) { + void OnFilePathChanged(const base::FilePath& path, bool error) { DCHECK(OnPolicyWatcherThread()); if (!error) @@ -113,7 +113,7 @@ class PolicyWatcherLinux : public PolicyWatcher { file_util::FileEnumerator file_enumerator(config_dir_, false, file_util::FileEnumerator::FILES); - for (FilePath config_file = file_enumerator.Next(); + for (base::FilePath config_file = file_enumerator.Next(); !config_file.empty(); config_file = file_enumerator.Next()) { if (file_util::GetFileInfo(config_file, &file_info) && @@ -130,16 +130,16 @@ class PolicyWatcherLinux : public PolicyWatcher { scoped_ptr<DictionaryValue> Load() { DCHECK(OnPolicyWatcherThread()); // Enumerate the files and sort them lexicographically. - std::set<FilePath> files; + std::set<base::FilePath> files; file_util::FileEnumerator file_enumerator(config_dir_, false, file_util::FileEnumerator::FILES); - for (FilePath config_file_path = file_enumerator.Next(); + for (base::FilePath config_file_path = file_enumerator.Next(); !config_file_path.empty(); config_file_path = file_enumerator.Next()) files.insert(config_file_path); // Start with an empty dictionary and merge the files' contents. scoped_ptr<DictionaryValue> policy(new DictionaryValue()); - for (std::set<FilePath>::iterator config_file_iter = files.begin(); + for (std::set<base::FilePath>::iterator config_file_iter = files.begin(); config_file_iter != files.end(); ++config_file_iter) { JSONFileValueSerializer deserializer(*config_file_iter); deserializer.set_allow_trailing_comma(true); @@ -239,7 +239,7 @@ class PolicyWatcherLinux : public PolicyWatcher { // non-local filesystem involved. base::Time last_modification_clock_; - const FilePath config_dir_; + const base::FilePath config_dir_; // Allows us to cancel any inflight FileWatcher events or scheduled reloads. base::WeakPtrFactory<PolicyWatcherLinux> weak_factory_; @@ -247,7 +247,7 @@ class PolicyWatcherLinux : public PolicyWatcher { PolicyWatcher* PolicyWatcher::Create( scoped_refptr<base::SingleThreadTaskRunner> task_runner) { - FilePath policy_dir(kPolicyDir); + base::FilePath policy_dir(kPolicyDir); return new PolicyWatcherLinux(task_runner, policy_dir); } diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc index 0e3d948..995b52d 100644 --- a/remoting/host/remoting_me2me_host.cc +++ b/remoting/host/remoting_me2me_host.cc @@ -273,7 +273,7 @@ class HostProcess scoped_ptr<IPC::ChannelProxy> daemon_channel_; // Created on the UI thread but used from the network thread. - FilePath host_config_path_; + base::FilePath host_config_path_; scoped_ptr<DesktopEnvironmentFactory> desktop_environment_factory_; // Accessed on the network thread. @@ -402,7 +402,7 @@ bool HostProcess::InitWithCommandLine(const CommandLine* cmd_line) { context_->network_task_runner())); } - FilePath default_config_dir = remoting::GetConfigDir(); + base::FilePath default_config_dir = remoting::GetConfigDir(); host_config_path_ = default_config_dir.Append(kDefaultHostConfigFile); if (cmd_line->HasSwitch(kHostConfigSwitchName)) { host_config_path_ = cmd_line->GetSwitchValuePath(kHostConfigSwitchName); @@ -427,7 +427,7 @@ void HostProcess::OnConfigUpdated( LOG(INFO) << "Processing new host configuration."; serialized_config_ = serialized_config; - scoped_ptr<JsonHostConfig> config(new JsonHostConfig(FilePath())); + scoped_ptr<JsonHostConfig> config(new JsonHostConfig(base::FilePath())); if (!config->SetSerializedData(serialized_config)) { LOG(ERROR) << "Invalid configuration."; ShutdownHost(kInvalidHostConfigurationExitCode); @@ -558,7 +558,7 @@ void HostProcess::StartOnUiThread() { #if defined(OS_LINUX) // If an audio pipe is specific on the command-line then initialize // AudioCapturerLinux to capture from it. - FilePath audio_pipe_name = CommandLine::ForCurrentProcess()-> + base::FilePath audio_pipe_name = CommandLine::ForCurrentProcess()-> GetSwitchValuePath(kAudioPipeSwitchName); if (!audio_pipe_name.empty()) { remoting::AudioCapturerLinux::InitializePipeReader( @@ -641,7 +641,7 @@ void HostProcess::ShutdownOnUiThread() { // thread will remain in-use and prevent the process from exiting. // TODO(wez): DesktopEnvironmentFactory should own the pipe reader. // See crbug.com/161373 and crbug.com/104544. - AudioCapturerLinux::InitializePipeReader(NULL, FilePath()); + AudioCapturerLinux::InitializePipeReader(NULL, base::FilePath()); #endif } @@ -1135,7 +1135,7 @@ int CALLBACK WinMain(HINSTANCE instance, // Mark the process as DPI-aware, so Windows won't scale coordinates in APIs. // N.B. This API exists on Vista and above. if (base::win::GetVersion() >= base::win::VERSION_VISTA) { - FilePath path(base::GetNativeLibraryName(UTF8ToUTF16("user32"))); + base::FilePath path(base::GetNativeLibraryName(UTF8ToUTF16("user32"))); base::ScopedNativeLibrary user32(path); CHECK(user32.is_valid()); diff --git a/remoting/host/sas_injector_win.cc b/remoting/host/sas_injector_win.cc index efab8e6..a9bb80b 100644 --- a/remoting/host/sas_injector_win.cc +++ b/remoting/host/sas_injector_win.cc @@ -22,7 +22,7 @@ namespace remoting { namespace { // Names of the API and library implementing software SAS generation. -const FilePath::CharType kSasDllFileName[] = FILE_PATH_LITERAL("sas.dll"); +const base::FilePath::CharType kSasDllFileName[] = FILE_PATH_LITERAL("sas.dll"); const char kSendSasName[] = "SendSAS"; // The prototype of SendSAS(). @@ -144,7 +144,7 @@ bool SasInjectorWin::InjectSas() { // Load sas.dll. The library is expected to be in the same folder as this // binary. if (!sas_dll_.is_valid()) { - FilePath dir_path; + base::FilePath dir_path; if (!PathService::Get(base::DIR_EXE, &dir_path)) { LOG(ERROR) << "Failed to get the executable file name."; return false; diff --git a/remoting/host/setup/daemon_controller_linux.cc b/remoting/host/setup/daemon_controller_linux.cc index 121d77a..598b1db 100644 --- a/remoting/host/setup/daemon_controller_linux.cc +++ b/remoting/host/setup/daemon_controller_linux.cc @@ -68,7 +68,7 @@ class DaemonControllerLinux : public remoting::DaemonController { const GetUsageStatsConsentCallback& done) OVERRIDE; private: - FilePath GetConfigPath(); + base::FilePath GetConfigPath(); void DoGetConfig(const GetConfigCallback& callback); void DoSetConfigAndStart(scoped_ptr<base::DictionaryValue> config, @@ -88,8 +88,8 @@ DaemonControllerLinux::DaemonControllerLinux() file_io_thread_.Start(); } -static bool GetScriptPath(FilePath* result) { - FilePath candidate_exe(kDaemonScript); +static bool GetScriptPath(base::FilePath* result) { + base::FilePath candidate_exe(kDaemonScript); if (access(candidate_exe.value().c_str(), X_OK) == 0) { *result = candidate_exe; return true; @@ -106,7 +106,7 @@ static bool RunHostScriptWithTimeout( if (getuid() == 0) { return false; } - FilePath script_path; + base::FilePath script_path; if (!GetScriptPath(&script_path)) { return false; } @@ -200,7 +200,7 @@ void DaemonControllerLinux::GetVersion( done_callback)); } -FilePath DaemonControllerLinux::GetConfigPath() { +base::FilePath DaemonControllerLinux::GetConfigPath() { std::string filename = "host#" + GetMd5(net::GetHostName()) + ".json"; return file_util::GetHomeDir(). Append(".config/chrome-remote-desktop").Append(filename); @@ -245,7 +245,7 @@ void DaemonControllerLinux::DoSetConfigAndStart( } // Ensure the configuration directory exists. - FilePath config_dir = GetConfigPath().DirName(); + base::FilePath config_dir = GetConfigPath().DirName(); if (!file_util::DirectoryExists(config_dir) && !file_util::CreateDirectory(config_dir)) { LOG(ERROR) << "Failed to create config directory " << config_dir.value(); @@ -314,7 +314,7 @@ void DaemonControllerLinux::DoStop(const CompletionCallback& done_callback) { void DaemonControllerLinux::DoGetVersion( const GetVersionCallback& done_callback) { - FilePath script_path; + base::FilePath script_path; if (!GetScriptPath(&script_path)) { done_callback.Run(""); return; diff --git a/remoting/host/setup/daemon_controller_mac.cc b/remoting/host/setup/daemon_controller_mac.cc index 430077cd..95e1b1f 100644 --- a/remoting/host/setup/daemon_controller_mac.cc +++ b/remoting/host/setup/daemon_controller_mac.cc @@ -174,7 +174,7 @@ void DaemonControllerMac::GetUsageStatsConsent( } void DaemonControllerMac::DoGetConfig(const GetConfigCallback& callback) { - FilePath config_path(kHostConfigFilePath); + base::FilePath config_path(kHostConfigFilePath); JsonHostConfig host_config(config_path); scoped_ptr<base::DictionaryValue> config; @@ -227,7 +227,7 @@ void DaemonControllerMac::DoSetConfigAndStart( void DaemonControllerMac::DoUpdateConfig( scoped_ptr<base::DictionaryValue> config, const CompletionCallback& done_callback) { - FilePath config_file_path(kHostConfigFilePath); + base::FilePath config_file_path(kHostConfigFilePath); JsonHostConfig config_file(config_file_path); if (!config_file.Read()) { done_callback.Run(RESULT_FAILED); @@ -246,7 +246,7 @@ void DaemonControllerMac::DoUpdateConfig( void DaemonControllerMac::DoGetUsageStatsConsent( const GetUsageStatsConsentCallback& callback) { bool allowed = false; - FilePath config_file_path(kHostConfigFilePath); + base::FilePath config_file_path(kHostConfigFilePath); JsonHostConfig host_config(config_file_path); if (host_config.Read()) { host_config.GetBoolean(kUsageStatsConsentConfigPath, &allowed); @@ -266,7 +266,7 @@ void DaemonControllerMac::ShowPreferencePane( bool DaemonControllerMac::DoShowPreferencePane(const std::string& config_data) { if (!config_data.empty()) { - FilePath config_path; + base::FilePath config_path; if (!file_util::GetTempDir(&config_path)) { LOG(ERROR) << "Failed to get filename for saving configuration data."; return false; @@ -282,7 +282,7 @@ bool DaemonControllerMac::DoShowPreferencePane(const std::string& config_data) { } } - FilePath pane_path; + base::FilePath pane_path; // TODO(lambroslambrou): Use NSPreferencePanesDirectory once we start // building against SDK 10.6. if (!base::mac::GetLocalDirectory(NSLibraryDirectory, &pane_path)) { diff --git a/remoting/host/usage_stats_consent_mac.cc b/remoting/host/usage_stats_consent_mac.cc index 00655a4..db82d92 100644 --- a/remoting/host/usage_stats_consent_mac.cc +++ b/remoting/host/usage_stats_consent_mac.cc @@ -23,7 +23,7 @@ bool GetUsageStatsConsent(bool* allowed, bool* set_by_policy) { // which itself should happen as early as possible during startup. CommandLine* command_line = CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(kHostConfigSwitchName)) { - FilePath config_file_path = + base::FilePath config_file_path = command_line->GetSwitchValuePath(kHostConfigSwitchName); JsonHostConfig host_config(config_file_path); if (host_config.Read()) { diff --git a/remoting/host/win/elevated_controller.cc b/remoting/host/win/elevated_controller.cc index a43203d..024ca34 100644 --- a/remoting/host/win/elevated_controller.cc +++ b/remoting/host/win/elevated_controller.cc @@ -32,14 +32,14 @@ namespace { const size_t kMaxConfigFileSize = 1024 * 1024; // The host configuration file name. -const FilePath::CharType kConfigFileName[] = FILE_PATH_LITERAL("host.json"); +const base::FilePath::CharType kConfigFileName[] = FILE_PATH_LITERAL("host.json"); // The unprivileged configuration file name. -const FilePath::CharType kUnprivilegedConfigFileName[] = +const base::FilePath::CharType kUnprivilegedConfigFileName[] = FILE_PATH_LITERAL("host_unprivileged.json"); // The extension for the temporary file. -const FilePath::CharType kTempFileExtension[] = FILE_PATH_LITERAL("json~"); +const base::FilePath::CharType kTempFileExtension[] = FILE_PATH_LITERAL("json~"); // The host configuration file security descriptor that enables full access to // Local System and built-in administrators only. @@ -92,7 +92,7 @@ bool IsClientAdmin() { // Reads and parses the configuration file up to |kMaxConfigFileSize| in // size. -HRESULT ReadConfig(const FilePath& filename, +HRESULT ReadConfig(const base::FilePath& filename, scoped_ptr<base::DictionaryValue>* config_out) { // Read raw data from the configuration file. @@ -137,12 +137,12 @@ HRESULT ReadConfig(const FilePath& filename, return S_OK; } -FilePath GetTempLocationFor(const FilePath& filename) { +base::FilePath GetTempLocationFor(const base::FilePath& filename) { return filename.ReplaceExtension(kTempFileExtension); } // Writes a config file to a temporary location. -HRESULT WriteConfigFileToTemp(const FilePath& filename, +HRESULT WriteConfigFileToTemp(const base::FilePath& filename, const char* security_descriptor, const char* content, size_t length) { @@ -161,7 +161,7 @@ HRESULT WriteConfigFileToTemp(const FilePath& filename, security_attributes.bInheritHandle = FALSE; // Create a temporary file and write configuration to it. - FilePath tempname = GetTempLocationFor(filename); + base::FilePath tempname = GetTempLocationFor(filename); base::win::ScopedHandle file( CreateFileW(tempname.value().c_str(), GENERIC_WRITE, @@ -190,10 +190,10 @@ HRESULT WriteConfigFileToTemp(const FilePath& filename, } // Moves a config file from its temporary location to its permanent location. -HRESULT MoveConfigFileFromTemp(const FilePath& filename) { +HRESULT MoveConfigFileFromTemp(const base::FilePath& filename) { // Now that the configuration is stored successfully replace the actual // configuration file. - FilePath tempname = GetTempLocationFor(filename); + base::FilePath tempname = GetTempLocationFor(filename); if (!MoveFileExW(tempname.value().c_str(), filename.value().c_str(), MOVEFILE_REPLACE_EXISTING)) { @@ -253,7 +253,7 @@ HRESULT WriteConfig(const char* content, size_t length, HWND owner_window) { base::JSONWriter::Write(&unprivileged_config_dict, &unprivileged_config_str); // Write the full configuration file to a temporary location. - FilePath full_config_file_path = + base::FilePath full_config_file_path = remoting::GetConfigDir().Append(kConfigFileName); HRESULT hr = WriteConfigFileToTemp(full_config_file_path, kConfigFileSecurityDescriptor, @@ -264,7 +264,7 @@ HRESULT WriteConfig(const char* content, size_t length, HWND owner_window) { } // Write the unprivileged configuration file to a temporary location. - FilePath unprivileged_config_file_path = + base::FilePath unprivileged_config_file_path = remoting::GetConfigDir().Append(kUnprivilegedConfigFileName); hr = WriteConfigFileToTemp(unprivileged_config_file_path, kUnprivilegedConfigFileSecurityDescriptor, @@ -302,7 +302,7 @@ void ElevatedController::FinalRelease() { } STDMETHODIMP ElevatedController::GetConfig(BSTR* config_out) { - FilePath config_dir = remoting::GetConfigDir(); + base::FilePath config_dir = remoting::GetConfigDir(); // Read the unprivileged part of host configuration. scoped_ptr<base::DictionaryValue> config; @@ -347,7 +347,7 @@ STDMETHODIMP ElevatedController::GetVersion(BSTR* version_out) { STDMETHODIMP ElevatedController::SetConfig(BSTR config) { // Determine the config directory path and create it if necessary. - FilePath config_dir = remoting::GetConfigDir(); + base::FilePath config_dir = remoting::GetConfigDir(); if (!file_util::CreateDirectory(config_dir)) { return HRESULT_FROM_WIN32(ERROR_ACCESS_DENIED); } @@ -462,7 +462,7 @@ STDMETHODIMP ElevatedController::UpdateConfig(BSTR config) { } } // Get the old config. - FilePath config_dir = remoting::GetConfigDir(); + base::FilePath config_dir = remoting::GetConfigDir(); scoped_ptr<base::DictionaryValue> config_old; HRESULT hr = ReadConfig(config_dir.Append(kConfigFileName), &config_old); if (FAILED(hr)) { diff --git a/remoting/host/win/host_service.cc b/remoting/host/win/host_service.cc index 84c7f7c..51f4464 100644 --- a/remoting/host/win/host_service.cc +++ b/remoting/host/win/host_service.cc @@ -84,7 +84,7 @@ const wchar_t kUsageMessage[] = const char* kCopiedSwitchNames[] = { "host-config", "daemon-pipe", switches::kV, switches::kVModule }; -void usage(const FilePath& program_name) { +void usage(const base::FilePath& program_name) { LOG(INFO) << StringPrintf(kUsageMessage, UTF16ToWide(program_name.value()).c_str()); } @@ -231,7 +231,7 @@ void HostService::CreateLauncher( int HostService::Elevate() { // Get the name of the binary to launch. - FilePath binary = + base::FilePath binary = CommandLine::ForCurrentProcess()->GetSwitchValuePath(kElevateSwitchName); // Create the child process command line by copying known switches from our diff --git a/remoting/host/win/launch_process_with_token.cc b/remoting/host/win/launch_process_with_token.cc index 51b3900..fffa983 100644 --- a/remoting/host/win/launch_process_with_token.cc +++ b/remoting/host/win/launch_process_with_token.cc @@ -64,7 +64,7 @@ bool ConnectToExecutionServer(uint32 session_id, // Use winsta!WinStationQueryInformationW() to determine the process creation // pipe name for the session. - FilePath winsta_path(base::GetNativeLibraryName(UTF8ToUTF16("winsta"))); + base::FilePath winsta_path(base::GetNativeLibraryName(UTF8ToUTF16("winsta"))); base::ScopedNativeLibrary winsta(winsta_path); if (winsta.is_valid()) { PWINSTATIONQUERYINFORMATIONW win_station_query_information = @@ -293,7 +293,7 @@ bool ReceiveCreateProcessResponse( // Sends a remote process create request to the execution server. bool SendCreateProcessRequest( HANDLE pipe, - const FilePath::StringType& application_name, + const base::FilePath::StringType& application_name, const CommandLine::StringType& command_line, DWORD creation_flags, const char16* desktop_name) { @@ -376,7 +376,7 @@ bool SendCreateProcessRequest( // OS functionality and will likely not work on anything but XP or W2K3. bool CreateRemoteSessionProcess( uint32 session_id, - const FilePath::StringType& application_name, + const base::FilePath::StringType& application_name, const CommandLine::StringType& command_line, DWORD creation_flags, const char16* desktop_name, @@ -552,7 +552,7 @@ bool CreateSessionToken(uint32 session_id, ScopedHandle* token_out) { return true; } -bool LaunchProcessWithToken(const FilePath& binary, +bool LaunchProcessWithToken(const base::FilePath& binary, const CommandLine::StringType& command_line, HANDLE user_token, SECURITY_ATTRIBUTES* process_attributes, @@ -562,7 +562,7 @@ bool LaunchProcessWithToken(const FilePath& binary, const char16* desktop_name, ScopedHandle* process_out, ScopedHandle* thread_out) { - FilePath::StringType application_name = binary.value(); + base::FilePath::StringType application_name = binary.value(); STARTUPINFOW startup_info; memset(&startup_info, 0, sizeof(startup_info)); diff --git a/remoting/host/win/launch_process_with_token.h b/remoting/host/win/launch_process_with_token.h index 678ade2..bc8157a 100644 --- a/remoting/host/win/launch_process_with_token.h +++ b/remoting/host/win/launch_process_with_token.h @@ -65,7 +65,7 @@ bool CreateSessionToken(uint32 session_id, base::win::ScopedHandle* token_out); // The other parameters are passed directly to CreateProcessAsUser(). // If |inherit_handles| is true |g_inherit_handles_lock| should be taken while // any inheritable handles are open. -bool LaunchProcessWithToken(const FilePath& binary, +bool LaunchProcessWithToken(const base::FilePath& binary, const CommandLine::StringType& command_line, HANDLE user_token, SECURITY_ATTRIBUTES* process_attributes, diff --git a/remoting/host/win/unprivileged_process_delegate.cc b/remoting/host/win/unprivileged_process_delegate.cc index 6c2b740..f5c1e76 100644 --- a/remoting/host/win/unprivileged_process_delegate.cc +++ b/remoting/host/win/unprivileged_process_delegate.cc @@ -222,7 +222,7 @@ bool CreateWindowStationAndDesktop(ScopedSid logon_sid, UnprivilegedProcessDelegate::UnprivilegedProcessDelegate( scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, - const FilePath& binary_path) + const base::FilePath& binary_path) : main_task_runner_(main_task_runner), io_task_runner_(io_task_runner), binary_path_(binary_path) { diff --git a/remoting/host/win/unprivileged_process_delegate.h b/remoting/host/win/unprivileged_process_delegate.h index 06f6f9d..d1da1d0 100644 --- a/remoting/host/win/unprivileged_process_delegate.h +++ b/remoting/host/win/unprivileged_process_delegate.h @@ -31,7 +31,7 @@ class UnprivilegedProcessDelegate : public WorkerProcessLauncher::Delegate { UnprivilegedProcessDelegate( scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, - const FilePath& binary_path); + const base::FilePath& binary_path); virtual ~UnprivilegedProcessDelegate(); // IPC::Sender implementation. @@ -53,7 +53,7 @@ class UnprivilegedProcessDelegate : public WorkerProcessLauncher::Delegate { scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; // Path to the worker process binary. - FilePath binary_path_; + base::FilePath binary_path_; // The server end of the IPC channel used to communicate to the worker // process. diff --git a/remoting/host/win/wts_console_session_process_driver.cc b/remoting/host/win/wts_console_session_process_driver.cc index 1280ae8..d321e13 100644 --- a/remoting/host/win/wts_console_session_process_driver.cc +++ b/remoting/host/win/wts_console_session_process_driver.cc @@ -82,7 +82,7 @@ void WtsConsoleSessionProcessDriver::OnSessionAttached(uint32 session_id) { DCHECK(launcher_.get() == NULL); // Construct the host binary name. - FilePath host_binary; + base::FilePath host_binary; if (!GetInstalledBinaryPath(kHostBinaryName, &host_binary)) { Stop(); return; diff --git a/remoting/host/win/wts_session_process_delegate.cc b/remoting/host/win/wts_session_process_delegate.cc index 88ff519..8c7d552 100644 --- a/remoting/host/win/wts_session_process_delegate.cc +++ b/remoting/host/win/wts_session_process_delegate.cc @@ -56,7 +56,7 @@ class WtsSessionProcessDelegate::Core // Stop() method has been called. Core(scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, - const FilePath& binary_path, + const base::FilePath& binary_path, bool launch_elevated, const std::string& channel_security); @@ -110,7 +110,7 @@ class WtsSessionProcessDelegate::Core scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; // Path to the worker process binary. - FilePath binary_path_; + base::FilePath binary_path_; // The server end of the IPC channel used to communicate to the worker // process. @@ -151,7 +151,7 @@ class WtsSessionProcessDelegate::Core WtsSessionProcessDelegate::Core::Core( scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, - const FilePath& binary_path, + const base::FilePath& binary_path, bool launch_elevated, const std::string& channel_security) : main_task_runner_(main_task_runner), @@ -249,7 +249,7 @@ bool WtsSessionProcessDelegate::Core::LaunchProcess( } // Construct the helper binary name. - FilePath daemon_binary; + base::FilePath daemon_binary; if (!GetInstalledBinaryPath(kDaemonBinaryName, &daemon_binary)) return false; @@ -485,7 +485,7 @@ void WtsSessionProcessDelegate::Core::OnJobNotification(DWORD message, WtsSessionProcessDelegate::WtsSessionProcessDelegate( scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, - const FilePath& binary_path, + const base::FilePath& binary_path, uint32 session_id, bool launch_elevated, const std::string& channel_security) { diff --git a/remoting/host/win/wts_session_process_delegate.h b/remoting/host/win/wts_session_process_delegate.h index 13a1212..5d55c98 100644 --- a/remoting/host/win/wts_session_process_delegate.h +++ b/remoting/host/win/wts_session_process_delegate.h @@ -10,9 +10,8 @@ #include "base/memory/ref_counted.h" #include "remoting/host/win/worker_process_launcher.h" -class FilePath; - namespace base { +class FilePath; class SingleThreadTaskRunner; } // namespace base @@ -31,7 +30,7 @@ class WtsSessionProcessDelegate WtsSessionProcessDelegate( scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, - const FilePath& binary_path, + const base::FilePath& binary_path, uint32 session_id, bool launch_elevated, const std::string& channel_security); |