diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-21 16:40:17 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-21 16:40:17 +0000 |
commit | ea7d96f31cd0cdef3e0e0926744fe672d35537a0 (patch) | |
tree | 73ac764e80c47e7aec70bba15c70264a7cb6b255 /chrome/common | |
parent | 5eeef7b811f482b57db0ae33623c436370dd3c83 (diff) | |
download | chromium_src-ea7d96f31cd0cdef3e0e0926744fe672d35537a0.zip chromium_src-ea7d96f31cd0cdef3e0e0926744fe672d35537a0.tar.gz chromium_src-ea7d96f31cd0cdef3e0e0926744fe672d35537a0.tar.bz2 |
Fix single process mode and the unit_tests on Linux.
argh, this used to work in my previous change but it must have regressed before checkin.
Review URL: http://codereview.chromium.org/155846
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21180 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r-- | chrome/common/child_thread.cc | 14 | ||||
-rw-r--r-- | chrome/common/child_thread.h | 7 |
2 files changed, 15 insertions, 6 deletions
diff --git a/chrome/common/child_thread.cc b/chrome/common/child_thread.cc index db3c4c5..1d1f071 100644 --- a/chrome/common/child_thread.cc +++ b/chrome/common/child_thread.cc @@ -14,13 +14,21 @@ #include "webkit/glue/webkit_glue.h" -ChildThread::ChildThread() - : check_with_browser_before_shutdown_(false), - message_loop_(MessageLoop::current()) { +ChildThread::ChildThread() { channel_name_ = WideToASCII( CommandLine::ForCurrentProcess()->GetSwitchValue( switches::kProcessChannelID)); + Init(); +} + +ChildThread::ChildThread(const std::string channel_name) + : channel_name_(channel_name) { + Init(); +} +void ChildThread::Init() { + check_with_browser_before_shutdown_ = false; + message_loop_ = MessageLoop::current(); if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUserAgent)) { webkit_glue::SetUserAgent(WideToUTF8( CommandLine::ForCurrentProcess()->GetSwitchValue( diff --git a/chrome/common/child_thread.h b/chrome/common/child_thread.h index 86eae4c..a7074c7 100644 --- a/chrome/common/child_thread.h +++ b/chrome/common/child_thread.h @@ -19,6 +19,8 @@ class ChildThread : public IPC::Channel::Listener, public: // Creates the thread. ChildThread(); + // Used for single-process mode. + ChildThread(const std::string channel_name); virtual ~ChildThread(); // IPC::Message::Sender implementation: @@ -40,9 +42,6 @@ class ChildThread : public IPC::Channel::Listener, protected: friend class ChildProcess; - // Overrides the channel name. Used for --single-process mode. - void SetChannelName(const std::string& name) { channel_name_ = name; } - // Called when the process refcount is 0. void OnProcessFinalRelease(); @@ -51,6 +50,8 @@ class ChildThread : public IPC::Channel::Listener, IPC::SyncChannel* channel() { return channel_.get(); } private: + void Init(); + // IPC::Channel::Listener implementation: virtual void OnMessageReceived(const IPC::Message& msg); virtual void OnChannelError(); |