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

Side by Side Diff: webkit/quota/quota_database.cc

Issue 10700035: When fetching origins from the quota database, include the ones where the modification time exactly… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: unit test Created 8 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | webkit/quota/quota_database_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | webkit/quota/quota_database_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698