summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-04 22:28:16 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-04 22:28:16 +0000
commit9a3a293b332de07fe81522061fadd8883789ec4a (patch)
tree39e2c276c3a7ef8668884bd02c590c8eccb51aa9 /chrome/common
parentbb050c16657599d3cdee43c8d377ebcca0da64eb (diff)
downloadchromium_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
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/child_process_host.h4
-rw-r--r--chrome/common/child_process_info.cc4
-rw-r--r--chrome/common/child_process_info.h2
-rw-r--r--chrome/common/child_thread.cc5
-rw-r--r--chrome/common/child_thread.h4
-rw-r--r--chrome/common/ipc_channel.h2
-rw-r--r--chrome/common/ipc_channel_posix.cc12
-rw-r--r--chrome/common/ipc_channel_posix.h4
-rw-r--r--chrome/common/ipc_channel_proxy.cc8
-rw-r--r--chrome/common/ipc_channel_proxy.h12
-rw-r--r--chrome/common/ipc_channel_win.cc14
-rw-r--r--chrome/common/ipc_channel_win.h6
-rw-r--r--chrome/common/ipc_logging.cc10
-rw-r--r--chrome/common/ipc_logging.h4
-rw-r--r--chrome/common/ipc_message_utils.h6
-rw-r--r--chrome/common/ipc_sync_channel.cc2
-rw-r--r--chrome/common/ipc_sync_channel.h2
-rw-r--r--chrome/common/ipc_sync_channel_unittest.cc24
-rw-r--r--chrome/common/ipc_tests.cc6
-rw-r--r--chrome/common/ipc_tests.h6
-rw-r--r--chrome/common/plugin_messages_internal.h2
-rw-r--r--chrome/common/render_messages_internal.h2
22 files changed, 71 insertions, 70 deletions
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