| OLD | NEW |
| 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 #ifndef CONTENT_PUBLIC_TEST_MOCK_STORAGE_CLIENT_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_MOCK_STORAGE_CLIENT_H_ |
| 6 #define CONTENT_PUBLIC_TEST_MOCK_STORAGE_CLIENT_H_ | 6 #define CONTENT_PUBLIC_TEST_MOCK_STORAGE_CLIENT_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <utility> | 11 #include <utility> |
| 12 | 12 |
| 13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
| 16 #include "url/gurl.h" | 16 #include "url/gurl.h" |
| 17 #include "webkit/browser/quota/quota_client.h" | 17 #include "webkit/browser/quota/quota_client.h" |
| 18 | 18 |
| 19 namespace quota { | 19 namespace storage { |
| 20 class QuotaManagerProxy; | 20 class QuotaManagerProxy; |
| 21 } | 21 } |
| 22 | 22 |
| 23 using quota::QuotaClient; | 23 using storage::QuotaClient; |
| 24 using quota::QuotaManagerProxy; | 24 using storage::QuotaManagerProxy; |
| 25 using quota::StorageType; | 25 using storage::StorageType; |
| 26 | 26 |
| 27 namespace content { | 27 namespace content { |
| 28 | 28 |
| 29 struct MockOriginData { | 29 struct MockOriginData { |
| 30 const char* origin; | 30 const char* origin; |
| 31 StorageType type; | 31 StorageType type; |
| 32 int64 usage; | 32 int64 usage; |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 // Mock storage class for testing. | 35 // Mock storage class for testing. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 58 virtual void GetOriginUsage(const GURL& origin_url, | 58 virtual void GetOriginUsage(const GURL& origin_url, |
| 59 StorageType type, | 59 StorageType type, |
| 60 const GetUsageCallback& callback) OVERRIDE; | 60 const GetUsageCallback& callback) OVERRIDE; |
| 61 virtual void GetOriginsForType(StorageType type, | 61 virtual void GetOriginsForType(StorageType type, |
| 62 const GetOriginsCallback& callback) OVERRIDE; | 62 const GetOriginsCallback& callback) OVERRIDE; |
| 63 virtual void GetOriginsForHost(StorageType type, const std::string& host, | 63 virtual void GetOriginsForHost(StorageType type, const std::string& host, |
| 64 const GetOriginsCallback& callback) OVERRIDE; | 64 const GetOriginsCallback& callback) OVERRIDE; |
| 65 virtual void DeleteOriginData(const GURL& origin, | 65 virtual void DeleteOriginData(const GURL& origin, |
| 66 StorageType type, | 66 StorageType type, |
| 67 const DeletionCallback& callback) OVERRIDE; | 67 const DeletionCallback& callback) OVERRIDE; |
| 68 virtual bool DoesSupport(quota::StorageType type) const OVERRIDE; | 68 virtual bool DoesSupport(storage::StorageType type) const OVERRIDE; |
| 69 | 69 |
| 70 private: | 70 private: |
| 71 void RunGetOriginUsage(const GURL& origin_url, | 71 void RunGetOriginUsage(const GURL& origin_url, |
| 72 StorageType type, | 72 StorageType type, |
| 73 const GetUsageCallback& callback); | 73 const GetUsageCallback& callback); |
| 74 void RunGetOriginsForType(StorageType type, | 74 void RunGetOriginsForType(StorageType type, |
| 75 const GetOriginsCallback& callback); | 75 const GetOriginsCallback& callback); |
| 76 void RunGetOriginsForHost(StorageType type, | 76 void RunGetOriginsForHost(StorageType type, |
| 77 const std::string& host, | 77 const std::string& host, |
| 78 const GetOriginsCallback& callback); | 78 const GetOriginsCallback& callback); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 93 int mock_time_counter_; | 93 int mock_time_counter_; |
| 94 | 94 |
| 95 base::WeakPtrFactory<MockStorageClient> weak_factory_; | 95 base::WeakPtrFactory<MockStorageClient> weak_factory_; |
| 96 | 96 |
| 97 DISALLOW_COPY_AND_ASSIGN(MockStorageClient); | 97 DISALLOW_COPY_AND_ASSIGN(MockStorageClient); |
| 98 }; | 98 }; |
| 99 | 99 |
| 100 } // namespace content | 100 } // namespace content |
| 101 | 101 |
| 102 #endif // CONTENT_PUBLIC_TEST_MOCK_STORAGE_CLIENT_H_ | 102 #endif // CONTENT_PUBLIC_TEST_MOCK_STORAGE_CLIENT_H_ |
| OLD | NEW |