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

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

Issue 16155009: Update webkit/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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_task.h ('k') | webkit/common/blob/scoped_file.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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 SpecialStoragePolicy* special_storage_policy) 272 SpecialStoragePolicy* special_storage_policy)
273 : tracker_(tracker), 273 : tracker_(tracker),
274 client_(client), 274 client_(client),
275 type_(type), 275 type_(type),
276 global_limited_usage_(0), 276 global_limited_usage_(0),
277 global_unlimited_usage_(0), 277 global_unlimited_usage_(0),
278 global_usage_retrieved_(false), 278 global_usage_retrieved_(false),
279 special_storage_policy_(special_storage_policy) { 279 special_storage_policy_(special_storage_policy) {
280 DCHECK(tracker_); 280 DCHECK(tracker_);
281 DCHECK(client_); 281 DCHECK(client_);
282 if (special_storage_policy_) 282 if (special_storage_policy_.get())
283 special_storage_policy_->AddObserver(this); 283 special_storage_policy_->AddObserver(this);
284 } 284 }
285 285
286 ClientUsageTracker::~ClientUsageTracker() { 286 ClientUsageTracker::~ClientUsageTracker() {
287 if (special_storage_policy_) 287 if (special_storage_policy_.get())
288 special_storage_policy_->RemoveObserver(this); 288 special_storage_policy_->RemoveObserver(this);
289 } 289 }
290 290
291 void ClientUsageTracker::GetGlobalLimitedUsage(const UsageCallback& callback) { 291 void ClientUsageTracker::GetGlobalLimitedUsage(const UsageCallback& callback) {
292 if (!global_usage_retrieved_) { 292 if (!global_usage_retrieved_) {
293 GetGlobalUsage(base::Bind(&DidGetGlobalUsageForLimitedGlobalUsage, 293 GetGlobalUsage(base::Bind(&DidGetGlobalUsageForLimitedGlobalUsage,
294 callback)); 294 callback));
295 return; 295 return;
296 } 296 }
297 297
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 } 661 }
662 662
663 bool ClientUsageTracker::IsStorageUnlimited(const GURL& origin) const { 663 bool ClientUsageTracker::IsStorageUnlimited(const GURL& origin) const {
664 if (type_ == kStorageTypeSyncable) 664 if (type_ == kStorageTypeSyncable)
665 return false; 665 return false;
666 return special_storage_policy_.get() && 666 return special_storage_policy_.get() &&
667 special_storage_policy_->IsStorageUnlimited(origin); 667 special_storage_policy_->IsStorageUnlimited(origin);
668 } 668 }
669 669
670 } // namespace quota 670 } // namespace quota
OLDNEW
« no previous file with comments | « webkit/browser/quota/quota_task.h ('k') | webkit/common/blob/scoped_file.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698