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

Unified Diff: webkit/appcache/appcache_database.cc

Issue 7031065: AppCache + Quota integration (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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
« no previous file with comments | « webkit/appcache/appcache_database.h ('k') | webkit/appcache/appcache_database_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/appcache/appcache_database.cc
===================================================================
--- webkit/appcache/appcache_database.cc (revision 88615)
+++ webkit/appcache/appcache_database.cc (working copy)
@@ -15,7 +15,6 @@
#include "base/utf_string_conversions.h"
#include "webkit/appcache/appcache_entry.h"
#include "webkit/appcache/appcache_histograms.h"
-#include "webkit/database/quota_table.h"
// Schema -------------------------------------------------------------------
namespace {
@@ -196,12 +195,15 @@
return origin_usage;
}
-int64 AppCacheDatabase::GetOriginQuota(const GURL& origin) {
- if (!LazyOpen(false))
- return GetDefaultOriginQuota();
- int64 quota = quota_table_->GetOriginQuota(
- UTF8ToUTF16(origin.spec().c_str()));
- return (quota >= 0) ? quota : GetDefaultOriginQuota();
+bool AppCacheDatabase::GetAllOriginUsage(std::map<GURL, int64>* usage_map) {
+ std::set<GURL> origins;
+ if (!FindOriginsWithGroups(&origins))
+ return false;
+ for (std::set<GURL>::const_iterator origin = origins.begin();
+ origin != origins.end(); ++origin) {
+ (*usage_map)[*origin] = GetOriginUsage(*origin);
+ }
+ return true;
}
bool AppCacheDatabase::FindOriginsWithGroups(std::set<GURL>* origins) {
@@ -1004,7 +1006,6 @@
db_.reset(new sql::Connection);
meta_table_.reset(new sql::MetaTable);
- quota_table_.reset(new webkit_database::QuotaTable(db_.get()));
db_->set_error_delegate(GetErrorHandlerForAppCacheDb());
@@ -1069,10 +1070,8 @@
if (!transaction.Begin())
return false;
- if (!meta_table_->Init(db_.get(), kCurrentVersion, kCompatibleVersion) ||
- !quota_table_->Init()) {
+ if (!meta_table_->Init(db_.get(), kCurrentVersion, kCompatibleVersion))
return false;
- }
for (int i = 0; i < kTableCount; ++i) {
std::string sql("CREATE TABLE ");
@@ -1108,7 +1107,6 @@
}
void AppCacheDatabase::ResetConnectionAndTables() {
- quota_table_.reset();
meta_table_.reset();
db_.reset();
}
« no previous file with comments | « webkit/appcache/appcache_database.h ('k') | webkit/appcache/appcache_database_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698