OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |