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

Side by Side Diff: content/browser/quota/mock_quota_manager.cc

Issue 1403673002: Add Quota.TimeSinceOriginEvicted UMA histogram. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix histogram comment Created 5 years, 2 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "content/browser/quota/mock_quota_manager.h" 5 #include "content/browser/quota/mock_quota_manager.h"
6 6
7 #include "base/location.h" 7 #include "base/location.h"
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 if (current->type == type && current->modified >= modified_since) 93 if (current->type == type && current->modified >= modified_since)
94 origins_to_return->insert(current->origin); 94 origins_to_return->insert(current->origin);
95 } 95 }
96 96
97 base::ThreadTaskRunnerHandle::Get()->PostTask( 97 base::ThreadTaskRunnerHandle::Get()->PostTask(
98 FROM_HERE, base::Bind(&MockQuotaManager::DidGetModifiedSince, 98 FROM_HERE, base::Bind(&MockQuotaManager::DidGetModifiedSince,
99 weak_factory_.GetWeakPtr(), callback, 99 weak_factory_.GetWeakPtr(), callback,
100 base::Owned(origins_to_return), type)); 100 base::Owned(origins_to_return), type));
101 } 101 }
102 102
103 void MockQuotaManager::DeleteOriginData( 103 void MockQuotaManager::DeleteOriginData(const GURL& origin,
104 const GURL& origin, 104 StorageType type,
105 StorageType type, 105 int quota_client_mask,
106 int quota_client_mask, 106 bool is_eviction,
107 const StatusCallback& callback) { 107 const StatusCallback& callback) {
108 for (std::vector<OriginInfo>::iterator current = origins_.begin(); 108 for (std::vector<OriginInfo>::iterator current = origins_.begin();
109 current != origins_.end(); 109 current != origins_.end();
110 ++current) { 110 ++current) {
111 if (current->origin == origin && current->type == type) { 111 if (current->origin == origin && current->type == type) {
112 // Modify the mask: if it's 0 after "deletion", remove the origin. 112 // Modify the mask: if it's 0 after "deletion", remove the origin.
113 current->quota_client_mask &= ~quota_client_mask; 113 current->quota_client_mask &= ~quota_client_mask;
114 if (current->quota_client_mask == 0) 114 if (current->quota_client_mask == 0)
115 origins_.erase(current); 115 origins_.erase(current);
116 break; 116 break;
117 } 117 }
(...skipping 19 matching lines...) Expand all
137 callback.Run(*origins, storage_type); 137 callback.Run(*origins, storage_type);
138 } 138 }
139 139
140 void MockQuotaManager::DidDeleteOriginData( 140 void MockQuotaManager::DidDeleteOriginData(
141 const StatusCallback& callback, 141 const StatusCallback& callback,
142 QuotaStatusCode status) { 142 QuotaStatusCode status) {
143 callback.Run(status); 143 callback.Run(status);
144 } 144 }
145 145
146 } // namespace content 146 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698