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

Side by Side Diff: content/browser/in_process_webkit/indexed_db_key_utility_client.cc

Issue 8770025: Zygote most of the uses of the utility process on Linux (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 9 years 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
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/in_process_webkit/indexed_db_key_utility_client.h" 5 #include "content/browser/in_process_webkit/indexed_db_key_utility_client.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/synchronization/waitable_event.h" 9 #include "base/synchronization/waitable_event.h"
10 #include "content/browser/utility_process_host.h" 10 #include "content/browser/utility_process_host.h"
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 BrowserThread::IO, FROM_HERE, 269 BrowserThread::IO, FROM_HERE,
270 base::Bind(&KeyUtilityClientImpl::StartUtilityProcessInternal, this)); 270 base::Bind(&KeyUtilityClientImpl::StartUtilityProcessInternal, this));
271 return; 271 return;
272 } 272 }
273 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 273 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
274 DCHECK(state_ == STATE_UNINITIALIZED); 274 DCHECK(state_ == STATE_UNINITIALIZED);
275 275
276 client_ = new KeyUtilityClientImpl::Client(this); 276 client_ = new KeyUtilityClientImpl::Client(this);
277 utility_process_host_ = new UtilityProcessHost( 277 utility_process_host_ = new UtilityProcessHost(
278 client_.get(), BrowserThread::IO); 278 client_.get(), BrowserThread::IO);
279 #if defined(OS_LINUX)
280 utility_process_host_->set_should_use_zygote(true);
281 #endif
279 utility_process_host_->StartBatchMode(); 282 utility_process_host_->StartBatchMode();
280 state_ = STATE_INITIALIZED; 283 state_ = STATE_INITIALIZED;
281 waitable_event_.Signal(); 284 waitable_event_.Signal();
282 } 285 }
283 286
284 void KeyUtilityClientImpl::EndUtilityProcessInternal() { 287 void KeyUtilityClientImpl::EndUtilityProcessInternal() {
285 if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { 288 if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) {
286 BrowserThread::PostTask( 289 BrowserThread::PostTask(
287 BrowserThread::IO, FROM_HERE, 290 BrowserThread::IO, FROM_HERE,
288 base::Bind(&KeyUtilityClientImpl::EndUtilityProcessInternal, this)); 291 base::Bind(&KeyUtilityClientImpl::EndUtilityProcessInternal, this));
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 void KeyUtilityClientImpl::Client::OnInjectIDBKeyFinished( 389 void KeyUtilityClientImpl::Client::OnInjectIDBKeyFinished(
387 const content::SerializedScriptValue& value) { 390 const content::SerializedScriptValue& value) {
388 parent_->SetValueAfterInjection(value); 391 parent_->SetValueAfterInjection(value);
389 parent_->FinishInjectingKey(); 392 parent_->FinishInjectingKey();
390 } 393 }
391 394
392 void KeyUtilityClientImpl::Client::OnIDBKeysFromValuesAndKeyPathFailed( 395 void KeyUtilityClientImpl::Client::OnIDBKeysFromValuesAndKeyPathFailed(
393 int id) { 396 int id) {
394 parent_->FinishCreatingKeys(); 397 parent_->FinishCreatingKeys();
395 } 398 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698