| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |