| 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" |
| 11 #include "content/common/indexed_db_key.h" | 11 #include "content/common/indexed_db/indexed_db_key.h" |
| 12 #include "content/common/indexed_db_messages.h" | 12 #include "content/common/indexed_db/indexed_db_messages.h" |
| 13 #include "content/common/utility_messages.h" | 13 #include "content/common/utility_messages.h" |
| 14 #include "content/public/common/serialized_script_value.h" | 14 #include "content/public/common/serialized_script_value.h" |
| 15 | 15 |
| 16 using content::BrowserThread; | 16 using content::BrowserThread; |
| 17 | 17 |
| 18 // This class is used to obtain IndexedDBKeys from SerializedScriptValues | 18 // This class is used to obtain IndexedDBKeys from SerializedScriptValues |
| 19 // given an IDBKeyPath. It uses UtilityProcess to do this inside a sandbox | 19 // given an IDBKeyPath. It uses UtilityProcess to do this inside a sandbox |
| 20 // (a V8 lock is required there). At this level, all methods are synchronous | 20 // (a V8 lock is required there). At this level, all methods are synchronous |
| 21 // as required by the caller. The public API is used on WEBKIT thread, | 21 // as required by the caller. The public API is used on WEBKIT thread, |
| 22 // but internally it moves around to UI and IO as needed. | 22 // but internally it moves around to UI and IO as needed. |
| (...skipping 363 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 |