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

Side by Side Diff: content/browser/utility_process_host.cc

Issue 9235052: Fix race condition in utility process clients (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync to ToT Created 8 years, 11 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/browser/utility_process_host.h ('k') | no next file » | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/browser/utility_process_host.h" 5 #include "content/browser/utility_process_host.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 #else 46 #else
47 child_flags_(ChildProcessHost::CHILD_NORMAL), 47 child_flags_(ChildProcessHost::CHILD_NORMAL),
48 #endif 48 #endif
49 use_linux_zygote_(false), 49 use_linux_zygote_(false),
50 started_(false) { 50 started_(false) {
51 process_.reset( 51 process_.reset(
52 new BrowserChildProcessHostImpl(content::PROCESS_TYPE_UTILITY, this)); 52 new BrowserChildProcessHostImpl(content::PROCESS_TYPE_UTILITY, this));
53 } 53 }
54 54
55 UtilityProcessHost::~UtilityProcessHost() { 55 UtilityProcessHost::~UtilityProcessHost() {
56 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
56 DCHECK(!is_batch_mode_); 57 DCHECK(!is_batch_mode_);
57 } 58 }
58 59
59 bool UtilityProcessHost::Send(IPC::Message* message) { 60 bool UtilityProcessHost::Send(IPC::Message* message) {
60 if (!StartProcess()) 61 if (!StartProcess())
61 return false; 62 return false;
62 63
63 return process_->Send(message); 64 return process_->Send(message);
64 } 65 }
65 66
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 base::Bind(base::IgnoreResult(&Client::OnMessageReceived), 157 base::Bind(base::IgnoreResult(&Client::OnMessageReceived),
157 client_.get(), message)); 158 client_.get(), message));
158 return true; 159 return true;
159 } 160 }
160 161
161 void UtilityProcessHost::OnProcessCrashed(int exit_code) { 162 void UtilityProcessHost::OnProcessCrashed(int exit_code) {
162 BrowserThread::PostTask( 163 BrowserThread::PostTask(
163 client_thread_id_, FROM_HERE, 164 client_thread_id_, FROM_HERE,
164 base::Bind(&Client::OnProcessCrashed, client_.get(), exit_code)); 165 base::Bind(&Client::OnProcessCrashed, client_.get(), exit_code));
165 } 166 }
OLDNEW
« no previous file with comments | « content/browser/utility_process_host.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698