diff options
Diffstat (limited to 'storage/browser/quota/quota_database.cc')
-rw-r--r-- | storage/browser/quota/quota_database.cc | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/storage/browser/quota/quota_database.cc b/storage/browser/quota/quota_database.cc index 5fcacd5..36632c6 100644 --- a/storage/browser/quota/quota_database.cc +++ b/storage/browser/quota/quota_database.cc @@ -275,7 +275,7 @@ bool QuotaDatabase::GetOriginLastEvictionTime(const GURL& origin, statement.BindInt(1, static_cast<int>(type)); if (!statement.Step()) - return statement.Succeeded(); + return false; *last_modified_time = base::Time::FromInternalValue(statement.ColumnInt64(0)); return true; @@ -346,6 +346,31 @@ bool QuotaDatabase::RegisterInitialOriginInfo( return true; } +bool QuotaDatabase::GetOriginInfo(const GURL& origin, + StorageType type, + QuotaDatabase::OriginInfoTableEntry* entry) { + if (!LazyOpen(false)) + return false; + + const char* kSql = + "SELECT * FROM OriginInfoTable" + " WHERE origin = ? AND type = ?"; + sql::Statement statement(db_->GetCachedStatement(SQL_FROM_HERE, kSql)); + statement.BindString(0, origin.spec()); + statement.BindInt(1, static_cast<int>(type)); + + if (!statement.Step()) + return false; + + *entry = OriginInfoTableEntry( + GURL(statement.ColumnString(0)), + static_cast<StorageType>(statement.ColumnInt(1)), statement.ColumnInt(2), + base::Time::FromInternalValue(statement.ColumnInt64(3)), + base::Time::FromInternalValue(statement.ColumnInt64(4))); + + return true; +} + bool QuotaDatabase::DeleteHostQuota( const std::string& host, StorageType type) { if (!LazyOpen(false)) |