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

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

Issue 9567030: Fix and re-enable IndexedDBBrowserTestWithLowQuota.QuotaTest (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: respond to comments Created 8 years, 10 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
« no previous file with comments | « content/browser/in_process_webkit/indexed_db_browsertest.cc ('k') | webkit/fileapi/file_system_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/in_process_webkit/indexed_db_dispatcher_host.cc
diff --git a/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc b/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc
index 20d8bb4f111c2ca9face001aa3c7216122bd9d55..38f94fa714fe58301fa3bf6b9e8dff83c893b2a2 100644
--- a/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc
+++ b/content/browser/in_process_webkit/indexed_db_dispatcher_host.cc
@@ -29,11 +29,13 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBTransaction.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h"
+#include "webkit/database/database_util.h"
#include "webkit/glue/webkit_glue.h"
using content::BrowserMessageFilter;
using content::BrowserThread;
using content::UserMetricsAction;
+using webkit_database::DatabaseUtil;
using WebKit::WebDOMStringList;
using WebKit::WebExceptionCode;
using WebKit::WebIDBCallbacks;
@@ -206,22 +208,10 @@ WebIDBCursor* IndexedDBDispatcherHost::GetCursorFromId(int32 cursor_id) {
void IndexedDBDispatcherHost::OnIDBFactoryGetDatabaseNames(
const IndexedDBHostMsg_FactoryGetDatabaseNames_Params& params) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED));
- FilePath base_path = indexed_db_context_->data_path();
- FilePath indexed_db_path;
- if (!base_path.empty()) {
- indexed_db_path = base_path.Append(
- IndexedDBContextImpl::kIndexedDBDirectory);
- }
+ FilePath indexed_db_path = indexed_db_context_->data_path();
- // TODO(jorlow): This doesn't support file:/// urls properly. We probably need
- // to add some toString method to WebSecurityOrigin that doesn't
- // return null for them. Look at
- // DatabaseUtil::GetOriginFromIdentifier.
WebSecurityOrigin origin(
WebSecurityOrigin::createFromDatabaseIdentifier(params.origin));
- GURL origin_url(origin.toString());
-
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED));
Context()->GetIDBFactory()->getDatabaseNames(
new IndexedDBCallbacks<WebDOMStringList>(this, params.thread_id,
@@ -232,20 +222,11 @@ void IndexedDBDispatcherHost::OnIDBFactoryGetDatabaseNames(
void IndexedDBDispatcherHost::OnIDBFactoryOpen(
const IndexedDBHostMsg_FactoryOpen_Params& params) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED));
- FilePath base_path = indexed_db_context_->data_path();
- FilePath indexed_db_path;
- if (!base_path.empty()) {
- indexed_db_path = base_path.Append(
- IndexedDBContextImpl::kIndexedDBDirectory);
- }
+ FilePath indexed_db_path = indexed_db_context_->data_path();
- // TODO(jorlow): This doesn't support file:/// urls properly. We probably need
- // to add some toString method to WebSecurityOrigin that doesn't
- // return null for them. Look at
- // DatabaseUtil::GetOriginFromIdentifier.
+ GURL origin_url = DatabaseUtil::GetOriginFromIdentifier(params.origin);
WebSecurityOrigin origin(
WebSecurityOrigin::createFromDatabaseIdentifier(params.origin));
- GURL origin_url(origin.toString());
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED));
@@ -260,12 +241,7 @@ void IndexedDBDispatcherHost::OnIDBFactoryOpen(
void IndexedDBDispatcherHost::OnIDBFactoryDeleteDatabase(
const IndexedDBHostMsg_FactoryDeleteDatabase_Params& params) {
- FilePath base_path = indexed_db_context_->data_path();
- FilePath indexed_db_path;
- if (!base_path.empty()) {
- indexed_db_path = base_path.Append(
- IndexedDBContextImpl::kIndexedDBDirectory);
- }
+ FilePath indexed_db_path = indexed_db_context_->data_path();
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED));
Context()->GetIDBFactory()->deleteDatabase(
@@ -1208,6 +1184,7 @@ void IndexedDBDispatcherHost::
return;
// TODO(dgrogan): Tell the page the transaction aborted because of quota.
+ // http://crbug.com/113118
if (parent_->Context()->WouldBeOverQuota(
transaction_url_map_[transaction_id],
transaction_size_map_[transaction_id])) {
« no previous file with comments | « content/browser/in_process_webkit/indexed_db_browsertest.cc ('k') | webkit/fileapi/file_system_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698