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

Side by Side Diff: webkit/browser/quota/usage_tracker.cc

Issue 23545016: Not creating ClientUsageTracker for unsupported storage type. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | « webkit/browser/quota/quota_client.h ('k') | webkit/browser/quota/usage_tracker_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 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 "webkit/browser/quota/usage_tracker.h" 5 #include "webkit/browser/quota/usage_tracker.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <deque> 8 #include <deque>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 // UsageTracker ---------------------------------------------------------- 71 // UsageTracker ----------------------------------------------------------
72 72
73 UsageTracker::UsageTracker(const QuotaClientList& clients, 73 UsageTracker::UsageTracker(const QuotaClientList& clients,
74 StorageType type, 74 StorageType type,
75 SpecialStoragePolicy* special_storage_policy) 75 SpecialStoragePolicy* special_storage_policy)
76 : type_(type), 76 : type_(type),
77 weak_factory_(this) { 77 weak_factory_(this) {
78 for (QuotaClientList::const_iterator iter = clients.begin(); 78 for (QuotaClientList::const_iterator iter = clients.begin();
79 iter != clients.end(); 79 iter != clients.end();
80 ++iter) { 80 ++iter) {
81 client_tracker_map_[(*iter)->id()] = 81 if ((*iter)->DoesSupport(type)) {
82 new ClientUsageTracker(this, *iter, type, special_storage_policy); 82 client_tracker_map_[(*iter)->id()] =
83 new ClientUsageTracker(this, *iter, type, special_storage_policy);
84 }
83 } 85 }
84 } 86 }
85 87
86 UsageTracker::~UsageTracker() { 88 UsageTracker::~UsageTracker() {
87 STLDeleteValues(&client_tracker_map_); 89 STLDeleteValues(&client_tracker_map_);
88 } 90 }
89 91
90 ClientUsageTracker* UsageTracker::GetClientTracker(QuotaClient::ID client_id) { 92 ClientUsageTracker* UsageTracker::GetClientTracker(QuotaClient::ID client_id) {
91 ClientTrackerMap::iterator found = client_tracker_map_.find(client_id); 93 ClientTrackerMap::iterator found = client_tracker_map_.find(client_id);
92 if (found != client_tracker_map_.end()) 94 if (found != client_tracker_map_.end())
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 } 663 }
662 664
663 bool ClientUsageTracker::IsStorageUnlimited(const GURL& origin) const { 665 bool ClientUsageTracker::IsStorageUnlimited(const GURL& origin) const {
664 if (type_ == kStorageTypeSyncable) 666 if (type_ == kStorageTypeSyncable)
665 return false; 667 return false;
666 return special_storage_policy_.get() && 668 return special_storage_policy_.get() &&
667 special_storage_policy_->IsStorageUnlimited(origin); 669 special_storage_policy_->IsStorageUnlimited(origin);
668 } 670 }
669 671
670 } // namespace quota 672 } // namespace quota
OLDNEW
« no previous file with comments | « webkit/browser/quota/quota_client.h ('k') | webkit/browser/quota/usage_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698