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_APPCACHE_APPCACHE_DATABASE_H_ | 5 #ifndef WEBKIT_APPCACHE_APPCACHE_DATABASE_H_ |
6 #define WEBKIT_APPCACHE_APPCACHE_DATABASE_H_ | 6 #define WEBKIT_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/file_path.h" | 13 #include "base/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.h" | 16 #include "base/time.h" |
17 #include "googleurl/src/gurl.h" | 17 #include "googleurl/src/gurl.h" |
18 #include "webkit/appcache/appcache_export.h" | |
19 #include "webkit/appcache/appcache_interfaces.h" | 18 #include "webkit/appcache/appcache_interfaces.h" |
| 19 #include "webkit/storage/webkit_storage_export.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 appcache { | 28 namespace appcache { |
29 | 29 |
30 class APPCACHE_EXPORT AppCacheDatabase { | 30 class WEBKIT_STORAGE_EXPORT AppCacheDatabase { |
31 public: | 31 public: |
32 struct APPCACHE_EXPORT GroupRecord { | 32 struct WEBKIT_STORAGE_EXPORT GroupRecord { |
33 GroupRecord(); | 33 GroupRecord(); |
34 ~GroupRecord(); | 34 ~GroupRecord(); |
35 | 35 |
36 int64 group_id; | 36 int64 group_id; |
37 GURL origin; | 37 GURL origin; |
38 GURL manifest_url; | 38 GURL manifest_url; |
39 base::Time creation_time; | 39 base::Time creation_time; |
40 base::Time last_access_time; | 40 base::Time last_access_time; |
41 }; | 41 }; |
42 | 42 |
43 struct APPCACHE_EXPORT CacheRecord { | 43 struct WEBKIT_STORAGE_EXPORT CacheRecord { |
44 CacheRecord() | 44 CacheRecord() |
45 : cache_id(0), group_id(0), online_wildcard(false), cache_size(0) {} | 45 : cache_id(0), group_id(0), online_wildcard(false), cache_size(0) {} |
46 | 46 |
47 int64 cache_id; | 47 int64 cache_id; |
48 int64 group_id; | 48 int64 group_id; |
49 bool online_wildcard; | 49 bool online_wildcard; |
50 base::Time update_time; | 50 base::Time update_time; |
51 int64 cache_size; // the sum of all response sizes in this cache | 51 int64 cache_size; // the sum of all response sizes in this cache |
52 }; | 52 }; |
53 | 53 |
54 struct EntryRecord { | 54 struct EntryRecord { |
55 EntryRecord() : cache_id(0), flags(0), response_id(0), response_size(0) {} | 55 EntryRecord() : cache_id(0), flags(0), response_id(0), response_size(0) {} |
56 | 56 |
57 int64 cache_id; | 57 int64 cache_id; |
58 GURL url; | 58 GURL url; |
59 int flags; | 59 int flags; |
60 int64 response_id; | 60 int64 response_id; |
61 int64 response_size; | 61 int64 response_size; |
62 }; | 62 }; |
63 | 63 |
64 struct APPCACHE_EXPORT NamespaceRecord { | 64 struct WEBKIT_STORAGE_EXPORT NamespaceRecord { |
65 NamespaceRecord(); | 65 NamespaceRecord(); |
66 ~NamespaceRecord(); | 66 ~NamespaceRecord(); |
67 | 67 |
68 int64 cache_id; | 68 int64 cache_id; |
69 GURL origin; | 69 GURL origin; |
70 NamespaceType type; | 70 NamespaceType type; |
71 GURL namespace_url; | 71 GURL namespace_url; |
72 GURL target_url; | 72 GURL target_url; |
73 }; | 73 }; |
74 | 74 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, DeletableResponseIds); | 216 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, DeletableResponseIds); |
217 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, OriginUsage); | 217 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, OriginUsage); |
218 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, UpgradeSchema3to4); | 218 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, UpgradeSchema3to4); |
219 | 219 |
220 DISALLOW_COPY_AND_ASSIGN(AppCacheDatabase); | 220 DISALLOW_COPY_AND_ASSIGN(AppCacheDatabase); |
221 }; | 221 }; |
222 | 222 |
223 } // namespace appcache | 223 } // namespace appcache |
224 | 224 |
225 #endif // WEBKIT_APPCACHE_APPCACHE_DATABASE_H_ | 225 #endif // WEBKIT_APPCACHE_APPCACHE_DATABASE_H_ |
OLD | NEW |