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

Unified Diff: content/browser/indexed_db/indexed_db_dispatcher_host.cc

Issue 17915004: IndexedDB: Remove uses of WebKit API types from back-end code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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/indexed_db/indexed_db_dispatcher_host.cc
diff --git a/content/browser/indexed_db/indexed_db_dispatcher_host.cc b/content/browser/indexed_db/indexed_db_dispatcher_host.cc
index 996f653f597911f49d0ad189173492a3546e762f..c827bbe7a822f502f590ef6a12613c55fc29ecb5 100644
--- a/content/browser/indexed_db/indexed_db_dispatcher_host.cc
+++ b/content/browser/indexed_db/indexed_db_dispatcher_host.cc
@@ -27,17 +27,18 @@
#include "content/public/common/result_codes.h"
#include "googleurl/src/gurl.h"
#include "third_party/WebKit/public/platform/WebIDBDatabase.h"
-#include "third_party/WebKit/public/platform/WebIDBDatabaseError.h"
#include "third_party/WebKit/public/platform/WebIDBDatabaseException.h"
#include "webkit/browser/database/database_util.h"
#include "webkit/common/database/database_identifier.h"
using webkit_database::DatabaseUtil;
-using WebKit::WebIDBDatabaseError;
using WebKit::WebIDBKey;
namespace content {
+static const char* kQuotaExceededErrorMessage =
+ "An attempt was made to add something to storage that exceeded the quota.";
jamesr 2013/06/26 20:08:25 shouldn't this go in a resources file somewhere?
jsbell 2013/06/26 20:14:28 Exception messages aren't localized. This particul
jsbell 2013/06/26 22:12:47 Changed it to pass through blank messages if the f
+
IndexedDBDispatcherHost::IndexedDBDispatcherHost(
int ipc_process_id,
IndexedDBContextImpl* indexed_db_context)
@@ -221,7 +222,7 @@ void IndexedDBDispatcherHost::OnIDBFactoryGetDatabaseNames(
Context()->GetIDBFactory()->getDatabaseNames(
new IndexedDBCallbacks<std::vector<string16> >(
this, params.ipc_thread_id, params.ipc_callbacks_id),
- WebKit::WebString::fromUTF8(params.database_identifier),
+ base::UTF8ToUTF16(params.database_identifier),
indexed_db_path.AsUTF16Unsafe());
}
@@ -249,7 +250,7 @@ void IndexedDBDispatcherHost::OnIDBFactoryOpen(
origin_url),
new IndexedDBDatabaseCallbacks(
this, params.ipc_thread_id, params.ipc_database_callbacks_id),
- WebKit::WebString::fromUTF8(params.database_identifier),
+ base::UTF8ToUTF16(params.database_identifier),
indexed_db_path.AsUTF16Unsafe());
}
@@ -262,7 +263,7 @@ void IndexedDBDispatcherHost::OnIDBFactoryDeleteDatabase(
->deleteDatabase(params.name,
new IndexedDBCallbacks<std::vector<char> >(
this, params.ipc_thread_id, params.ipc_callbacks_id),
- WebKit::WebString::fromUTF8(params.database_identifier),
+ base::UTF8ToUTF16(params.database_identifier),
indexed_db_path.AsUTF16Unsafe());
}
@@ -350,7 +351,8 @@ void IndexedDBDispatcherHost::DatabaseDispatcherHost::CloseAll() {
if (database) {
database->abort(
transaction_id,
- WebIDBDatabaseError(WebKit::WebIDBDatabaseExceptionUnknownError));
+ IndexedDBDatabaseError(WebKit::WebIDBDatabaseExceptionUnknownError,
+ "Connection closed."));
}
}
DCHECK(transaction_database_map_.empty());
@@ -424,7 +426,8 @@ void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnCreateObjectStore(
database_url_map_[params.ipc_database_id])) {
database->abort(
host_transaction_id,
- WebIDBDatabaseError(WebKit::WebIDBDatabaseExceptionQuotaError));
+ IndexedDBDatabaseError(WebKit::WebIDBDatabaseExceptionQuotaError,
+ kQuotaExceededErrorMessage));
}
}
@@ -551,7 +554,7 @@ void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnSetIndexKeys(
if (params.index_ids.size() != params.index_keys.size()) {
database->abort(
host_transaction_id,
- WebIDBDatabaseError(
+ IndexedDBDatabaseError(
WebKit::WebIDBDatabaseExceptionUnknownError,
"Malformed IPC message: index_ids.size() != index_keys.size()"));
return;
@@ -691,7 +694,8 @@ void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnCommit(
transaction_url_map_[host_transaction_id], transaction_size)) {
database->abort(
host_transaction_id,
- WebIDBDatabaseError(WebKit::WebIDBDatabaseExceptionQuotaError));
+ IndexedDBDatabaseError(WebKit::WebIDBDatabaseExceptionQuotaError,
+ kQuotaExceededErrorMessage));
return;
}
@@ -719,7 +723,8 @@ void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnCreateIndex(
database_url_map_[params.ipc_database_id])) {
database->abort(
host_transaction_id,
- WebIDBDatabaseError(WebKit::WebIDBDatabaseExceptionQuotaError));
+ IndexedDBDatabaseError(WebKit::WebIDBDatabaseExceptionQuotaError,
+ kQuotaExceededErrorMessage));
}
}
« no previous file with comments | « content/browser/indexed_db/indexed_db_database_unittest.cc ('k') | content/browser/indexed_db/indexed_db_internals_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698