OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "webkit/quota/quota_database.h" | 5 #include "webkit/quota/quota_database.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 return statement.Succeeded(); | 365 return statement.Succeeded(); |
366 } | 366 } |
367 | 367 |
368 bool QuotaDatabase::GetOriginsModifiedSince( | 368 bool QuotaDatabase::GetOriginsModifiedSince( |
369 StorageType type, std::set<GURL>* origins, base::Time modified_since) { | 369 StorageType type, std::set<GURL>* origins, base::Time modified_since) { |
370 DCHECK(origins); | 370 DCHECK(origins); |
371 if (!LazyOpen(false)) | 371 if (!LazyOpen(false)) |
372 return false; | 372 return false; |
373 | 373 |
374 const char* kSql = "SELECT origin FROM OriginInfoTable" | 374 const char* kSql = "SELECT origin FROM OriginInfoTable" |
375 " WHERE type = ? AND last_modified_time > ?"; | 375 " WHERE type = ? AND last_modified_time >= ?"; |
376 | 376 |
377 sql::Statement statement(db_->GetCachedStatement(SQL_FROM_HERE, kSql)); | 377 sql::Statement statement(db_->GetCachedStatement(SQL_FROM_HERE, kSql)); |
378 statement.BindInt(0, static_cast<int>(type)); | 378 statement.BindInt(0, static_cast<int>(type)); |
379 statement.BindInt64(1, modified_since.ToInternalValue()); | 379 statement.BindInt64(1, modified_since.ToInternalValue()); |
380 | 380 |
381 origins->clear(); | 381 origins->clear(); |
382 while (statement.Step()) | 382 while (statement.Step()) |
383 origins->insert(GURL(statement.ColumnString(0))); | 383 origins->insert(GURL(statement.ColumnString(0))); |
384 | 384 |
385 return statement.Succeeded(); | 385 return statement.Succeeded(); |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
662 if (lhs.origin < rhs.origin) return true; | 662 if (lhs.origin < rhs.origin) return true; |
663 if (rhs.origin < lhs.origin) return false; | 663 if (rhs.origin < lhs.origin) return false; |
664 if (lhs.type < rhs.type) return true; | 664 if (lhs.type < rhs.type) return true; |
665 if (rhs.type < lhs.type) return false; | 665 if (rhs.type < lhs.type) return false; |
666 if (lhs.used_count < rhs.used_count) return true; | 666 if (lhs.used_count < rhs.used_count) return true; |
667 if (rhs.used_count < lhs.used_count) return false; | 667 if (rhs.used_count < lhs.used_count) return false; |
668 return lhs.last_access_time < rhs.last_access_time; | 668 return lhs.last_access_time < rhs.last_access_time; |
669 } | 669 } |
670 | 670 |
671 } // quota namespace | 671 } // quota namespace |
OLD | NEW |