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

Unified Diff: content/browser/in_process_webkit/indexed_db_key_utility_client.cc

Issue 10204003: Use WebIDBKeyPath type in WebKit API, implement IndexedDBKeyPath type. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move IndexedDBKeyPath to content namespace, formatting nits. Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/in_process_webkit/indexed_db_key_utility_client.cc
diff --git a/content/browser/in_process_webkit/indexed_db_key_utility_client.cc b/content/browser/in_process_webkit/indexed_db_key_utility_client.cc
index 5ab88eea974a1cd17361bc245aa46a9658e1d6d2..c1c88e66f82b5d0ccea660690dc626d9956bf132 100644
--- a/content/browser/in_process_webkit/indexed_db_key_utility_client.cc
+++ b/content/browser/in_process_webkit/indexed_db_key_utility_client.cc
@@ -9,12 +9,14 @@
#include "base/synchronization/waitable_event.h"
#include "content/browser/utility_process_host_impl.h"
#include "content/common/indexed_db/indexed_db_key.h"
+#include "content/common/indexed_db/indexed_db_key_path.h"
#include "content/common/indexed_db/indexed_db_messages.h"
#include "content/common/utility_messages.h"
#include "content/public/browser/utility_process_host_client.h"
#include "content/public/common/serialized_script_value.h"
using content::BrowserThread;
+using content::IndexedDBKeyPath;
using content::UtilityProcessHostClient;
// This class is used to obtain IndexedDBKeys from SerializedScriptValues
@@ -36,7 +38,7 @@ class KeyUtilityClientImpl
// Synchronously obtain the |keys| from |values| for the given |key_path|.
void CreateIDBKeysFromSerializedValuesAndKeyPath(
const std::vector<content::SerializedScriptValue>& values,
- const string16& key_path,
+ const IndexedDBKeyPath& key_path,
std::vector<IndexedDBKey>* keys);
// Synchronously inject |key| into |value| using the given |key_path|,
@@ -44,7 +46,7 @@ class KeyUtilityClientImpl
content::SerializedScriptValue InjectIDBKeyIntoSerializedValue(
const IndexedDBKey& key,
const content::SerializedScriptValue& value,
- const string16& key_path);
+ const IndexedDBKeyPath& key_path);
private:
class Client : public UtilityProcessHostClient {
@@ -77,11 +79,11 @@ class KeyUtilityClientImpl
void EndUtilityProcessInternal();
void CallStartIDBKeyFromValueAndKeyPathFromIOThread(
const std::vector<content::SerializedScriptValue>& values,
- const string16& key_path);
+ const IndexedDBKeyPath& key_path);
void CallStartInjectIDBKeyFromIOThread(
const IndexedDBKey& key,
const content::SerializedScriptValue& value,
- const string16& key_path);
+ const IndexedDBKeyPath& key_path);
void SetKeys(const std::vector<IndexedDBKey>& keys);
void FinishCreatingKeys();
@@ -138,7 +140,7 @@ void IndexedDBKeyUtilityClient::Shutdown() {
// static
void IndexedDBKeyUtilityClient::CreateIDBKeysFromSerializedValuesAndKeyPath(
const std::vector<content::SerializedScriptValue>& values,
- const string16& key_path,
+ const IndexedDBKeyPath& key_path,
std::vector<IndexedDBKey>* keys) {
IndexedDBKeyUtilityClient* instance = client_instance.Pointer();
@@ -160,7 +162,7 @@ void IndexedDBKeyUtilityClient::CreateIDBKeysFromSerializedValuesAndKeyPath(
content::SerializedScriptValue
IndexedDBKeyUtilityClient::InjectIDBKeyIntoSerializedValue(
const IndexedDBKey& key, const content::SerializedScriptValue& value,
- const string16& key_path) {
+ const IndexedDBKeyPath& key_path) {
IndexedDBKeyUtilityClient* instance = client_instance.Pointer();
if (instance->is_shutdown_)
@@ -212,7 +214,7 @@ void KeyUtilityClientImpl::StartUtilityProcess() {
void KeyUtilityClientImpl::CreateIDBKeysFromSerializedValuesAndKeyPath(
const std::vector<content::SerializedScriptValue>& values,
- const string16& key_path,
+ const IndexedDBKeyPath& key_path,
std::vector<IndexedDBKey>* keys) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED));
if (state_ == STATE_SHUTDOWN) {
@@ -234,7 +236,7 @@ content::SerializedScriptValue
KeyUtilityClientImpl::InjectIDBKeyIntoSerializedValue(
const IndexedDBKey& key,
const content::SerializedScriptValue& value,
- const string16& key_path) {
+ const IndexedDBKeyPath& key_path) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED));
if (state_ == STATE_SHUTDOWN)
return content::SerializedScriptValue();
@@ -306,7 +308,7 @@ void KeyUtilityClientImpl::EndUtilityProcessInternal() {
void KeyUtilityClientImpl::CallStartIDBKeyFromValueAndKeyPathFromIOThread(
const std::vector<content::SerializedScriptValue>& values,
- const string16& key_path) {
+ const IndexedDBKeyPath& key_path) {
if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) {
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
@@ -326,7 +328,7 @@ void KeyUtilityClientImpl::CallStartIDBKeyFromValueAndKeyPathFromIOThread(
void KeyUtilityClientImpl::CallStartInjectIDBKeyFromIOThread(
const IndexedDBKey& key,
const content::SerializedScriptValue& value,
- const string16& key_path) {
+ const IndexedDBKeyPath& key_path) {
if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) {
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
@@ -380,8 +382,6 @@ bool KeyUtilityClientImpl::Client::OnMessageReceived(
IPC_BEGIN_MESSAGE_MAP(KeyUtilityClientImpl::Client, message)
IPC_MESSAGE_HANDLER(UtilityHostMsg_IDBKeysFromValuesAndKeyPath_Succeeded,
OnIDBKeysFromValuesAndKeyPathSucceeded)
- IPC_MESSAGE_HANDLER(UtilityHostMsg_IDBKeysFromValuesAndKeyPath_Failed,
- OnIDBKeysFromValuesAndKeyPathFailed)
IPC_MESSAGE_HANDLER(UtilityHostMsg_InjectIDBKey_Finished,
OnInjectIDBKeyFinished)
IPC_MESSAGE_UNHANDLED(handled = false)

Powered by Google App Engine
This is Rietveld 408576698