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

Unified Diff: webkit/database/quota_table.cc

Issue 9249025: Database usage adjustment for .../webkit (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head 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 | « webkit/database/databases_table.cc ('k') | webkit/quota/quota_database.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
index e9065ef25e957e0d9eab640d57125106bece483e..2733c12f4a1694ae0c664e2402b783b2bebaeaba 100644
--- a/webkit/database/quota_table.cc
+++ b/webkit/database/quota_table.cc
@@ -24,9 +24,9 @@ bool QuotaTable::Init() {
int64 QuotaTable::GetOriginQuota(const string16& origin_identifier) {
sql::Statement statement(db_->GetCachedStatement(
SQL_FROM_HERE, "SELECT quota FROM Quota WHERE origin = ?"));
- if (statement.is_valid() &&
- statement.BindString(0, UTF16ToUTF8(origin_identifier)) &&
- statement.Step()) {
+ statement.BindString16(0, origin_identifier);
+
+ if (statement.Step()) {
return statement.ColumnInt64(0);
}
@@ -40,24 +40,18 @@ bool QuotaTable::SetOriginQuota(const string16& origin_identifier,
// Insert or update the quota for this origin.
sql::Statement replace_statement(db_->GetCachedStatement(
SQL_FROM_HERE, "REPLACE INTO Quota VALUES (?, ?)"));
- if (replace_statement.is_valid() &&
- replace_statement.BindString(0, UTF16ToUTF8(origin_identifier)) &&
- replace_statement.BindInt64(1, quota)) {
- return replace_statement.Run();
- }
+ replace_statement.BindString16(0, origin_identifier);
+ replace_statement.BindInt64(1, quota);
- return false;
+ return replace_statement.Run();
}
bool QuotaTable::ClearOriginQuota(const string16& origin_identifier) {
sql::Statement statement(db_->GetCachedStatement(
SQL_FROM_HERE, "DELETE FROM Quota WHERE origin = ?"));
- if (statement.is_valid() &&
- statement.BindString(0, UTF16ToUTF8(origin_identifier))) {
- return (statement.Run() && db_->GetLastChangeCount());
- }
+ statement.BindString16(0, origin_identifier);
- return false;
+ return (statement.Run() && db_->GetLastChangeCount());
}
} // namespace webkit_database
« no previous file with comments | « webkit/database/databases_table.cc ('k') | webkit/quota/quota_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698