| 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 WEBKIT_BROWSER_APPCACHE_APPCACHE_DATABASE_H_ |
| 6 #define WEBKIT_BROWSER_APPCACHE_APPCACHE_DATABASE_H_ | 6 #define WEBKIT_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.h" | 16 #include "base/time.h" |
| 17 #include "googleurl/src/gurl.h" | 17 #include "googleurl/src/gurl.h" |
| 18 #include "webkit/browser/webkit_storage_browser_export.h" |
| 18 #include "webkit/common/appcache/appcache_interfaces.h" | 19 #include "webkit/common/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 WEBKIT_STORAGE_EXPORT AppCacheDatabase { | 30 class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheDatabase { |
| 31 public: | 31 public: |
| 32 struct WEBKIT_STORAGE_EXPORT GroupRecord { | 32 struct WEBKIT_STORAGE_BROWSER_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 WEBKIT_STORAGE_EXPORT CacheRecord { | 43 struct WEBKIT_STORAGE_BROWSER_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 WEBKIT_STORAGE_EXPORT NamespaceRecord { | 64 struct WEBKIT_STORAGE_BROWSER_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 Namespace namespace_; | 70 Namespace namespace_; |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 typedef std::vector<NamespaceRecord> NamespaceRecordVector; | 73 typedef std::vector<NamespaceRecord> NamespaceRecordVector; |
| 74 | 74 |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, OriginUsage); | 217 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, OriginUsage); |
| 218 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, UpgradeSchema3to5); | 218 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, UpgradeSchema3to5); |
| 219 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, UpgradeSchema4to5); | 219 FRIEND_TEST_ALL_PREFIXES(AppCacheDatabaseTest, UpgradeSchema4to5); |
| 220 | 220 |
| 221 DISALLOW_COPY_AND_ASSIGN(AppCacheDatabase); | 221 DISALLOW_COPY_AND_ASSIGN(AppCacheDatabase); |
| 222 }; | 222 }; |
| 223 | 223 |
| 224 } // namespace appcache | 224 } // namespace appcache |
| 225 | 225 |
| 226 #endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_DATABASE_H_ | 226 #endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_DATABASE_H_ |
| OLD | NEW |