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

Side by Side Diff: storage/browser/quota/quota_database.cc

Issue 1164073005: Allow script to request durable storage permission (chrome side) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased onto content setting patch Created 5 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "storage/browser/quota/quota_database.h" 5 #include "storage/browser/quota/quota_database.h"
6 6
7 #include <vector> 7 #include <vector>
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 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 " ORDER BY last_access_time ASC"; 336 " ORDER BY last_access_time ASC";
337 337
338 sql::Statement statement(db_->GetCachedStatement(SQL_FROM_HERE, kSql)); 338 sql::Statement statement(db_->GetCachedStatement(SQL_FROM_HERE, kSql));
339 statement.BindInt(0, static_cast<int>(type)); 339 statement.BindInt(0, static_cast<int>(type));
340 340
341 while (statement.Step()) { 341 while (statement.Step()) {
342 GURL url(statement.ColumnString(0)); 342 GURL url(statement.ColumnString(0));
343 if (exceptions.find(url) != exceptions.end()) 343 if (exceptions.find(url) != exceptions.end())
344 continue; 344 continue;
345 if (special_storage_policy && 345 if (special_storage_policy &&
346 special_storage_policy->IsStorageUnlimited(url)) 346 (special_storage_policy->IsStorageDurable(url) ||
347 special_storage_policy->IsStorageUnlimited(url)))
347 continue; 348 continue;
348 *origin = url; 349 *origin = url;
349 return true; 350 return true;
350 } 351 }
351 352
352 *origin = GURL(); 353 *origin = GURL();
353 return statement.Succeeded(); 354 return statement.Succeeded();
354 } 355 }
355 356
356 bool QuotaDatabase::GetOriginsModifiedSince( 357 bool QuotaDatabase::GetOriginsModifiedSince(
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 if (lhs.origin < rhs.origin) return true; 646 if (lhs.origin < rhs.origin) return true;
646 if (rhs.origin < lhs.origin) return false; 647 if (rhs.origin < lhs.origin) return false;
647 if (lhs.type < rhs.type) return true; 648 if (lhs.type < rhs.type) return true;
648 if (rhs.type < lhs.type) return false; 649 if (rhs.type < lhs.type) return false;
649 if (lhs.used_count < rhs.used_count) return true; 650 if (lhs.used_count < rhs.used_count) return true;
650 if (rhs.used_count < lhs.used_count) return false; 651 if (rhs.used_count < lhs.used_count) return false;
651 return lhs.last_access_time < rhs.last_access_time; 652 return lhs.last_access_time < rhs.last_access_time;
652 } 653 }
653 654
654 } // namespace storage 655 } // namespace storage
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698