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

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

Issue 7606011: Track usage per-origin at the lowest level instead of per-host. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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/quota/quota_manager.h ('k') | webkit/quota/usage_tracker.h » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_manager.h" 5 #include "webkit/quota/quota_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <deque> 8 #include <deque>
9 #include <set> 9 #include <set>
10 10
(...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after
968 GetUsageAndQuotaCallback* callback_ptr) { 968 GetUsageAndQuotaCallback* callback_ptr) {
969 scoped_ptr<GetUsageAndQuotaCallback> callback(callback_ptr); 969 scoped_ptr<GetUsageAndQuotaCallback> callback(callback_ptr);
970 LazyInitialize(); 970 LazyInitialize();
971 971
972 if (type == kStorageTypeUnknown) { 972 if (type == kStorageTypeUnknown) {
973 // Quota only supports temporary/persistent types. 973 // Quota only supports temporary/persistent types.
974 callback->Run(kQuotaErrorNotSupported, 0, 0); 974 callback->Run(kQuotaErrorNotSupported, 0, 0);
975 return; 975 return;
976 } 976 }
977 977
978 // note: returns host usage and quota
978 std::string host = net::GetHostOrSpecFromURL(origin); 979 std::string host = net::GetHostOrSpecFromURL(origin);
979 UsageAndQuotaDispatcherTaskMap::iterator found = 980 UsageAndQuotaDispatcherTaskMap::iterator found =
980 usage_and_quota_dispatchers_.find(std::make_pair(host, type)); 981 usage_and_quota_dispatchers_.find(std::make_pair(host, type));
981 if (found == usage_and_quota_dispatchers_.end()) { 982 if (found == usage_and_quota_dispatchers_.end()) {
982 UsageAndQuotaDispatcherTask* dispatcher = 983 UsageAndQuotaDispatcherTask* dispatcher =
983 UsageAndQuotaDispatcherTask::Create(this, host, type); 984 UsageAndQuotaDispatcherTask::Create(this, host, type);
984 found = usage_and_quota_dispatchers_.insert( 985 found = usage_and_quota_dispatchers_.insert(
985 std::make_pair(std::make_pair(host, type), dispatcher)).first; 986 std::make_pair(std::make_pair(host, type), dispatcher)).first;
986 } 987 }
987 if (found->second->AddCallback( 988 if (found->second->AddCallback(
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after
1565 1566
1566 QuotaManagerProxy::QuotaManagerProxy( 1567 QuotaManagerProxy::QuotaManagerProxy(
1567 QuotaManager* manager, base::MessageLoopProxy* io_thread) 1568 QuotaManager* manager, base::MessageLoopProxy* io_thread)
1568 : manager_(manager), io_thread_(io_thread) { 1569 : manager_(manager), io_thread_(io_thread) {
1569 } 1570 }
1570 1571
1571 QuotaManagerProxy::~QuotaManagerProxy() { 1572 QuotaManagerProxy::~QuotaManagerProxy() {
1572 } 1573 }
1573 1574
1574 } // namespace quota 1575 } // namespace quota
OLDNEW
« no previous file with comments | « webkit/quota/quota_manager.h ('k') | webkit/quota/usage_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698