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 #ifndef WEBKIT_BROWSER_APPCACHE_APPCACHE_DATABASE_H_ | 5 #ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_DATABASE_H_ |
6 #define WEBKIT_BROWSER_APPCACHE_APPCACHE_DATABASE_H_ | 6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_DATABASE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "base/time/time.h" | 16 #include "base/time/time.h" |
| 17 #include "content/common/appcache_interfaces.h" |
| 18 #include "content/common/content_export.h" |
17 #include "url/gurl.h" | 19 #include "url/gurl.h" |
18 #include "webkit/browser/webkit_storage_browser_export.h" | |
19 #include "webkit/common/appcache/appcache_interfaces.h" | |
20 | 20 |
21 namespace sql { | 21 namespace sql { |
22 class Connection; | 22 class Connection; |
23 class MetaTable; | 23 class MetaTable; |
24 class Statement; | 24 class Statement; |
25 class StatementID; | 25 class StatementID; |
26 } | 26 } |
27 | 27 |
28 namespace content { | 28 namespace content { |
29 FORWARD_DECLARE_TEST(AppCacheDatabaseTest, CacheRecords); | 29 FORWARD_DECLARE_TEST(AppCacheDatabaseTest, CacheRecords); |
30 FORWARD_DECLARE_TEST(AppCacheDatabaseTest, EntryRecords); | 30 FORWARD_DECLARE_TEST(AppCacheDatabaseTest, EntryRecords); |
31 FORWARD_DECLARE_TEST(AppCacheDatabaseTest, QuickIntegrityCheck); | 31 FORWARD_DECLARE_TEST(AppCacheDatabaseTest, QuickIntegrityCheck); |
32 FORWARD_DECLARE_TEST(AppCacheDatabaseTest, NamespaceRecords); | 32 FORWARD_DECLARE_TEST(AppCacheDatabaseTest, NamespaceRecords); |
33 FORWARD_DECLARE_TEST(AppCacheDatabaseTest, GroupRecords); | 33 FORWARD_DECLARE_TEST(AppCacheDatabaseTest, GroupRecords); |
34 FORWARD_DECLARE_TEST(AppCacheDatabaseTest, LazyOpen); | 34 FORWARD_DECLARE_TEST(AppCacheDatabaseTest, LazyOpen); |
35 FORWARD_DECLARE_TEST(AppCacheDatabaseTest, ExperimentalFlags); | 35 FORWARD_DECLARE_TEST(AppCacheDatabaseTest, ExperimentalFlags); |
36 FORWARD_DECLARE_TEST(AppCacheDatabaseTest, OnlineWhiteListRecords); | 36 FORWARD_DECLARE_TEST(AppCacheDatabaseTest, OnlineWhiteListRecords); |
37 FORWARD_DECLARE_TEST(AppCacheDatabaseTest, ReCreate); | 37 FORWARD_DECLARE_TEST(AppCacheDatabaseTest, ReCreate); |
38 FORWARD_DECLARE_TEST(AppCacheDatabaseTest, DeletableResponseIds); | 38 FORWARD_DECLARE_TEST(AppCacheDatabaseTest, DeletableResponseIds); |
39 FORWARD_DECLARE_TEST(AppCacheDatabaseTest, OriginUsage); | 39 FORWARD_DECLARE_TEST(AppCacheDatabaseTest, OriginUsage); |
40 FORWARD_DECLARE_TEST(AppCacheDatabaseTest, UpgradeSchema3to5); | 40 FORWARD_DECLARE_TEST(AppCacheDatabaseTest, UpgradeSchema3to5); |
41 FORWARD_DECLARE_TEST(AppCacheDatabaseTest, UpgradeSchema4to5); | 41 FORWARD_DECLARE_TEST(AppCacheDatabaseTest, UpgradeSchema4to5); |
42 FORWARD_DECLARE_TEST(AppCacheDatabaseTest, WasCorrutionDetected); | 42 FORWARD_DECLARE_TEST(AppCacheDatabaseTest, WasCorrutionDetected); |
43 class AppCacheDatabaseTest; | 43 class AppCacheDatabaseTest; |
44 class AppCacheStorageImplTest; | 44 class AppCacheStorageImplTest; |
45 } | 45 } |
46 | 46 |
47 namespace appcache { | 47 namespace content { |
48 | 48 |
49 class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheDatabase { | 49 class CONTENT_EXPORT AppCacheDatabase { |
50 public: | 50 public: |
51 struct WEBKIT_STORAGE_BROWSER_EXPORT GroupRecord { | 51 struct CONTENT_EXPORT GroupRecord { |
52 GroupRecord(); | 52 GroupRecord(); |
53 ~GroupRecord(); | 53 ~GroupRecord(); |
54 | 54 |
55 int64 group_id; | 55 int64 group_id; |
56 GURL origin; | 56 GURL origin; |
57 GURL manifest_url; | 57 GURL manifest_url; |
58 base::Time creation_time; | 58 base::Time creation_time; |
59 base::Time last_access_time; | 59 base::Time last_access_time; |
60 }; | 60 }; |
61 | 61 |
62 struct WEBKIT_STORAGE_BROWSER_EXPORT CacheRecord { | 62 struct CONTENT_EXPORT CacheRecord { |
63 CacheRecord() | 63 CacheRecord() |
64 : cache_id(0), group_id(0), online_wildcard(false), cache_size(0) {} | 64 : cache_id(0), group_id(0), online_wildcard(false), cache_size(0) {} |
65 | 65 |
66 int64 cache_id; | 66 int64 cache_id; |
67 int64 group_id; | 67 int64 group_id; |
68 bool online_wildcard; | 68 bool online_wildcard; |
69 base::Time update_time; | 69 base::Time update_time; |
70 int64 cache_size; // the sum of all response sizes in this cache | 70 int64 cache_size; // the sum of all response sizes in this cache |
71 }; | 71 }; |
72 | 72 |
73 struct EntryRecord { | 73 struct EntryRecord { |
74 EntryRecord() : cache_id(0), flags(0), response_id(0), response_size(0) {} | 74 EntryRecord() : cache_id(0), flags(0), response_id(0), response_size(0) {} |
75 | 75 |
76 int64 cache_id; | 76 int64 cache_id; |
77 GURL url; | 77 GURL url; |
78 int flags; | 78 int flags; |
79 int64 response_id; | 79 int64 response_id; |
80 int64 response_size; | 80 int64 response_size; |
81 }; | 81 }; |
82 | 82 |
83 struct WEBKIT_STORAGE_BROWSER_EXPORT NamespaceRecord { | 83 struct CONTENT_EXPORT NamespaceRecord { |
84 NamespaceRecord(); | 84 NamespaceRecord(); |
85 ~NamespaceRecord(); | 85 ~NamespaceRecord(); |
86 | 86 |
87 int64 cache_id; | 87 int64 cache_id; |
88 GURL origin; | 88 GURL origin; |
89 Namespace namespace_; | 89 AppCacheNamespace namespace_; |
90 }; | 90 }; |
91 | 91 |
92 typedef std::vector<NamespaceRecord> NamespaceRecordVector; | 92 typedef std::vector<NamespaceRecord> NamespaceRecordVector; |
93 | 93 |
94 struct OnlineWhiteListRecord { | 94 struct OnlineWhiteListRecord { |
95 OnlineWhiteListRecord() : cache_id(0), is_pattern(false) {} | 95 OnlineWhiteListRecord() : cache_id(0), is_pattern(false) {} |
96 | 96 |
97 int64 cache_id; | 97 int64 cache_id; |
98 GURL namespace_url; | 98 GURL namespace_url; |
99 bool is_pattern; | 99 bool is_pattern; |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 FRIEND_TEST_ALL_PREFIXES(content::AppCacheDatabaseTest, ReCreate); | 242 FRIEND_TEST_ALL_PREFIXES(content::AppCacheDatabaseTest, ReCreate); |
243 FRIEND_TEST_ALL_PREFIXES(content::AppCacheDatabaseTest, DeletableResponseIds); | 243 FRIEND_TEST_ALL_PREFIXES(content::AppCacheDatabaseTest, DeletableResponseIds); |
244 FRIEND_TEST_ALL_PREFIXES(content::AppCacheDatabaseTest, OriginUsage); | 244 FRIEND_TEST_ALL_PREFIXES(content::AppCacheDatabaseTest, OriginUsage); |
245 FRIEND_TEST_ALL_PREFIXES(content::AppCacheDatabaseTest, UpgradeSchema3to5); | 245 FRIEND_TEST_ALL_PREFIXES(content::AppCacheDatabaseTest, UpgradeSchema3to5); |
246 FRIEND_TEST_ALL_PREFIXES(content::AppCacheDatabaseTest, UpgradeSchema4to5); | 246 FRIEND_TEST_ALL_PREFIXES(content::AppCacheDatabaseTest, UpgradeSchema4to5); |
247 FRIEND_TEST_ALL_PREFIXES(content::AppCacheDatabaseTest, WasCorrutionDetected); | 247 FRIEND_TEST_ALL_PREFIXES(content::AppCacheDatabaseTest, WasCorrutionDetected); |
248 | 248 |
249 DISALLOW_COPY_AND_ASSIGN(AppCacheDatabase); | 249 DISALLOW_COPY_AND_ASSIGN(AppCacheDatabase); |
250 }; | 250 }; |
251 | 251 |
252 } // namespace appcache | 252 } // namespace content |
253 | 253 |
254 #endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_DATABASE_H_ | 254 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_DATABASE_H_ |
OLD | NEW |