Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: content/child/child_thread.cc

Issue 226263008: Revert of Attempting to resolve a race condition with PowerMonitor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/child/child_thread.h ('k') | content/child/power_monitor_broadcast_source_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/child/child_thread.h" 5 #include "content/child/child_thread.h"
6 6
7 #include <signal.h> 7 #include <signal.h>
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 209
210 channel_->AddFilter(histogram_message_filter_.get()); 210 channel_->AddFilter(histogram_message_filter_.get());
211 channel_->AddFilter(sync_message_filter_.get()); 211 channel_->AddFilter(sync_message_filter_.get());
212 channel_->AddFilter(new tracing::ChildTraceMessageFilter( 212 channel_->AddFilter(new tracing::ChildTraceMessageFilter(
213 ChildProcess::current()->io_message_loop_proxy())); 213 ChildProcess::current()->io_message_loop_proxy()));
214 channel_->AddFilter(resource_message_filter_.get()); 214 channel_->AddFilter(resource_message_filter_.get());
215 channel_->AddFilter(quota_message_filter_->GetFilter()); 215 channel_->AddFilter(quota_message_filter_->GetFilter());
216 channel_->AddFilter(service_worker_message_filter_->GetFilter()); 216 channel_->AddFilter(service_worker_message_filter_->GetFilter());
217 217
218 // In single process mode we may already have a power monitor 218 // In single process mode we may already have a power monitor
219 if (!base::PowerMonitor::IsInitialized()) { 219 if (!base::PowerMonitor::Get()) {
220 scoped_ptr<PowerMonitorBroadcastSource> power_monitor_source( 220 scoped_ptr<PowerMonitorBroadcastSource> power_monitor_source(
221 new PowerMonitorBroadcastSource()); 221 new PowerMonitorBroadcastSource());
222 channel_->AddFilter(power_monitor_source->GetMessageFilter()); 222 channel_->AddFilter(power_monitor_source->GetMessageFilter());
223 223
224 base::PowerMonitor::Initialize( 224 power_monitor_.reset(new base::PowerMonitor(
225 power_monitor_source.PassAs<base::PowerMonitorSource>()); 225 power_monitor_source.PassAs<base::PowerMonitorSource>()));
226 } 226 }
227 227
228 #if defined(OS_POSIX) 228 #if defined(OS_POSIX)
229 // Check that --process-type is specified so we don't do this in unit tests 229 // Check that --process-type is specified so we don't do this in unit tests
230 // and single-process mode. 230 // and single-process mode.
231 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kProcessType)) 231 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kProcessType))
232 channel_->AddFilter(new SuicideOnChannelErrorFilter()); 232 channel_->AddFilter(new SuicideOnChannelErrorFilter());
233 #endif 233 #endif
234 234
235 base::MessageLoop::current()->PostDelayedTask( 235 base::MessageLoop::current()->PostDelayedTask(
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 // inflight that would addref it. 480 // inflight that would addref it.
481 Send(new ChildProcessHostMsg_ShutdownRequest); 481 Send(new ChildProcessHostMsg_ShutdownRequest);
482 } 482 }
483 483
484 void ChildThread::EnsureConnected() { 484 void ChildThread::EnsureConnected() {
485 VLOG(0) << "ChildThread::EnsureConnected()"; 485 VLOG(0) << "ChildThread::EnsureConnected()";
486 base::KillProcess(base::GetCurrentProcessHandle(), 0, false); 486 base::KillProcess(base::GetCurrentProcessHandle(), 0, false);
487 } 487 }
488 488
489 } // namespace content 489 } // namespace content
OLDNEW
« no previous file with comments | « content/child/child_thread.h ('k') | content/child/power_monitor_broadcast_source_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698