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

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

Issue 179923006: Attempting to resolve a race condition with PowerMonitor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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
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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 channel_->AddFilter(resource_message_filter_.get()); 257 channel_->AddFilter(resource_message_filter_.get());
258 channel_->AddFilter(quota_message_filter_->GetFilter()); 258 channel_->AddFilter(quota_message_filter_->GetFilter());
259 channel_->AddFilter(service_worker_message_filter_->GetFilter()); 259 channel_->AddFilter(service_worker_message_filter_->GetFilter());
260 260
261 // In single process mode we may already have a power monitor 261 // In single process mode we may already have a power monitor
262 if (!base::PowerMonitor::Get()) { 262 if (!base::PowerMonitor::Get()) {
263 scoped_ptr<PowerMonitorBroadcastSource> power_monitor_source( 263 scoped_ptr<PowerMonitorBroadcastSource> power_monitor_source(
264 new PowerMonitorBroadcastSource()); 264 new PowerMonitorBroadcastSource());
265 channel_->AddFilter(power_monitor_source->GetMessageFilter()); 265 channel_->AddFilter(power_monitor_source->GetMessageFilter());
266 266
267 power_monitor_.reset(new base::PowerMonitor( 267 power_monitor_.reset(base::PowerMonitor::Create(
268 power_monitor_source.PassAs<base::PowerMonitorSource>())); 268 power_monitor_source.PassAs<base::PowerMonitorSource>()));
269 } 269 }
270 270
271 #if defined(OS_POSIX) 271 #if defined(OS_POSIX)
272 // Check that --process-type is specified so we don't do this in unit tests 272 // Check that --process-type is specified so we don't do this in unit tests
273 // and single-process mode. 273 // and single-process mode.
274 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kProcessType)) 274 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kProcessType))
275 channel_->AddFilter(new SuicideOnChannelErrorFilter()); 275 channel_->AddFilter(new SuicideOnChannelErrorFilter());
276 #endif 276 #endif
277 277
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 // inflight that would addref it. 529 // inflight that would addref it.
530 Send(new ChildProcessHostMsg_ShutdownRequest); 530 Send(new ChildProcessHostMsg_ShutdownRequest);
531 } 531 }
532 532
533 void ChildThread::EnsureConnected() { 533 void ChildThread::EnsureConnected() {
534 VLOG(0) << "ChildThread::EnsureConnected()"; 534 VLOG(0) << "ChildThread::EnsureConnected()";
535 base::KillProcess(base::GetCurrentProcessHandle(), 0, false); 535 base::KillProcess(base::GetCurrentProcessHandle(), 0, false);
536 } 536 }
537 537
538 } // namespace content 538 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698