diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-04 22:28:16 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-04 22:28:16 +0000 |
commit | 9a3a293b332de07fe81522061fadd8883789ec4a (patch) | |
tree | 39e2c276c3a7ef8668884bd02c590c8eccb51aa9 | |
parent | bb050c16657599d3cdee43c8d377ebcca0da64eb (diff) | |
download | chromium_src-9a3a293b332de07fe81522061fadd8883789ec4a.zip chromium_src-9a3a293b332de07fe81522061fadd8883789ec4a.tar.gz chromium_src-9a3a293b332de07fe81522061fadd8883789ec4a.tar.bz2 |
ipc: use strings, not wstrings for channel ids.
They're ASCII anyway.
TEST=covered by existing tests
Review URL: http://codereview.chromium.org/119131
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17682 0039d316-1c4b-4281-b951-d872f2087c98
50 files changed, 124 insertions, 119 deletions
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc index e61882d..61f204a 100755 --- a/chrome/browser/automation/automation_provider.cc +++ b/chrome/browser/automation/automation_provider.cc @@ -826,7 +826,7 @@ AutomationProvider::~AutomationProvider() { delete observer; } -void AutomationProvider::ConnectToChannel(const std::wstring& channel_id) { +void AutomationProvider::ConnectToChannel(const std::string& channel_id) { channel_.reset( new IPC::SyncChannel(channel_id, IPC::Channel::MODE_CLIENT, this, NULL, g_browser_process->io_thread()->message_loop(), diff --git a/chrome/browser/automation/automation_provider.h b/chrome/browser/automation/automation_provider.h index 04a6bd8..174faff 100644 --- a/chrome/browser/automation/automation_provider.h +++ b/chrome/browser/automation/automation_provider.h @@ -60,7 +60,7 @@ class AutomationProvider : public base::RefCounted<AutomationProvider>, // Establishes a connection to an automation client, if present. // An AutomationProxy should be established (probably in a different process) // before calling this. - void ConnectToChannel(const std::wstring& channel_id); + void ConnectToChannel(const std::string& channel_id); // Sets the number of tabs that we expect; when this number of tabs has // loaded, an AutomationMsg_InitialLoadsComplete message is sent. diff --git a/chrome/browser/browser_init.cc b/chrome/browser/browser_init.cc index 9a1760d..91483dc 100644 --- a/chrome/browser/browser_init.cc +++ b/chrome/browser/browser_init.cc @@ -658,8 +658,8 @@ bool BrowserInit::ProcessCmdLineImpl(const CommandLine& command_line, // Look for the testing channel ID ONLY during process startup if (command_line.HasSwitch(switches::kTestingChannelID)) { - std::wstring testing_channel_id = - command_line.GetSwitchValue(switches::kTestingChannelID); + std::string testing_channel_id = WideToASCII( + command_line.GetSwitchValue(switches::kTestingChannelID)); // TODO(sanjeevr) Check if we need to make this a singleton for // compatibility with the old testing code // If there are any loose parameters, we expect each one to generate a @@ -686,8 +686,8 @@ bool BrowserInit::ProcessCmdLineImpl(const CommandLine& command_line, bool silent_launch = false; if (command_line.HasSwitch(switches::kAutomationClientChannelID)) { - std::wstring automation_channel_id = - command_line.GetSwitchValue(switches::kAutomationClientChannelID); + std::string automation_channel_id = WideToASCII( + command_line.GetSwitchValue(switches::kAutomationClientChannelID)); // If there are any loose parameters, we expect each one to generate a // new tab; if there are none then we have no tabs size_t expected_tabs = @@ -728,7 +728,7 @@ bool BrowserInit::ProcessCmdLineImpl(const CommandLine& command_line, } template <class AutomationProviderClass> -void BrowserInit::CreateAutomationProvider(const std::wstring& channel_id, +void BrowserInit::CreateAutomationProvider(const std::string& channel_id, Profile* profile, size_t expected_tabs) { scoped_refptr<AutomationProviderClass> automation = diff --git a/chrome/browser/browser_init.h b/chrome/browser/browser_init.h index f688692..9d8be57 100644 --- a/chrome/browser/browser_init.h +++ b/chrome/browser/browser_init.h @@ -54,7 +54,7 @@ class BrowserInit { } template <class AutomationProviderClass> - static void CreateAutomationProvider(const std::wstring& channel_id, + static void CreateAutomationProvider(const std::string& channel_id, Profile* profile, size_t expected_tabs); diff --git a/chrome/browser/plugin_process_host.cc b/chrome/browser/plugin_process_host.cc index 53dfe47..39ec81d 100644 --- a/chrome/browser/plugin_process_host.cc +++ b/chrome/browser/plugin_process_host.cc @@ -380,7 +380,8 @@ bool PluginProcessHost::Init(const WebPluginInfo& info, cmd_line.AppendSwitchWithValue(switches::kProcessType, switches::kPluginProcess); - cmd_line.AppendSwitchWithValue(switches::kProcessChannelID, channel_id()); + cmd_line.AppendSwitchWithValue(switches::kProcessChannelID, + ASCIIToWide(channel_id())); cmd_line.AppendSwitchWithValue(switches::kPluginPath, info.path.ToWStringHack()); @@ -449,7 +450,7 @@ void PluginProcessHost::OnChannelConnected(int32 peer_pid) { void PluginProcessHost::OnChannelError() { for (size_t i = 0; i < pending_requests_.size(); ++i) { ReplyToRenderer(pending_requests_[i].renderer_message_filter_.get(), - std::wstring(), + std::string(), FilePath(), pending_requests_[i].reply_msg); } @@ -501,7 +502,7 @@ void PluginProcessHost::OnResolveProxyCompleted(IPC::Message* reply_msg, void PluginProcessHost::ReplyToRenderer( ResourceMessageFilter* renderer_message_filter, - const std::wstring& channel, const FilePath& plugin_path, + const std::string& channel, const FilePath& plugin_path, IPC::Message* reply_msg) { ViewHostMsg_OpenChannelToPlugin::WriteReplyParams(reply_msg, channel, plugin_path); @@ -529,12 +530,12 @@ void PluginProcessHost::RequestPluginChannel( sent_requests_.push(ChannelRequest( renderer_message_filter, mime_type, reply_msg)); } else { - ReplyToRenderer(renderer_message_filter, std::wstring(), FilePath(), + ReplyToRenderer(renderer_message_filter, std::string(), FilePath(), reply_msg); } } -void PluginProcessHost::OnChannelCreated(const std::wstring& channel_name) { +void PluginProcessHost::OnChannelCreated(const std::string& channel_name) { ReplyToRenderer(sent_requests_.front().renderer_message_filter_.get(), channel_name, info_.path, diff --git a/chrome/browser/plugin_process_host.h b/chrome/browser/plugin_process_host.h index 46d5e74..56004f6 100644 --- a/chrome/browser/plugin_process_host.h +++ b/chrome/browser/plugin_process_host.h @@ -65,7 +65,7 @@ class PluginProcessHost : public ChildProcessHost, // Sends the reply to an open channel request to the renderer with the given // channel name. static void ReplyToRenderer(ResourceMessageFilter* renderer_message_filter, - const std::wstring& channel, + const std::string& channel, const FilePath& plugin_path, IPC::Message* reply_msg); @@ -96,7 +96,7 @@ class PluginProcessHost : public ChildProcessHost, const std::string& mime_type, IPC::Message* reply_msg); // Message handlers. - void OnChannelCreated(const std::wstring& channel_name); + void OnChannelCreated(const std::string& channel_name); void OnGetPluginFinderUrl(std::string* plugin_finder_url); void OnGetCookies(uint32 request_context, const GURL& url, std::string* cookies); diff --git a/chrome/browser/plugin_service.cc b/chrome/browser/plugin_service.cc index 86e2a42..10a56f5 100644 --- a/chrome/browser/plugin_service.cc +++ b/chrome/browser/plugin_service.cc @@ -164,7 +164,7 @@ void PluginService::OpenChannelToPlugin( plugin_host->OpenChannelToPlugin(renderer_msg_filter, mime_type, reply_msg); } else { PluginProcessHost::ReplyToRenderer(renderer_msg_filter, - std::wstring(), + std::string(), FilePath(), reply_msg); } diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc index 8cee7ae..59c52cf 100644 --- a/chrome/browser/renderer_host/browser_render_process_host.cc +++ b/chrome/browser/renderer_host/browser_render_process_host.cc @@ -79,7 +79,7 @@ using WebKit::WebCache; // single-process mode. It's not used in multi-process mode. class RendererMainThread : public base::Thread { public: - explicit RendererMainThread(const std::wstring& channel_id) + explicit RendererMainThread(const std::string& channel_id) : base::Thread("Chrome_InProcRendererThread"), channel_id_(channel_id), render_process_(NULL) { @@ -113,7 +113,7 @@ class RendererMainThread : public base::Thread { } private: - std::wstring channel_id_; + std::string channel_id_; // Deleted in CleanUp() on the renderer thread, so don't use a smart pointer. RenderProcess* render_process_; }; @@ -200,7 +200,7 @@ bool BrowserRenderProcessHost::Init() { const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); // setup IPC channel - const std::wstring channel_id = + const std::string channel_id = ChildProcessInfo::GenerateRandomChannelID(this); channel_.reset( new IPC::SyncChannel(channel_id, IPC::Channel::MODE_SERVER, this, @@ -304,7 +304,7 @@ bool BrowserRenderProcessHost::Init() { switches::kRendererProcess); cmd_line.AppendSwitchWithValue(switches::kProcessChannelID, - channel_id); + ASCIIToWide(channel_id)); const std::wstring& profile_path = browser_command_line.GetSwitchValue(switches::kUserDataDir); diff --git a/chrome/browser/utility_process_host.cc b/chrome/browser/utility_process_host.cc index 4c3d83b..2be419e 100644 --- a/chrome/browser/utility_process_host.cc +++ b/chrome/browser/utility_process_host.cc @@ -48,7 +48,8 @@ bool UtilityProcessHost::StartProcess(const FilePath& exposed_dir) { CommandLine cmd_line(exe_path); cmd_line.AppendSwitchWithValue(switches::kProcessType, switches::kUtilityProcess); - cmd_line.AppendSwitchWithValue(switches::kProcessChannelID, channel_id()); + cmd_line.AppendSwitchWithValue(switches::kProcessChannelID, + ASCIIToWide(channel_id())); base::ProcessHandle process; #if defined(OS_WIN) diff --git a/chrome/browser/views/about_ipc_dialog.cc b/chrome/browser/views/about_ipc_dialog.cc index cb21069..f616855 100644 --- a/chrome/browser/views/about_ipc_dialog.cc +++ b/chrome/browser/views/about_ipc_dialog.cc @@ -402,7 +402,8 @@ void AboutIPCDialog::Log(const IPC::LogData& data) { int index = message_list_.InsertItem(count, sent_str.c_str()); message_list_.SetItemText(index, kTimeColumn, sent_str.c_str()); - message_list_.SetItemText(index, kChannelColumn, data.channel.c_str()); + message_list_.SetItemText(index, kChannelColumn, + ASCIIToWide(data.channel).c_str()); std::wstring message_name; IPC::Logging::GetMessageText(data.type, &message_name, NULL, NULL); diff --git a/chrome/browser/worker_host/worker_process_host.cc b/chrome/browser/worker_host/worker_process_host.cc index 4849fb1..d720cff 100644 --- a/chrome/browser/worker_host/worker_process_host.cc +++ b/chrome/browser/worker_host/worker_process_host.cc @@ -75,7 +75,8 @@ bool WorkerProcessHost::Init() { CommandLine cmd_line(exe_path); cmd_line.AppendSwitchWithValue(switches::kProcessType, switches::kWorkerProcess); - cmd_line.AppendSwitchWithValue(switches::kProcessChannelID, channel_id()); + cmd_line.AppendSwitchWithValue(switches::kProcessChannelID, + ASCIIToWide(channel_id())); if (CommandLine::ForCurrentProcess()->HasSwitch( switches::kWebWorkerShareProcesses)) { diff --git a/chrome/common/child_process_host.h b/chrome/common/child_process_host.h index bf320d3..caabe66 100644 --- a/chrome/common/child_process_host.h +++ b/chrome/common/child_process_host.h @@ -70,7 +70,7 @@ class ChildProcessHost : public ResourceDispatcherHost::Receiver, virtual void OnChannelError() { } bool opening_channel() { return opening_channel_; } - const std::wstring& channel_id() { return channel_id_; } + const std::string& channel_id() { return channel_id_; } const IPC::Channel& channel() const { return *channel_; } @@ -105,7 +105,7 @@ class ChildProcessHost : public ResourceDispatcherHost::Receiver, scoped_ptr<IPC::Channel> channel_; // IPC Channel's id. - std::wstring channel_id_; + std::string channel_id_; // Used to watch the child process handle. base::WaitableEventWatcher watcher_; diff --git a/chrome/common/child_process_info.cc b/chrome/common/child_process_info.cc index 15b0179..819b7fc 100644 --- a/chrome/common/child_process_info.cc +++ b/chrome/common/child_process_info.cc @@ -69,14 +69,14 @@ ChildProcessInfo::ChildProcessInfo(ProcessType type) { ChildProcessInfo::~ChildProcessInfo() { } -std::wstring ChildProcessInfo::GenerateRandomChannelID(void* instance) { +std::string ChildProcessInfo::GenerateRandomChannelID(void* instance) { // Note: the string must start with the current process id, this is how // child processes determine the pid of the parent. // Build the channel ID. This is composed of a unique identifier for the // parent browser process, an identifier for the child instance, and a random // component. We use a random component so that a hacked child process can't // cause denial of service by causing future named pipe creation to fail. - return StringPrintf(L"%d.%x.%d", + return StringPrintf("%d.%x.%d", base::GetCurrentProcId(), instance, base::RandInt(0, std::numeric_limits<int>::max())); } diff --git a/chrome/common/child_process_info.h b/chrome/common/child_process_info.h index 5bf9f44..d79435f 100644 --- a/chrome/common/child_process_info.h +++ b/chrome/common/child_process_info.h @@ -82,7 +82,7 @@ class ChildProcessInfo { // Generates a unique channel name for a child renderer/plugin process. // The "instance" pointer value is baked into the channel id. - static std::wstring GenerateRandomChannelID(void* instance); + static std::string GenerateRandomChannelID(void* instance); protected: void set_type(ProcessType type) { type_ = type; } diff --git a/chrome/common/child_thread.cc b/chrome/common/child_thread.cc index 94b3186..4c97b72 100644 --- a/chrome/common/child_thread.cc +++ b/chrome/common/child_thread.cc @@ -22,8 +22,9 @@ ChildThread::ChildThread(Thread::Options options) options_(options), check_with_browser_before_shutdown_(false) { DCHECK(owner_loop_); - channel_name_ = CommandLine::ForCurrentProcess()->GetSwitchValue( - switches::kProcessChannelID); + channel_name_ = WideToASCII( + CommandLine::ForCurrentProcess()->GetSwitchValue( + switches::kProcessChannelID)); if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUserAgent)) { webkit_glue::SetUserAgent(WideToUTF8( diff --git a/chrome/common/child_thread.h b/chrome/common/child_thread.h index f70869a..f612c35 100644 --- a/chrome/common/child_thread.h +++ b/chrome/common/child_thread.h @@ -41,7 +41,7 @@ class ChildThread : public IPC::Channel::Listener, bool Run(); // Overrides the channel name. Used for --single-process mode. - void SetChannelName(const std::wstring& name) { channel_name_ = name; } + void SetChannelName(const std::string& name) { channel_name_ = name; } // Called when the process refcount is 0. void OnProcessFinalRelease(); @@ -69,7 +69,7 @@ class ChildThread : public IPC::Channel::Listener, // The message loop used to run tasks on the thread that started this thread. MessageLoop* owner_loop_; - std::wstring channel_name_; + std::string channel_name_; scoped_ptr<IPC::SyncChannel> channel_; // Used only on the background render thread to implement message routing diff --git a/chrome/common/ipc_channel.h b/chrome/common/ipc_channel.h index 0ce037e..f619508 100644 --- a/chrome/common/ipc_channel.h +++ b/chrome/common/ipc_channel.h @@ -57,7 +57,7 @@ class Channel : public Message::Sender { // |listener| receives a callback on the current thread for each newly // received message. // - Channel(const std::wstring& channel_id, Mode mode, Listener* listener); + Channel(const std::string& channel_id, Mode mode, Listener* listener); ~Channel(); diff --git a/chrome/common/ipc_channel_posix.cc b/chrome/common/ipc_channel_posix.cc index a9a81a0..b7a9666 100644 --- a/chrome/common/ipc_channel_posix.cc +++ b/chrome/common/ipc_channel_posix.cc @@ -241,7 +241,7 @@ bool ClientConnectToFifo(const std::string &pipe_name, int* client_socket) { } // namespace //------------------------------------------------------------------------------ -Channel::ChannelImpl::ChannelImpl(const std::wstring& channel_id, Mode mode, +Channel::ChannelImpl::ChannelImpl(const std::string& channel_id, Mode mode, Listener* listener) : mode_(mode), is_blocked_on_write_(false), @@ -263,7 +263,7 @@ Channel::ChannelImpl::ChannelImpl(const std::wstring& channel_id, Mode mode, } } -bool Channel::ChannelImpl::CreatePipe(const std::wstring& channel_id, +bool Channel::ChannelImpl::CreatePipe(const std::string& channel_id, Mode mode) { DCHECK(server_listen_pipe_ == -1 && pipe_ == -1); @@ -272,7 +272,7 @@ bool Channel::ChannelImpl::CreatePipe(const std::wstring& channel_id, // TODO(playmobil): We shouldn't need to create fifos on disk. // TODO(playmobil): If we do, they should be in the user data directory. // TODO(playmobil): Cleanup any stale fifos. - pipe_name_ = "/var/tmp/chrome_" + WideToASCII(channel_id); + pipe_name_ = "/var/tmp/chrome_" + channel_id; if (mode == MODE_SERVER) { if (!CreateServerFifo(pipe_name_, &server_listen_pipe_)) { return false; @@ -285,7 +285,7 @@ bool Channel::ChannelImpl::CreatePipe(const std::wstring& channel_id, } } else { // socketpair() - pipe_name_ = WideToASCII(channel_id); + pipe_name_ = channel_id; if (mode == MODE_SERVER) { int pipe_fds[2]; if (socketpair(AF_UNIX, SOCK_STREAM, 0, pipe_fds) != 0) { @@ -657,7 +657,7 @@ bool Channel::ChannelImpl::Send(Message* message) { #endif #ifdef IPC_MESSAGE_LOG_ENABLED - Logging::current()->OnSendMessage(message, L""); + Logging::current()->OnSendMessage(message, ""); #endif output_queue_.push(message); @@ -778,7 +778,7 @@ void Channel::ChannelImpl::Close() { //------------------------------------------------------------------------------ // Channel's methods simply call through to ChannelImpl. -Channel::Channel(const std::wstring& channel_id, Mode mode, +Channel::Channel(const std::string& channel_id, Mode mode, Listener* listener) : channel_impl_(new ChannelImpl(channel_id, mode, listener)) { } diff --git a/chrome/common/ipc_channel_posix.h b/chrome/common/ipc_channel_posix.h index b45503b..414730a 100644 --- a/chrome/common/ipc_channel_posix.h +++ b/chrome/common/ipc_channel_posix.h @@ -23,7 +23,7 @@ namespace IPC { class Channel::ChannelImpl : public MessageLoopForIO::Watcher { public: // Mirror methods of Channel, see ipc_channel.h for description. - ChannelImpl(const std::wstring& channel_id, Mode mode, Listener* listener); + ChannelImpl(const std::string& channel_id, Mode mode, Listener* listener); ~ChannelImpl() { Close(); } bool Connect(); void Close(); @@ -32,7 +32,7 @@ class Channel::ChannelImpl : public MessageLoopForIO::Watcher { void GetClientFileDescriptorMapping(int *src_fd, int *dest_fd) const; private: - bool CreatePipe(const std::wstring& channel_id, Mode mode); + bool CreatePipe(const std::string& channel_id, Mode mode); bool ProcessIncomingMessages(); bool ProcessOutgoingMessages(); diff --git a/chrome/common/ipc_channel_proxy.cc b/chrome/common/ipc_channel_proxy.cc index 6b18adb..6e8919a3 100644 --- a/chrome/common/ipc_channel_proxy.cc +++ b/chrome/common/ipc_channel_proxy.cc @@ -25,7 +25,7 @@ ChannelProxy::Context::Context(Channel::Listener* listener, filters_.push_back(filter); } -void ChannelProxy::Context::CreateChannel(const std::wstring& id, +void ChannelProxy::Context::CreateChannel(const std::string& id, const Channel::Mode& mode) { DCHECK(channel_ == NULL); channel_id_ = id; @@ -205,21 +205,21 @@ void ChannelProxy::Context::OnDispatchError() { //----------------------------------------------------------------------------- -ChannelProxy::ChannelProxy(const std::wstring& channel_id, Channel::Mode mode, +ChannelProxy::ChannelProxy(const std::string& channel_id, Channel::Mode mode, Channel::Listener* listener, MessageFilter* filter, MessageLoop* ipc_thread) : context_(new Context(listener, filter, ipc_thread)) { Init(channel_id, mode, ipc_thread, true); } -ChannelProxy::ChannelProxy(const std::wstring& channel_id, Channel::Mode mode, +ChannelProxy::ChannelProxy(const std::string& channel_id, Channel::Mode mode, MessageLoop* ipc_thread, Context* context, bool create_pipe_now) : context_(context) { Init(channel_id, mode, ipc_thread, create_pipe_now); } -void ChannelProxy::Init(const std::wstring& channel_id, Channel::Mode mode, +void ChannelProxy::Init(const std::string& channel_id, Channel::Mode mode, MessageLoop* ipc_thread_loop, bool create_pipe_now) { if (create_pipe_now) { // Create the channel immediately. This effectively sets up the diff --git a/chrome/common/ipc_channel_proxy.h b/chrome/common/ipc_channel_proxy.h index 67a3c17..a395b1f 100644 --- a/chrome/common/ipc_channel_proxy.h +++ b/chrome/common/ipc_channel_proxy.h @@ -87,7 +87,7 @@ class ChannelProxy : public Message::Sender { // on the background thread. Any message not handled by the filter will be // dispatched to the listener. The given message loop indicates where the // IPC::Channel should be created. - ChannelProxy(const std::wstring& channel_id, Channel::Mode mode, + ChannelProxy(const std::string& channel_id, Channel::Mode mode, Channel::Listener* listener, MessageFilter* filter, MessageLoop* ipc_thread_loop); @@ -129,7 +129,7 @@ class ChannelProxy : public Message::Sender { // A subclass uses this constructor if it needs to add more information // to the internal state. If create_pipe_now is true, the pipe is created // immediately. Otherwise it's created on the IO thread. - ChannelProxy(const std::wstring& channel_id, Channel::Mode mode, + ChannelProxy(const std::string& channel_id, Channel::Mode mode, MessageLoop* ipc_thread_loop, Context* context, bool create_pipe_now); @@ -141,7 +141,7 @@ class ChannelProxy : public Message::Sender { MessageLoop* ipc_thread); virtual ~Context() { } MessageLoop* ipc_message_loop() const { return ipc_message_loop_; } - const std::wstring& channel_id() const { return channel_id_; } + const std::string& channel_id() const { return channel_id_; } // Dispatches a message on the listener thread. void OnDispatchMessage(const Message& message); @@ -171,7 +171,7 @@ class ChannelProxy : public Message::Sender { private: friend class ChannelProxy; // Create the Channel - void CreateChannel(const std::wstring& id, const Channel::Mode& mode); + void CreateChannel(const std::string& id, const Channel::Mode& mode); // Methods called via InvokeLater: void OnSendMessage(Message* message_ptr); @@ -187,7 +187,7 @@ class ChannelProxy : public Message::Sender { std::vector<scoped_refptr<MessageFilter> > filters_; MessageLoop* ipc_message_loop_; Channel* channel_; - std::wstring channel_id_; + std::string channel_id_; int peer_pid_; bool channel_connected_called_; }; @@ -195,7 +195,7 @@ class ChannelProxy : public Message::Sender { Context* context() { return context_; } private: - void Init(const std::wstring& channel_id, Channel::Mode mode, + void Init(const std::string& channel_id, Channel::Mode mode, MessageLoop* ipc_thread_loop, bool create_pipe_now); // By maintaining this indirection (ref-counted) to our internal state, we diff --git a/chrome/common/ipc_channel_win.cc b/chrome/common/ipc_channel_win.cc index d4e7c31..2e287ce 100644 --- a/chrome/common/ipc_channel_win.cc +++ b/chrome/common/ipc_channel_win.cc @@ -31,8 +31,8 @@ Channel::ChannelImpl::State::~State() { //------------------------------------------------------------------------------ -Channel::ChannelImpl::ChannelImpl(const std::wstring& channel_id, Mode mode, - Listener* listener) +Channel::ChannelImpl::ChannelImpl(const std::string& channel_id, Mode mode, + Listener* listener) : ALLOW_THIS_IN_INITIALIZER_LIST(input_state_(this)), ALLOW_THIS_IN_INITIALIZER_LIST(output_state_(this)), pipe_(INVALID_HANDLE_VALUE), @@ -92,7 +92,7 @@ bool Channel::ChannelImpl::Send(Message* message) { #endif #ifdef IPC_MESSAGE_LOG_ENABLED - Logging::current()->OnSendMessage(message, L""); + Logging::current()->OnSendMessage(message, ""); #endif output_queue_.push(message); @@ -108,14 +108,14 @@ bool Channel::ChannelImpl::Send(Message* message) { } const std::wstring Channel::ChannelImpl::PipeName( - const std::wstring& channel_id) const { + const std::string& channel_id) const { std::wostringstream ss; // XXX(darin): get application name from somewhere else - ss << L"\\\\.\\pipe\\chrome." << channel_id; + ss << L"\\\\.\\pipe\\chrome." << ASCIIToWide(channel_id); return ss.str(); } -bool Channel::ChannelImpl::CreatePipe(const std::wstring& channel_id, +bool Channel::ChannelImpl::CreatePipe(const std::string& channel_id, Mode mode) { DCHECK(pipe_ == INVALID_HANDLE_VALUE); const std::wstring pipe_name = PipeName(channel_id); @@ -413,7 +413,7 @@ void Channel::ChannelImpl::OnIOCompleted(MessageLoopForIO::IOContext* context, //------------------------------------------------------------------------------ // Channel's methods simply call through to ChannelImpl. -Channel::Channel(const std::wstring& channel_id, Mode mode, +Channel::Channel(const std::string& channel_id, Mode mode, Listener* listener) : channel_impl_(new ChannelImpl(channel_id, mode, listener)) { } diff --git a/chrome/common/ipc_channel_win.h b/chrome/common/ipc_channel_win.h index 2a601e1..f521431 100644 --- a/chrome/common/ipc_channel_win.h +++ b/chrome/common/ipc_channel_win.h @@ -19,15 +19,15 @@ namespace IPC { class Channel::ChannelImpl : public MessageLoopForIO::IOHandler { public: // Mirror methods of Channel, see ipc_channel.h for description. - ChannelImpl(const std::wstring& channel_id, Mode mode, Listener* listener); + ChannelImpl(const std::string& channel_id, Mode mode, Listener* listener); ~ChannelImpl() { Close(); } bool Connect(); void Close(); void set_listener(Listener* listener) { listener_ = listener; } bool Send(Message* message); private: - const std::wstring PipeName(const std::wstring& channel_id) const; - bool CreatePipe(const std::wstring& channel_id, Mode mode); + const std::wstring PipeName(const std::string& channel_id) const; + bool CreatePipe(const std::string& channel_id, Mode mode); bool ProcessConnection(); bool ProcessIncomingMessages(MessageLoopForIO::IOContext* context, diff --git a/chrome/common/ipc_logging.cc b/chrome/common/ipc_logging.cc index 0f49b39..7940b0d 100644 --- a/chrome/common/ipc_logging.cc +++ b/chrome/common/ipc_logging.cc @@ -186,7 +186,7 @@ void Logging::OnReceivedLoggingMessage(const Message& message) { } } -void Logging::OnSendMessage(Message* message, const std::wstring& channel_id) { +void Logging::OnSendMessage(Message* message, const std::string& channel_id) { if (!Enabled()) return; @@ -199,7 +199,7 @@ void Logging::OnSendMessage(Message* message, const std::wstring& channel_id) { // of the output parameters, add it to the LogData that was earlier stashed // with the reply, and log the result. data->channel = channel_id; - GenerateLogData(L"", *message, data); + GenerateLogData("", *message, data); Log(*data); delete data; message->set_sync_log_data(NULL); @@ -216,7 +216,7 @@ void Logging::OnPreDispatchMessage(const Message& message) { } void Logging::OnPostDispatchMessage(const Message& message, - const std::wstring& channel_id) { + const std::string& channel_id) { if (!Enabled() || #if defined(OS_WIN) !message.sent_time() || @@ -269,7 +269,7 @@ void Logging::Log(const LogData& data) { #elif defined(OS_POSIX) // On POSIX, for now, we just dump the log to stderr fprintf(stderr, "ipc %s %d %d %s %s %s\n", - WideToUTF8(data.channel).c_str(), + data.channel.c_str(), data.routing_id, data.type, WideToUTF8(data.flags).c_str(), @@ -278,7 +278,7 @@ void Logging::Log(const LogData& data) { #endif } -void GenerateLogData(const std::wstring& channel, const Message& message, +void GenerateLogData(const std::string& channel, const Message& message, LogData* data) { if (message.is_reply()) { // "data" should already be filled in. diff --git a/chrome/common/ipc_logging.h b/chrome/common/ipc_logging.h index e16b9d4..fea0034 100644 --- a/chrome/common/ipc_logging.h +++ b/chrome/common/ipc_logging.h @@ -49,10 +49,10 @@ class Logging : public base::WaitableEventWatcher::Delegate, // received. void OnReceivedLoggingMessage(const Message& message); - void OnSendMessage(Message* message, const std::wstring& channel_id); + void OnSendMessage(Message* message, const std::string& channel_id); void OnPreDispatchMessage(const Message& message); void OnPostDispatchMessage(const Message& message, - const std::wstring& channel_id); + const std::string& channel_id); // Returns the name of the logging enabled/disabled events so that the // sandbox can add them to to the policy. If true, gets the name of the diff --git a/chrome/common/ipc_message_utils.h b/chrome/common/ipc_message_utils.h index ff33e6a..3f0f7b2 100644 --- a/chrome/common/ipc_message_utils.h +++ b/chrome/common/ipc_message_utils.h @@ -815,7 +815,7 @@ struct ParamTraits<WebCursor> { }; struct LogData { - std::wstring channel; + std::string channel; int32 routing_id; uint16 type; std::wstring flags; @@ -1233,7 +1233,7 @@ class ParamDeserializer : public MessageReplyDeserializer { }; // defined in ipc_logging.cc -void GenerateLogData(const std::wstring& channel, const Message& message, +void GenerateLogData(const std::string& channel, const Message& message, LogData* data); // Used for synchronous messages. @@ -1318,7 +1318,7 @@ class MessageWithReply : public SyncMessage { // output parameters at that point. Instead, save its data and log it // with the outgoing reply message when it's sent. LogData* data = new LogData; - GenerateLogData(L"", *msg, data); + GenerateLogData("", *msg, data); msg->set_dont_log(); reply->set_sync_log_data(data); } diff --git a/chrome/common/ipc_sync_channel.cc b/chrome/common/ipc_sync_channel.cc index 842678c..6b5179c 100644 --- a/chrome/common/ipc_sync_channel.cc +++ b/chrome/common/ipc_sync_channel.cc @@ -336,7 +336,7 @@ void SyncChannel::SyncContext::OnWaitableEventSignaled(WaitableEvent* event) { SyncChannel::SyncChannel( - const std::wstring& channel_id, Channel::Mode mode, + const std::string& channel_id, Channel::Mode mode, Channel::Listener* listener, MessageFilter* filter, MessageLoop* ipc_message_loop, bool create_pipe_now, WaitableEvent* shutdown_event) diff --git a/chrome/common/ipc_sync_channel.h b/chrome/common/ipc_sync_channel.h index 2208a67..3b2c671 100644 --- a/chrome/common/ipc_sync_channel.h +++ b/chrome/common/ipc_sync_channel.h @@ -32,7 +32,7 @@ class MessageReplyDeserializer; class SyncChannel : public ChannelProxy, public base::WaitableEventWatcher::Delegate { public: - SyncChannel(const std::wstring& channel_id, Channel::Mode mode, + SyncChannel(const std::string& channel_id, Channel::Mode mode, Channel::Listener* listener, MessageFilter* filter, MessageLoop* ipc_message_loop, bool create_pipe_now, base::WaitableEvent* shutdown_event); diff --git a/chrome/common/ipc_sync_channel_unittest.cc b/chrome/common/ipc_sync_channel_unittest.cc index 218bdd5..6566fb5 100644 --- a/chrome/common/ipc_sync_channel_unittest.cc +++ b/chrome/common/ipc_sync_channel_unittest.cc @@ -42,13 +42,13 @@ class Worker : public Channel::Listener, public Message::Sender { shutdown_event_(true, false) { } // Will create a named channel and use this name for the threads' name. - Worker(const std::wstring& channel_name, Channel::Mode mode) + Worker(const std::string& channel_name, Channel::Mode mode) : done_(new WaitableEvent(false, false)), channel_created_(new WaitableEvent(false, false)), channel_name_(channel_name), mode_(mode), - ipc_thread_((WideToUTF8(channel_name) + "_ipc").c_str()), - listener_thread_((WideToUTF8(channel_name) + "_listener").c_str()), + ipc_thread_((channel_name + "_ipc").c_str()), + listener_thread_((channel_name + "_listener").c_str()), overrided_thread_(NULL), shutdown_event_(true, false) { } @@ -189,7 +189,7 @@ class Worker : public Channel::Listener, public Message::Sender { scoped_ptr<WaitableEvent> done_; scoped_ptr<WaitableEvent> channel_created_; - std::wstring channel_name_; + std::string channel_name_; Channel::Mode mode_; scoped_ptr<SyncChannel> channel_; base::Thread ipc_thread_; @@ -528,7 +528,7 @@ namespace { class MultipleServer1 : public Worker { public: MultipleServer1(bool pump_during_send) - : Worker(L"test_channel1", Channel::MODE_SERVER), + : Worker("test_channel1", Channel::MODE_SERVER), pump_during_send_(pump_during_send) { } void Run() { @@ -543,7 +543,7 @@ class MultipleClient1 : public Worker { public: MultipleClient1(WaitableEvent* client1_msg_received, WaitableEvent* client1_can_reply) : - Worker(L"test_channel1", Channel::MODE_CLIENT), + Worker("test_channel1", Channel::MODE_CLIENT), client1_msg_received_(client1_msg_received), client1_can_reply_(client1_can_reply) { } @@ -560,7 +560,7 @@ class MultipleClient1 : public Worker { class MultipleServer2 : public Worker { public: - MultipleServer2() : Worker(L"test_channel2", Channel::MODE_SERVER) { } + MultipleServer2() : Worker("test_channel2", Channel::MODE_SERVER) { } void OnAnswer(int* result) { *result = 42; @@ -573,7 +573,7 @@ class MultipleClient2 : public Worker { MultipleClient2( WaitableEvent* client1_msg_received, WaitableEvent* client1_can_reply, bool pump_during_send) - : Worker(L"test_channel2", Channel::MODE_CLIENT), + : Worker("test_channel2", Channel::MODE_CLIENT), client1_msg_received_(client1_msg_received), client1_can_reply_(client1_can_reply), pump_during_send_(pump_during_send) { } @@ -642,7 +642,7 @@ namespace { class QueuedReplyServer1 : public Worker { public: QueuedReplyServer1(bool pump_during_send) - : Worker(L"test_channel1", Channel::MODE_SERVER), + : Worker("test_channel1", Channel::MODE_SERVER), pump_during_send_(pump_during_send) { } void Run() { SendDouble(pump_during_send_, true); @@ -656,7 +656,7 @@ class QueuedReplyClient1 : public Worker { public: QueuedReplyClient1(WaitableEvent* client1_msg_received, WaitableEvent* server2_can_reply) : - Worker(L"test_channel1", Channel::MODE_CLIENT), + Worker("test_channel1", Channel::MODE_CLIENT), client1_msg_received_(client1_msg_received), server2_can_reply_(server2_can_reply) { } @@ -674,7 +674,7 @@ class QueuedReplyClient1 : public Worker { class QueuedReplyServer2 : public Worker { public: explicit QueuedReplyServer2(WaitableEvent* server2_can_reply) : - Worker(L"test_channel2", Channel::MODE_SERVER), + Worker("test_channel2", Channel::MODE_SERVER), server2_can_reply_(server2_can_reply) { } void OnAnswer(int* result) { @@ -694,7 +694,7 @@ class QueuedReplyClient2 : public Worker { public: explicit QueuedReplyClient2( WaitableEvent* client1_msg_received, bool pump_during_send) - : Worker(L"test_channel2", Channel::MODE_CLIENT), + : Worker("test_channel2", Channel::MODE_CLIENT), client1_msg_received_(client1_msg_received), pump_during_send_(pump_during_send){ } diff --git a/chrome/common/ipc_tests.cc b/chrome/common/ipc_tests.cc index 17d4d2c..d347fb5 100644 --- a/chrome/common/ipc_tests.cc +++ b/chrome/common/ipc_tests.cc @@ -34,9 +34,9 @@ // Define to enable IPC performance testing instead of the regular unit tests // #define PERFORMANCE_TEST -const wchar_t kTestClientChannel[] = L"T1"; -const wchar_t kReflectorChannel[] = L"T2"; -const wchar_t kFuzzerChannel[] = L"F3"; +const char kTestClientChannel[] = "T1"; +const char kReflectorChannel[] = "T2"; +const char kFuzzerChannel[] = "F3"; const size_t kLongMessageStringNumBytes = 50000; diff --git a/chrome/common/ipc_tests.h b/chrome/common/ipc_tests.h index 3cefafe..36026bf 100644 --- a/chrome/common/ipc_tests.h +++ b/chrome/common/ipc_tests.h @@ -19,9 +19,9 @@ enum ChildType { }; // The different channel names for the child processes. -extern const wchar_t kTestClientChannel[]; -extern const wchar_t kReflectorChannel[]; -extern const wchar_t kFuzzerChannel[]; +extern const char kTestClientChannel[]; +extern const char kReflectorChannel[]; +extern const char kFuzzerChannel[]; class MessageLoopForIO; namespace IPC { diff --git a/chrome/common/plugin_messages_internal.h b/chrome/common/plugin_messages_internal.h index 539be22..da8cd13d 100644 --- a/chrome/common/plugin_messages_internal.h +++ b/chrome/common/plugin_messages_internal.h @@ -39,7 +39,7 @@ IPC_END_MESSAGES(PluginProcess) IPC_BEGIN_MESSAGES(PluginProcessHost) // Response to a PluginProcessMsg_CreateChannel message. IPC_MESSAGE_CONTROL1(PluginProcessHostMsg_ChannelCreated, - std::wstring /* channel_name */) + std::string /* channel_name */) IPC_SYNC_MESSAGE_CONTROL0_1(PluginProcessHostMsg_GetPluginFinderUrl, std::string /* plugin finder URL */) diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h index 2559381..dc33dd1 100644 --- a/chrome/common/render_messages_internal.h +++ b/chrome/common/render_messages_internal.h @@ -919,7 +919,7 @@ IPC_BEGIN_MESSAGES(ViewHost) std::string /* mime_type */, std::string /* clsid */, std::wstring /* locale */, - std::wstring /* channel_name */, + std::string /* channel_name */, FilePath /* plugin_path */) // Clipboard IPC messages diff --git a/chrome/plugin/plugin_channel.cc b/chrome/plugin/plugin_channel.cc index f14300f..5d6143e 100644 --- a/chrome/plugin/plugin_channel.cc +++ b/chrome/plugin/plugin_channel.cc @@ -14,8 +14,8 @@ PluginChannel* PluginChannel::GetPluginChannel(MessageLoop* ipc_message_loop) { static int next_id; - std::wstring channel_name = StringPrintf( - L"%d.r%d", base::GetCurrentProcId(), ++next_id); + std::string channel_name = StringPrintf( + "%d.r%d", base::GetCurrentProcId(), ++next_id); return static_cast<PluginChannel*>(PluginChannelBase::GetChannel( channel_name, diff --git a/chrome/plugin/plugin_channel_base.cc b/chrome/plugin/plugin_channel_base.cc index bdc04b7..d939a179 100644 --- a/chrome/plugin/plugin_channel_base.cc +++ b/chrome/plugin/plugin_channel_base.cc @@ -8,14 +8,14 @@ #include "chrome/common/child_process.h" #include "chrome/common/ipc_sync_message.h" -typedef base::hash_map<std::wstring, scoped_refptr<PluginChannelBase> > +typedef base::hash_map<std::string, scoped_refptr<PluginChannelBase> > PluginChannelMap; static PluginChannelMap g_plugin_channels_; PluginChannelBase* PluginChannelBase::GetChannel( - const std::wstring& channel_name, IPC::Channel::Mode mode, + const std::string& channel_name, IPC::Channel::Mode mode, PluginChannelFactory factory, MessageLoop* ipc_message_loop, bool create_pipe_now) { scoped_refptr<PluginChannelBase> channel; diff --git a/chrome/plugin/plugin_channel_base.h b/chrome/plugin/plugin_channel_base.h index c0f357c..7cb816a 100644 --- a/chrome/plugin/plugin_channel_base.h +++ b/chrome/plugin/plugin_channel_base.h @@ -35,7 +35,7 @@ class PluginChannelBase : public IPC::Channel::Listener, virtual bool Send(IPC::Message* msg); int peer_pid() { return peer_pid_; } - std::wstring channel_name() const { return channel_name_; } + std::string channel_name() const { return channel_name_; } // Returns the number of open plugin channels in this process. static int Count(); @@ -60,7 +60,7 @@ class PluginChannelBase : public IPC::Channel::Listener, // must still ref count the returned value. When there are no more routes // on the channel and its ref count is 0, the object deletes itself. static PluginChannelBase* GetChannel( - const std::wstring& channel_name, IPC::Channel::Mode mode, + const std::string& channel_name, IPC::Channel::Mode mode, PluginChannelFactory factory, MessageLoop* ipc_message_loop, bool create_pipe_now); @@ -88,7 +88,7 @@ class PluginChannelBase : public IPC::Channel::Listener, private: IPC::Channel::Mode mode_; - std::wstring channel_name_; + std::string channel_name_; int plugin_count_; int peer_pid_; diff --git a/chrome/plugin/plugin_thread.cc b/chrome/plugin/plugin_thread.cc index 7c6a905..8f71662 100644 --- a/chrome/plugin/plugin_thread.cc +++ b/chrome/plugin/plugin_thread.cc @@ -98,7 +98,7 @@ void PluginThread::CleanUp() { } void PluginThread::OnCreateChannel(bool off_the_record) { - std::wstring channel_name; + std::string channel_name; scoped_refptr<PluginChannel> channel = PluginChannel::GetPluginChannel(owner_loop()); if (channel.get()) { diff --git a/chrome/renderer/plugin_channel_host.cc b/chrome/renderer/plugin_channel_host.cc index b206f0e..e010c56 100644 --- a/chrome/renderer/plugin_channel_host.cc +++ b/chrome/renderer/plugin_channel_host.cc @@ -61,7 +61,7 @@ void PluginChannelHost::SetListening(bool flag) { } PluginChannelHost* PluginChannelHost::GetPluginChannelHost( - const std::wstring& channel_name, MessageLoop* ipc_message_loop) { + const std::string& channel_name, MessageLoop* ipc_message_loop) { PluginChannelHost* result = static_cast<PluginChannelHost*>(PluginChannelBase::GetChannel( channel_name, diff --git a/chrome/renderer/plugin_channel_host.h b/chrome/renderer/plugin_channel_host.h index 446ef5c..8d27f9a 100644 --- a/chrome/renderer/plugin_channel_host.h +++ b/chrome/renderer/plugin_channel_host.h @@ -15,7 +15,7 @@ class IsListeningFilter; class PluginChannelHost : public PluginChannelBase { public: static PluginChannelHost* GetPluginChannelHost( - const std::wstring& channel_name, MessageLoop* ipc_message_loop); + const std::string& channel_name, MessageLoop* ipc_message_loop); ~PluginChannelHost(); diff --git a/chrome/renderer/render_process.cc b/chrome/renderer/render_process.cc index abf4289..687f1aa 100644 --- a/chrome/renderer/render_process.cc +++ b/chrome/renderer/render_process.cc @@ -42,7 +42,7 @@ RenderProcess::RenderProcess() Init(); } -RenderProcess::RenderProcess(const std::wstring& channel_name) +RenderProcess::RenderProcess(const std::string& channel_name) : ChildProcess(new RenderThread(channel_name)), ALLOW_THIS_IN_INITIALIZER_LIST(shared_mem_cache_cleaner_( base::TimeDelta::FromSeconds(5), diff --git a/chrome/renderer/render_process.h b/chrome/renderer/render_process.h index d8ed72b..727aae5 100644 --- a/chrome/renderer/render_process.h +++ b/chrome/renderer/render_process.h @@ -24,7 +24,7 @@ class RenderProcess : public ChildProcess { // This constructor grabs the channel name from the command line arguments. RenderProcess(); // This constructor uses the given channel name. - RenderProcess(const std::wstring& channel_name); + RenderProcess(const std::string& channel_name); ~RenderProcess(); diff --git a/chrome/renderer/render_process_unittest.cc b/chrome/renderer/render_process_unittest.cc index dc360c3..feac0aa 100644 --- a/chrome/renderer/render_process_unittest.cc +++ b/chrome/renderer/render_process_unittest.cc @@ -10,7 +10,7 @@ namespace { -static const wchar_t kThreadName[] = L"render_process_unittest"; +static const char kThreadName[] = "render_process_unittest"; class RenderProcessTest : public testing::Test { public: diff --git a/chrome/renderer/render_thread.cc b/chrome/renderer/render_thread.cc index 844bd90..0072972 100644 --- a/chrome/renderer/render_thread.cc +++ b/chrome/renderer/render_thread.cc @@ -67,7 +67,7 @@ RenderThread::RenderThread() plugin_refresh_allowed_(true) { } -RenderThread::RenderThread(const std::wstring& channel_name) +RenderThread::RenderThread(const std::string& channel_name) : ChildThread( base::Thread::Options(RenderProcess::InProcessPlugins() ? MessageLoop::TYPE_UI : MessageLoop::TYPE_DEFAULT, kV8StackSize)), diff --git a/chrome/renderer/render_thread.h b/chrome/renderer/render_thread.h index 27312c0..0e7a3c8 100644 --- a/chrome/renderer/render_thread.h +++ b/chrome/renderer/render_thread.h @@ -61,7 +61,7 @@ class RenderThread : public RenderThreadBase, // Grabs the IPC channel name from the command line. RenderThread(); // Constructor that's used when running in single process mode. - RenderThread(const std::wstring& channel_name); + RenderThread(const std::string& channel_name); virtual ~RenderThread(); // Returns the one render thread for this process. Note that this should only diff --git a/chrome/renderer/render_thread_unittest.cc b/chrome/renderer/render_thread_unittest.cc index 808bedf..7ad8175 100644 --- a/chrome/renderer/render_thread_unittest.cc +++ b/chrome/renderer/render_thread_unittest.cc @@ -11,7 +11,7 @@ namespace { -const wchar_t kThreadName[] = L"render_thread_unittest"; +const char kThreadName[] = "render_thread_unittest"; class RenderThreadTest : public testing::Test { public: diff --git a/chrome/renderer/renderer_main_unittest.cc b/chrome/renderer/renderer_main_unittest.cc index c938f5b..18e67fa 100644 --- a/chrome/renderer/renderer_main_unittest.cc +++ b/chrome/renderer/renderer_main_unittest.cc @@ -15,7 +15,7 @@ using base::ProcessHandle; -const std::wstring kRendererTestChannelName(L"test"); +const char kRendererTestChannelName[] = "test"; extern int RendererMain(const MainFunctionParams& parameters); @@ -80,7 +80,7 @@ MULTIPROCESS_TEST_MAIN(SimpleRenderer) { SandboxInitWrapper dummy_sandbox_init; CommandLine cl(*CommandLine::ForCurrentProcess()); cl.AppendSwitchWithValue(switches::kProcessChannelID, - kRendererTestChannelName); + ASCIIToWide(kRendererTestChannelName)); MainFunctionParams dummy_params(cl, dummy_sandbox_init, NULL); return RendererMain(dummy_params); diff --git a/chrome/renderer/webplugin_delegate_proxy.cc b/chrome/renderer/webplugin_delegate_proxy.cc index 2ae6ec4..5b16ce6 100644 --- a/chrome/renderer/webplugin_delegate_proxy.cc +++ b/chrome/renderer/webplugin_delegate_proxy.cc @@ -219,7 +219,7 @@ bool WebPluginDelegateProxy::Initialize(const GURL& url, char** argn, char** argv, int argc, WebPlugin* plugin, bool load_manually) { - std::wstring channel_name; + std::string channel_name; FilePath plugin_path; if (!RenderThread::current()->Send(new ViewHostMsg_OpenChannelToPlugin( url, mime_type_, clsid_, webkit_glue::GetWebKitLocale(), diff --git a/chrome/test/automation/automation_proxy.cc b/chrome/test/automation/automation_proxy.cc index c828e06..e54f6a6 100644 --- a/chrome/test/automation/automation_proxy.cc +++ b/chrome/test/automation/automation_proxy.cc @@ -112,9 +112,9 @@ void AutomationProxy::InitializeChannelID() { // wasn't getting freed up in time for the next test.) static int channel_counter = 0; - std::wostringstream buf; - buf << L"ChromeTestingInterface:" << base::GetCurrentProcId() << - L"." << ++channel_counter; + std::ostringstream buf; + buf << "ChromeTestingInterface:" << base::GetCurrentProcId() << + "." << ++channel_counter; channel_id_ = buf.str(); } diff --git a/chrome/test/automation/automation_proxy.h b/chrome/test/automation/automation_proxy.h index b851a40..b1cec94 100644 --- a/chrome/test/automation/automation_proxy.h +++ b/chrome/test/automation/automation_proxy.h @@ -170,7 +170,7 @@ class AutomationProxy : public IPC::Channel::Listener, // Returns the ID of the automation IPC channel, so that it can be // passed to the app as a launch parameter. - const std::wstring& channel_id() const { return channel_id_; } + const std::string& channel_id() const { return channel_id_; } #if defined(OS_POSIX) base::file_handle_mapping_vector fds_to_map() const; @@ -222,7 +222,7 @@ class AutomationProxy : public IPC::Channel::Listener, void InitializeChannel(); void InitializeHandleTracker(); - std::wstring channel_id_; + std::string channel_id_; scoped_ptr<base::Thread> thread_; scoped_ptr<IPC::SyncChannel> channel_; scoped_ptr<AutomationHandleTracker> tracker_; diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc index c081207..f117235 100644 --- a/chrome/test/ui/ui_test.cc +++ b/chrome/test/ui/ui_test.cc @@ -262,10 +262,10 @@ void UITest::LaunchBrowser(const CommandLine& arguments, bool clear_profile) { // I decided to keep using the old switch in the existing use case to // minimize changes in behavior. command_line.AppendSwitchWithValue(switches::kAutomationClientChannelID, - server_->channel_id()); + ASCIIToWide(server_->channel_id())); } else { command_line.AppendSwitchWithValue(switches::kTestingChannelID, - server_->channel_id()); + ASCIIToWide(server_->channel_id())); } } |