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

Unified Diff: webkit/database/quota_table.cc

Issue 11274003: webkit: Merge 'database' and 'quota' to 'webkit_storage' (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More EXPORT for Win Created 8 years, 2 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/database/quota_table.h ('k') | webkit/database/quota_table_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/database/quota_table.cc
diff --git a/webkit/database/quota_table.cc b/webkit/database/quota_table.cc
deleted file mode 100644
index 9f49200f38c096818a18b247ac12f0938a640058..0000000000000000000000000000000000000000
--- a/webkit/database/quota_table.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "webkit/database/quota_table.h"
-
-#include "base/logging.h"
-#include "base/utf_string_conversions.h"
-#include "sql/statement.h"
-
-namespace webkit_database {
-
-bool QuotaTable::Init() {
- // 'Quota' schema:
- // origin The origin.
- // quota The quota for this origin.
- return db_->DoesTableExist("Quota") ||
- db_->Execute(
- "CREATE TABLE Quota ("
- "origin TEXT NOT NULL PRIMARY KEY, "
- "quota INTEGER NOT NULL)");
-}
-
-int64 QuotaTable::GetOriginQuota(const string16& origin_identifier) {
- sql::Statement statement(db_->GetCachedStatement(
- SQL_FROM_HERE, "SELECT quota FROM Quota WHERE origin = ?"));
- statement.BindString16(0, origin_identifier);
- if (statement.Step()) {
- return statement.ColumnInt64(0);
- }
-
- return -1;
-}
-
-bool QuotaTable::SetOriginQuota(const string16& origin_identifier,
- int64 quota) {
- DCHECK(quota >= 0);
-
- // Insert or update the quota for this origin.
- sql::Statement replace_statement(db_->GetCachedStatement(
- SQL_FROM_HERE, "REPLACE INTO Quota VALUES (?, ?)"));
- replace_statement.BindString16(0, origin_identifier);
- replace_statement.BindInt64(1, quota);
- return replace_statement.Run();
-}
-
-bool QuotaTable::ClearOriginQuota(const string16& origin_identifier) {
- sql::Statement statement(db_->GetCachedStatement(
- SQL_FROM_HERE, "DELETE FROM Quota WHERE origin = ?"));
- statement.BindString16(0, origin_identifier);
-
- return (statement.Run() && db_->GetLastChangeCount());
-}
-
-} // namespace webkit_database
« no previous file with comments | « webkit/database/quota_table.h ('k') | webkit/database/quota_table_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698