diff options
author | alexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-20 17:24:43 +0000 |
---|---|---|
committer | alexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-20 17:24:43 +0000 |
commit | 8cdb83f08a970a361c677b28ca08aac4c8df62ae (patch) | |
tree | eb4bacacd66b143b60dcac5e81442dc375c74a6c /remoting/host | |
parent | 4f94108c9be1f33135dd1c6ccc40f99311e0818d (diff) | |
download | chromium_src-8cdb83f08a970a361c677b28ca08aac4c8df62ae.zip chromium_src-8cdb83f08a970a361c677b28ca08aac4c8df62ae.tar.gz chromium_src-8cdb83f08a970a361c677b28ca08aac4c8df62ae.tar.bz2 |
Removing incorrect usage of TO_L_STRING() macros.
BUG=133003
Review URL: https://chromiumcodereview.appspot.com/10579034
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143194 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host')
-rw-r--r-- | remoting/host/branding.cc | 3 | ||||
-rw-r--r-- | remoting/host/branding.h | 2 | ||||
-rw-r--r-- | remoting/host/capturer_win.cc | 8 | ||||
-rw-r--r-- | remoting/host/elevated_controller_win.cc | 11 | ||||
-rw-r--r-- | remoting/host/host_service_win.cc | 10 | ||||
-rw-r--r-- | remoting/host/host_service_win.h | 3 | ||||
-rw-r--r-- | remoting/host/plugin/daemon_controller_win.cc | 11 | ||||
-rw-r--r-- | remoting/host/plugin/daemon_installer_win.cc | 27 | ||||
-rw-r--r-- | remoting/host/sas_injector_win.cc | 8 | ||||
-rw-r--r-- | remoting/host/wts_session_process_launcher_win.cc | 26 |
10 files changed, 51 insertions, 58 deletions
diff --git a/remoting/host/branding.cc b/remoting/host/branding.cc index 956f36e..c049854 100644 --- a/remoting/host/branding.cc +++ b/remoting/host/branding.cc @@ -6,7 +6,6 @@ #include "base/file_util.h" #include "base/path_service.h" -#include "base/stringize_macros.h" namespace { @@ -36,7 +35,7 @@ const FilePath::CharType kConfigDir[] = namespace remoting { #if defined(OS_WIN) -const char16 kWindowsServiceName[] = TO_L_STRING("chromoting"); +const wchar_t kWindowsServiceName[] = L"chromoting"; #endif FilePath GetConfigDir() { diff --git a/remoting/host/branding.h b/remoting/host/branding.h index 610a47c..c139fb4 100644 --- a/remoting/host/branding.h +++ b/remoting/host/branding.h @@ -11,7 +11,7 @@ namespace remoting { #if defined(OS_WIN) // Windows chromoting service name. -extern const char16 kWindowsServiceName[]; +extern const wchar_t kWindowsServiceName[]; #endif // Returns the location of the host configuration directory. diff --git a/remoting/host/capturer_win.cc b/remoting/host/capturer_win.cc index 9e196e8..7ac2780 100644 --- a/remoting/host/capturer_win.cc +++ b/remoting/host/capturer_win.cc @@ -10,8 +10,7 @@ #include "base/logging.h" #include "base/memory/scoped_ptr.h" #include "base/native_library.h" -#include "base/string16.h" -#include "base/stringize_macros.h" +#include "base/utf_string_conversions.h" #include "base/win/scoped_gdi_object.h" #include "remoting/base/capture_data.h" #include "remoting/host/capturer_helper.h" @@ -30,7 +29,7 @@ const UINT DWM_EC_ENABLECOMPOSITION = 1; typedef HRESULT (WINAPI * DwmEnableCompositionFunc)(UINT); -const char16 kDwmapiLibraryName[] = TO_L_STRING("dwmapi"); +const wchar_t kDwmapiLibraryName[] = L"dwmapi"; // Pixel colors used when generating cursor outlines. const uint32 kPixelBgraBlack = 0xff000000; @@ -246,7 +245,8 @@ void CapturerGdi::Start( if (dwmapi_library_ == NULL) { std::string error; dwmapi_library_ = base::LoadNativeLibrary( - FilePath(base::GetNativeLibraryName(kDwmapiLibraryName)), &error); + FilePath(base::GetNativeLibraryName(WideToUTF16(kDwmapiLibraryName))), + &error); } if (dwmapi_library_ != NULL && composition_func_ == NULL) { diff --git a/remoting/host/elevated_controller_win.cc b/remoting/host/elevated_controller_win.cc index 7ca42dd..faeb2da 100644 --- a/remoting/host/elevated_controller_win.cc +++ b/remoting/host/elevated_controller_win.cc @@ -14,7 +14,6 @@ #include "base/memory/scoped_ptr.h" #include "base/path_service.h" #include "base/process_util.h" -#include "base/stringize_macros.h" #include "base/utf_string_conversions.h" #include "base/values.h" #include "base/win/scoped_handle.h" @@ -42,11 +41,11 @@ const 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. -const char16 kConfigFileSecurityDescriptor[] = - TO_L_STRING("O:BAG:BAD:(A;;GA;;;SY)(A;;GA;;;BA)"); +const wchar_t kConfigFileSecurityDescriptor[] = + L"O:BAG:BAD:(A;;GA;;;SY)(A;;GA;;;BA)"; -const char16 kUnprivilegedConfigFileSecurityDescriptor[] = - TO_L_STRING("O:BAG:BAD:(A;;GA;;;SY)(A;;GA;;;BA)(A;;GR;;;AU)"); +const wchar_t kUnprivilegedConfigFileSecurityDescriptor[] = + L"O:BAG:BAD:(A;;GA;;;SY)(A;;GA;;;BA)(A;;GR;;;AU)"; // Configuration keys. const char kHostId[] = "host_id"; @@ -142,7 +141,7 @@ FilePath GetTempLocationFor(const FilePath& filename) { // Writes a config file to a temporary location. HRESULT WriteConfigFileToTemp(const FilePath& filename, - const char16* security_descriptor, + const wchar_t* security_descriptor, const char* content, size_t length) { // Create a security descriptor for the configuration file. diff --git a/remoting/host/host_service_win.cc b/remoting/host/host_service_win.cc index 0f347ec..48b83bd 100644 --- a/remoting/host/host_service_win.cc +++ b/remoting/host/host_service_win.cc @@ -19,9 +19,9 @@ #include "base/logging.h" #include "base/message_loop.h" #include "base/path_service.h" -#include "base/stringize_macros.h" #include "base/stringprintf.h" #include "base/threading/thread.h" +#include "base/utf_string_conversions.h" #include "base/win/wrapped_window_proc.h" #include "remoting/base/breakpad.h" #include "remoting/base/scoped_sc_handle_win.h" @@ -41,12 +41,12 @@ const uint32 kInvalidSession = 0xffffffff; const char kIoThreadName[] = "I/O thread"; // A window class for the session change notifications window. -const char16 kSessionNotificationWindowClass[] = - TO_L_STRING("Chromoting_SessionNotificationWindow"); +const wchar_t kSessionNotificationWindowClass[] = + L"Chromoting_SessionNotificationWindow"; // Command line actions and switches: // "run" sumply runs the service as usual. -const char16 kRunActionName[] = TO_L_STRING("run"); +const wchar_t kRunActionName[] = L"run"; // "--console" runs the service interactively for debugging purposes. const char kConsoleSwitchName[] = "console"; @@ -258,7 +258,7 @@ int HostService::RunInConsole() { HWND window = NULL; WNDCLASSEX window_class; base::win::InitializeWindowClass( - kSessionNotificationWindowClass, + WideToUTF16(kSessionNotificationWindowClass).c_str(), &base::win::WrappedWindowProc<SessionChangeNotificationProc>, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, &window_class); diff --git a/remoting/host/host_service_win.h b/remoting/host/host_service_win.h index e055dba..0b55730 100644 --- a/remoting/host/host_service_win.h +++ b/remoting/host/host_service_win.h @@ -10,7 +10,6 @@ #include "base/file_path.h" #include "base/memory/singleton.h" #include "base/observer_list.h" -#include "base/string16.h" #include "base/synchronization/waitable_event.h" #include "remoting/host/wts_console_monitor_win.h" @@ -89,7 +88,7 @@ class HostService : public WtsConsoleMonitor { int (HostService::*run_routine_)(); // The service name. - string16 service_name_; + std::wstring service_name_; // The service status handle. SERVICE_STATUS_HANDLE service_status_handle_; diff --git a/remoting/host/plugin/daemon_controller_win.cc b/remoting/host/plugin/daemon_controller_win.cc index 5325c22..86e7d66 100644 --- a/remoting/host/plugin/daemon_controller_win.cc +++ b/remoting/host/plugin/daemon_controller_win.cc @@ -16,7 +16,6 @@ #include "base/json/json_writer.h" #include "base/logging.h" #include "base/string16.h" -#include "base/stringize_macros.h" #include "base/threading/thread.h" #include "base/time.h" #include "base/timer.h" @@ -40,13 +39,13 @@ namespace remoting { namespace { // ProgID of the daemon controller. -const char16 kDaemonController[] = - TO_L_STRING("ChromotingElevatedController.ElevatedController"); +const wchar_t kDaemonController[] = + L"ChromotingElevatedController.ElevatedController"; // The COM elevation moniker for the Elevated Controller. -const char16 kDaemonControllerElevationMoniker[] = - TO_L_STRING("Elevation:Administrator!new:") - TO_L_STRING("ChromotingElevatedController.ElevatedController"); +const wchar_t kDaemonControllerElevationMoniker[] = + L"Elevation:Administrator!new:" + L"ChromotingElevatedController.ElevatedController"; // Name of the Daemon Controller's worker thread. const char kDaemonControllerThreadName[] = "Daemon Controller thread"; diff --git a/remoting/host/plugin/daemon_installer_win.cc b/remoting/host/plugin/daemon_installer_win.cc index 3ebd2ca..c0bcd79 100644 --- a/remoting/host/plugin/daemon_installer_win.cc +++ b/remoting/host/plugin/daemon_installer_win.cc @@ -10,10 +10,10 @@ #include "base/message_loop.h" #include "base/process_util.h" #include "base/string16.h" -#include "base/stringize_macros.h" #include "base/stringprintf.h" #include "base/time.h" #include "base/timer.h" +#include "base/utf_string_conversions.h" #include "base/win/object_watcher.h" #include "base/win/registry.h" #include "base/win/scoped_bstr.h" @@ -31,25 +31,25 @@ using base::win::ScopedVariant; namespace { // The COM elevation moniker for Omaha. -const char16 kOmahaElevationMoniker[] = - TO_L_STRING("Elevation:Administrator!new:GoogleUpdate.Update3WebMachine"); +const wchar_t kOmahaElevationMoniker[] = + L"Elevation:Administrator!new:GoogleUpdate.Update3WebMachine"; // The registry key where the configuration of Omaha is stored. -const char16 kOmahaUpdateKeyName[] = TO_L_STRING("Software\\Google\\Update"); +const wchar_t kOmahaUpdateKeyName[] = L"Software\\Google\\Update"; // The name of the value where the full path to GoogleUpdate.exe is stored. -const char16 kOmahaPathValueName[] = TO_L_STRING("path"); +const wchar_t kOmahaPathValueName[] = L"path"; // The command line format string for GoogleUpdate.exe -const char16 kGoogleUpdateCommandLineFormat[] = - TO_L_STRING("\"%ls\" /install \"bundlename=Chromoting%%20Host&appguid=%ls&") - TO_L_STRING("appname=Chromoting%%20Host&needsadmin=True&lang=%ls\""); +const wchar_t kGoogleUpdateCommandLineFormat[] = + L"\"%ls\" /install \"bundlename=Chromoting%%20Host&appguid=%ls&" + L"appname=Chromoting%%20Host&needsadmin=True&lang=%ls\""; // TODO(alexeypa): Get the desired laungage from the web app. -const char16 kOmahaLanguage[] = TO_L_STRING("en"); +const wchar_t kOmahaLanguage[] = L"en"; // An empty string for optional parameters. -const char16 kOmahaEmpty[] = TO_L_STRING(""); +const wchar_t kOmahaEmpty[] = L""; // The installation status polling interval. const int kOmahaPollIntervalMs = 500; @@ -281,7 +281,7 @@ void DaemonCommandLineInstallerWin::Install() { return; } - string16 google_update; + std::wstring google_update; result = update_key.ReadValue(kOmahaPathValueName, &google_update); if (result != ERROR_SUCCESS) { @@ -290,14 +290,15 @@ void DaemonCommandLineInstallerWin::Install() { } // Launch the updater process and wait for its termination. - string16 command_line = + std::wstring command_line = StringPrintf(kGoogleUpdateCommandLineFormat, google_update.c_str(), kHostOmahaAppid, kOmahaLanguage); base::LaunchOptions options; - if (!base::LaunchProcess(command_line, options, process_.Receive())) { + if (!base::LaunchProcess(WideToUTF16(command_line), options, + process_.Receive())) { result = GetLastError(); Done(HRESULT_FROM_WIN32(result)); return; diff --git a/remoting/host/sas_injector_win.cc b/remoting/host/sas_injector_win.cc index 0f1a1c4..7886129 100644 --- a/remoting/host/sas_injector_win.cc +++ b/remoting/host/sas_injector_win.cc @@ -11,7 +11,6 @@ #include "base/file_path.h" #include "base/native_library.h" #include "base/path_service.h" -#include "base/stringize_macros.h" #include "base/win/registry.h" #include "base/win/windows_version.h" @@ -29,10 +28,9 @@ typedef VOID (WINAPI *SendSasFunc)(BOOL); // The registry key and value holding the policy controlling software SAS // generation. -const char16 kSystemPolicyKeyName[] = - TO_L_STRING("Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\") - TO_L_STRING("System"); -const char16 kSoftwareSasValueName[] = TO_L_STRING("SoftwareSASGeneration"); +const wchar_t kSystemPolicyKeyName[] = + L"Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System"; +const wchar_t kSoftwareSasValueName[] = L"SoftwareSASGeneration"; const DWORD kEnableSoftwareSasByServices = 1; diff --git a/remoting/host/wts_session_process_launcher_win.cc b/remoting/host/wts_session_process_launcher_win.cc index fe1d7d7f..e3208e4 100644 --- a/remoting/host/wts_session_process_launcher_win.cc +++ b/remoting/host/wts_session_process_launcher_win.cc @@ -19,8 +19,6 @@ #include "base/message_loop_proxy.h" #include "base/process_util.h" #include "base/rand_util.h" -#include "base/string16.h" -#include "base/stringize_macros.h" #include "base/stringprintf.h" #include "base/win/scoped_handle.h" #include "base/win/scoped_process_information.h" @@ -43,10 +41,10 @@ const int kMaxLaunchDelaySeconds = 60; const int kMinLaunchDelaySeconds = 1; // Name of the default session desktop. -char16 kDefaultDesktopName[] = TO_L_STRING("winsta0\\default"); +wchar_t kDefaultDesktopName[] = L"winsta0\\default"; // Match the pipe name prefix used by Chrome IPC channels. -const char16 kChromePipeNamePrefix[] = TO_L_STRING("\\\\.\\pipe\\chrome."); +const wchar_t kChromePipeNamePrefix[] = L"\\\\.\\pipe\\chrome."; // The IPC channel name is passed to the host in the command line. const char kChromotingIpcSwitchName[] = "chromoting-ipc"; @@ -58,8 +56,8 @@ const char* kCopiedSwitchNames[] = { // The security descriptor of the Chromoting IPC channel. It gives full access // to LocalSystem and denies access by anyone else. -const char16 kChromotingChannelSecurityDescriptor[] = - TO_L_STRING("O:SYG:SYD:(A;;GA;;;SY)"); +const wchar_t kChromotingChannelSecurityDescriptor[] = + L"O:SYG:SYD:(A;;GA;;;SY)"; // Takes the process token and makes a copy of it. The returned handle will have // |desired_access| rights. @@ -149,8 +147,8 @@ bool CreateSessionToken(uint32 session_id, // Generates random channel ID. // N.B. Stolen from src/content/common/child_process_host_impl.cc -string16 GenerateRandomChannelId(void* instance) { - return base::StringPrintf(TO_L_STRING("%d.%p.%d"), +std::wstring GenerateRandomChannelId(void* instance) { + return base::StringPrintf(L"%d.%p.%d", base::GetCurrentProcId(), instance, base::RandInt(0, std::numeric_limits<int>::max())); } @@ -158,7 +156,7 @@ string16 GenerateRandomChannelId(void* instance) { // Creates the server end of the Chromoting IPC channel. // N.B. This code is based on IPC::Channel's implementation. bool CreatePipeForIpcChannel(void* instance, - string16* channel_name_out, + std::wstring* channel_name_out, ScopedHandle* pipe_out) { // Create security descriptor for the channel. SECURITY_ATTRIBUTES security_attributes; @@ -178,10 +176,10 @@ bool CreatePipeForIpcChannel(void* instance, } // Generate a random channel name. - string16 channel_name(GenerateRandomChannelId(instance)); + std::wstring channel_name(GenerateRandomChannelId(instance)); // Convert it to the pipe name. - string16 pipe_name(kChromePipeNamePrefix); + std::wstring pipe_name(kChromePipeNamePrefix); pipe_name.append(channel_name); // Create the server end of the pipe. This code should match the code in @@ -211,10 +209,10 @@ bool CreatePipeForIpcChannel(void* instance, // Launches |binary| in the security context of the supplied |user_token|. bool LaunchProcessAsUser(const FilePath& binary, - const string16& command_line, + const std::wstring& command_line, HANDLE user_token, base::Process* process_out) { - string16 application_name = binary.value(); + std::wstring application_name = binary.value(); base::win::ScopedProcessInformation process_info; STARTUPINFOW startup_info; @@ -281,7 +279,7 @@ void WtsSessionProcessLauncher::LaunchProcess() { launch_time_ = base::Time::Now(); - string16 channel_name; + std::wstring channel_name; ScopedHandle pipe; if (CreatePipeForIpcChannel(this, &channel_name, &pipe)) { // Wrap the pipe into an IPC channel. |