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

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

Issue 8491043: Allow linker initialization of lazy instance (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: willchan comments + rebase Created 9 years, 1 month 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) 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 101
102 // Used in the IO thread. 102 // Used in the IO thread.
103 UtilityProcessHost* utility_process_host_; 103 UtilityProcessHost* utility_process_host_;
104 scoped_refptr<Client> client_; 104 scoped_refptr<Client> client_;
105 105
106 DISALLOW_COPY_AND_ASSIGN(KeyUtilityClientImpl); 106 DISALLOW_COPY_AND_ASSIGN(KeyUtilityClientImpl);
107 }; 107 };
108 108
109 // IndexedDBKeyUtilityClient definitions. 109 // IndexedDBKeyUtilityClient definitions.
110 110
111 static base::LazyInstance<IndexedDBKeyUtilityClient> client_instance( 111 static base::LazyInstance<IndexedDBKeyUtilityClient> client_instance =
112 base::LINKER_INITIALIZED); 112 LAZY_INSTANCE_INITIALIZER;
113 113
114 IndexedDBKeyUtilityClient::IndexedDBKeyUtilityClient() 114 IndexedDBKeyUtilityClient::IndexedDBKeyUtilityClient()
115 : is_shutdown_(false) { 115 : is_shutdown_(false) {
116 // Note that creating the impl_ object is deferred until it is first needed, 116 // Note that creating the impl_ object is deferred until it is first needed,
117 // as this class can be constructed even though it never gets used. 117 // as this class can be constructed even though it never gets used.
118 } 118 }
119 119
120 IndexedDBKeyUtilityClient::~IndexedDBKeyUtilityClient() { 120 IndexedDBKeyUtilityClient::~IndexedDBKeyUtilityClient() {
121 DCHECK(!impl_ || is_shutdown_); 121 DCHECK(!impl_ || is_shutdown_);
122 } 122 }
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 void KeyUtilityClientImpl::Client::OnInjectIDBKeyFinished( 386 void KeyUtilityClientImpl::Client::OnInjectIDBKeyFinished(
387 const content::SerializedScriptValue& value) { 387 const content::SerializedScriptValue& value) {
388 parent_->SetValueAfterInjection(value); 388 parent_->SetValueAfterInjection(value);
389 parent_->FinishInjectingKey(); 389 parent_->FinishInjectingKey();
390 } 390 }
391 391
392 void KeyUtilityClientImpl::Client::OnIDBKeysFromValuesAndKeyPathFailed( 392 void KeyUtilityClientImpl::Client::OnIDBKeysFromValuesAndKeyPathFailed(
393 int id) { 393 int id) {
394 parent_->FinishCreatingKeys(); 394 parent_->FinishCreatingKeys();
395 } 395 }
OLDNEW
« no previous file with comments | « content/browser/gpu/gpu_process_host_ui_shim.cc ('k') | content/browser/mock_resource_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698