OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/mock_storage_client.h" | 5 #include "webkit/quota/mock_storage_client.h" |
6 | 6 |
7 #include "base/atomic_sequence_num.h" | |
8 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
9 #include "base/bind.h" | 8 #include "base/bind.h" |
10 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
11 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
12 #include "base/message_loop_proxy.h" | 11 #include "base/message_loop_proxy.h" |
13 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
14 #include "net/base/net_util.h" | 13 #include "net/base/net_util.h" |
15 #include "webkit/quota/quota_manager.h" | 14 #include "webkit/quota/quota_manager.h" |
16 | 15 |
17 using base::AtomicSequenceNumber; | |
18 | |
19 namespace quota { | 16 namespace quota { |
20 | 17 |
21 using std::make_pair; | 18 using std::make_pair; |
22 | 19 |
23 MockStorageClient::MockStorageClient( | 20 MockStorageClient::MockStorageClient( |
24 QuotaManagerProxy* quota_manager_proxy, | 21 QuotaManagerProxy* quota_manager_proxy, |
25 const MockOriginData* mock_data, QuotaClient::ID id, size_t mock_data_size) | 22 const MockOriginData* mock_data, QuotaClient::ID id, size_t mock_data_size) |
26 : quota_manager_proxy_(quota_manager_proxy), | 23 : quota_manager_proxy_(quota_manager_proxy), |
27 id_(id), | 24 id_(id), |
28 mock_time_counter_(0), | 25 mock_time_counter_(0), |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 int64 delta = itr->second; | 173 int64 delta = itr->second; |
177 quota_manager_proxy_-> | 174 quota_manager_proxy_-> |
178 NotifyStorageModified(id(), origin_url, type, -delta); | 175 NotifyStorageModified(id(), origin_url, type, -delta); |
179 origin_data_.erase(itr); | 176 origin_data_.erase(itr); |
180 } | 177 } |
181 | 178 |
182 callback.Run(kQuotaStatusOk); | 179 callback.Run(kQuotaStatusOk); |
183 } | 180 } |
184 | 181 |
185 } // namespace quota | 182 } // namespace quota |
OLD | NEW |