OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_INTERFACES_H_ | 5 #ifndef WEBKIT_APPCACHE_APPCACHE_INTERFACES_H_ |
6 #define WEBKIT_APPCACHE_APPCACHE_INTERFACES_H_ | 6 #define WEBKIT_APPCACHE_APPCACHE_INTERFACES_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
47 OBSOLETE_EVENT | 47 OBSOLETE_EVENT |
48 }; | 48 }; |
49 | 49 |
50 enum LogLevel { | 50 enum LogLevel { |
51 LOG_TIP, | 51 LOG_TIP, |
52 LOG_INFO, | 52 LOG_INFO, |
53 LOG_WARNING, | 53 LOG_WARNING, |
54 LOG_ERROR, | 54 LOG_ERROR, |
55 }; | 55 }; |
56 | 56 |
57 enum NamespaceType { | |
58 FALLBACK_NAMESPACE, | |
59 INTERCEPT_NAMESPACE | |
60 }; | |
61 | |
57 struct APPCACHE_EXPORT AppCacheInfo { | 62 struct APPCACHE_EXPORT AppCacheInfo { |
58 AppCacheInfo(); | 63 AppCacheInfo(); |
59 ~AppCacheInfo(); | 64 ~AppCacheInfo(); |
60 | 65 |
61 GURL manifest_url; | 66 GURL manifest_url; |
62 base::Time creation_time; | 67 base::Time creation_time; |
63 base::Time last_update_time; | 68 base::Time last_update_time; |
64 base::Time last_access_time; | 69 base::Time last_access_time; |
65 int64 cache_id; | 70 int64 cache_id; |
66 int64 group_id; | 71 int64 group_id; |
67 Status status; | 72 Status status; |
68 int64 size; | 73 int64 size; |
69 bool is_complete; | 74 bool is_complete; |
70 }; | 75 }; |
71 | 76 |
72 typedef std::vector<AppCacheInfo> AppCacheInfoVector; | 77 typedef std::vector<AppCacheInfo> AppCacheInfoVector; |
73 | 78 |
74 // Type to hold information about a single appcache resource. | 79 // Type to hold information about a single appcache resource. |
75 struct APPCACHE_EXPORT AppCacheResourceInfo { | 80 struct APPCACHE_EXPORT AppCacheResourceInfo { |
76 AppCacheResourceInfo(); | 81 AppCacheResourceInfo(); |
77 ~AppCacheResourceInfo(); | 82 ~AppCacheResourceInfo(); |
78 | 83 |
79 GURL url; | 84 GURL url; |
80 int64 size; | 85 int64 size; |
81 bool is_master; | 86 bool is_master; |
82 bool is_manifest; | 87 bool is_manifest; |
88 bool is_intercept; | |
83 bool is_fallback; | 89 bool is_fallback; |
84 bool is_foreign; | 90 bool is_foreign; |
85 bool is_explicit; | 91 bool is_explicit; |
86 int64 response_id; | 92 int64 response_id; |
87 }; | 93 }; |
88 | 94 |
89 typedef std::vector<AppCacheResourceInfo> AppCacheResourceInfoVector; | 95 typedef std::vector<AppCacheResourceInfo> AppCacheResourceInfoVector; |
90 | 96 |
97 struct APPCACHE_EXPORT Namespace { | |
98 Namespace(); | |
jennb
2011/12/05 23:23:07
Should comment that default is Fallback namespace
michaeln
2011/12/06 19:41:24
Done.
| |
99 Namespace(NamespaceType type, const GURL& url, const GURL& target); | |
100 ~Namespace(); | |
101 | |
102 NamespaceType type; | |
103 GURL namespace_url; | |
104 GURL target_url; | |
105 }; | |
106 | |
107 typedef std::vector<Namespace> NamespaceVector; | |
108 | |
91 // Interface used by backend (browser-process) to talk to frontend (renderer). | 109 // Interface used by backend (browser-process) to talk to frontend (renderer). |
92 class APPCACHE_EXPORT AppCacheFrontend { | 110 class APPCACHE_EXPORT AppCacheFrontend { |
93 public: | 111 public: |
94 virtual void OnCacheSelected( | 112 virtual void OnCacheSelected( |
95 int host_id, const appcache::AppCacheInfo& info) = 0; | 113 int host_id, const appcache::AppCacheInfo& info) = 0; |
96 virtual void OnStatusChanged(const std::vector<int>& host_ids, | 114 virtual void OnStatusChanged(const std::vector<int>& host_ids, |
97 Status status) = 0; | 115 Status status) = 0; |
98 virtual void OnEventRaised(const std::vector<int>& host_ids, | 116 virtual void OnEventRaised(const std::vector<int>& host_ids, |
99 EventID event_id) = 0; | 117 EventID event_id) = 0; |
100 virtual void OnProgressEventRaised(const std::vector<int>& host_ids, | 118 virtual void OnProgressEventRaised(const std::vector<int>& host_ids, |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
148 | 166 |
149 bool IsSchemeSupported(const GURL& url); | 167 bool IsSchemeSupported(const GURL& url); |
150 bool IsMethodSupported(const std::string& method); | 168 bool IsMethodSupported(const std::string& method); |
151 bool IsSchemeAndMethodSupported(const net::URLRequest* request); | 169 bool IsSchemeAndMethodSupported(const net::URLRequest* request); |
152 | 170 |
153 APPCACHE_EXPORT extern const FilePath::CharType kAppCacheDatabaseName[]; | 171 APPCACHE_EXPORT extern const FilePath::CharType kAppCacheDatabaseName[]; |
154 | 172 |
155 } // namespace | 173 } // namespace |
156 | 174 |
157 #endif // WEBKIT_APPCACHE_APPCACHE_INTERFACES_H_ | 175 #endif // WEBKIT_APPCACHE_APPCACHE_INTERFACES_H_ |
OLD | NEW |