summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoradam.treat@samsung.com <adam.treat@samsung.com@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-28 19:29:31 +0000
committeradam.treat@samsung.com <adam.treat@samsung.com@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-28 19:29:31 +0000
commita39e78dc047dbfbb1c1ce6d79cb520de8a119256 (patch)
tree193790fdfba4ae1474c9ef4c3386a431e35143c0
parentb3f9f40be7b0dc7c94dd23625a6577af328c8f55 (diff)
downloadchromium_src-a39e78dc047dbfbb1c1ce6d79cb520de8a119256.zip
chromium_src-a39e78dc047dbfbb1c1ce6d79cb520de8a119256.tar.gz
chromium_src-a39e78dc047dbfbb1c1ce6d79cb520de8a119256.tar.bz2
Fix crash with IPC_MESSAGE_LOG_ENABLED when running in single-process mode or in-process-gpu. The ipc_logging class is not thread safe so when when running in these modes the queued_logs_ were getting smashed. Besides, there is no reason to queue these logs when running all in the same process.
BUG=none Review URL: https://codereview.chromium.org/32283003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231374 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--content/child/child_thread.cc9
-rw-r--r--content/child/child_thread.h4
2 files changed, 9 insertions, 4 deletions
diff --git a/content/child/child_thread.cc b/content/child/child_thread.cc
index 95b36c6..83a86ee 100644
--- a/content/child/child_thread.cc
+++ b/content/child/child_thread.cc
@@ -133,7 +133,8 @@ void QuitMainThreadMessageLoop() {
} // namespace
ChildThread::ChildThread()
- : channel_connected_factory_(this) {
+ : channel_connected_factory_(this),
+ in_browser_process_(false) {
channel_name_ = CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
switches::kProcessChannelID);
Init();
@@ -141,7 +142,8 @@ ChildThread::ChildThread()
ChildThread::ChildThread(const std::string& channel_name)
: channel_name_(channel_name),
- channel_connected_factory_(this) {
+ channel_connected_factory_(this),
+ in_browser_process_(true) {
Init();
}
@@ -163,7 +165,8 @@ void ChildThread::Init() {
true,
ChildProcess::current()->GetShutDownEvent()));
#ifdef IPC_MESSAGE_LOG_ENABLED
- IPC::Logging::GetInstance()->SetIPCSender(this);
+ if (!in_browser_process_)
+ IPC::Logging::GetInstance()->SetIPCSender(this);
#endif
sync_message_filter_ =
diff --git a/content/child/child_thread.h b/content/child/child_thread.h
index 94918feb..3b45d70 100644
--- a/content/child/child_thread.h
+++ b/content/child/child_thread.h
@@ -49,7 +49,7 @@ class CONTENT_EXPORT ChildThread : public IPC::Listener, public IPC::Sender {
public:
// Creates the thread.
ChildThread();
- // Used for single-process mode.
+ // Used for single-process mode and for in process gpu mode.
explicit ChildThread(const std::string& channel_name);
// ChildProcess::main_thread() is reset after Shutdown(), and before the
// destructor, so any subsystem that relies on ChildProcess::main_thread()
@@ -211,6 +211,8 @@ class CONTENT_EXPORT ChildThread : public IPC::Listener, public IPC::Sender {
scoped_ptr<base::PowerMonitor> power_monitor_;
+ bool in_browser_process_;
+
DISALLOW_COPY_AND_ASSIGN(ChildThread);
};