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_COMMON_APPCACHE_APPCACHE_INTERFACES_H_ | 5 #ifndef WEBKIT_COMMON_APPCACHE_APPCACHE_INTERFACES_H_ |
6 #define WEBKIT_COMMON_APPCACHE_APPCACHE_INTERFACES_H_ | 6 #define WEBKIT_COMMON_APPCACHE_APPCACHE_INTERFACES_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 LOG_WARNING = 2, | 57 LOG_WARNING = 2, |
58 LOG_ERROR = 3, | 58 LOG_ERROR = 3, |
59 }; | 59 }; |
60 | 60 |
61 enum NamespaceType { | 61 enum NamespaceType { |
62 FALLBACK_NAMESPACE, | 62 FALLBACK_NAMESPACE, |
63 INTERCEPT_NAMESPACE, | 63 INTERCEPT_NAMESPACE, |
64 NETWORK_NAMESPACE | 64 NETWORK_NAMESPACE |
65 }; | 65 }; |
66 | 66 |
| 67 enum ErrorReason { |
| 68 MANIFEST_ERROR, |
| 69 SIGNATURE_ERROR, |
| 70 RESOURCE_ERROR, |
| 71 CHANGED_ERROR, |
| 72 ABORT_ERROR, |
| 73 QUOTA_ERROR, |
| 74 POLICY_ERROR, |
| 75 UNKNOWN_ERROR, |
| 76 ERROR_REASON_LAST = UNKNOWN_ERROR |
| 77 }; |
| 78 |
67 struct WEBKIT_STORAGE_COMMON_EXPORT AppCacheInfo { | 79 struct WEBKIT_STORAGE_COMMON_EXPORT AppCacheInfo { |
68 AppCacheInfo(); | 80 AppCacheInfo(); |
69 ~AppCacheInfo(); | 81 ~AppCacheInfo(); |
70 | 82 |
71 GURL manifest_url; | 83 GURL manifest_url; |
72 base::Time creation_time; | 84 base::Time creation_time; |
73 base::Time last_update_time; | 85 base::Time last_update_time; |
74 base::Time last_access_time; | 86 base::Time last_access_time; |
75 int64 cache_id; | 87 int64 cache_id; |
76 int64 group_id; | 88 int64 group_id; |
(...skipping 13 matching lines...) Expand all Loading... |
90 int64 size; | 102 int64 size; |
91 bool is_master; | 103 bool is_master; |
92 bool is_manifest; | 104 bool is_manifest; |
93 bool is_intercept; | 105 bool is_intercept; |
94 bool is_fallback; | 106 bool is_fallback; |
95 bool is_foreign; | 107 bool is_foreign; |
96 bool is_explicit; | 108 bool is_explicit; |
97 int64 response_id; | 109 int64 response_id; |
98 }; | 110 }; |
99 | 111 |
| 112 struct WEBKIT_STORAGE_COMMON_EXPORT ErrorDetails { |
| 113 ErrorDetails(); |
| 114 ErrorDetails(std::string message, |
| 115 ErrorReason reason, |
| 116 GURL url, |
| 117 int status, |
| 118 bool is_cross_origin); |
| 119 ~ErrorDetails(); |
| 120 |
| 121 std::string message; |
| 122 ErrorReason reason; |
| 123 GURL url; |
| 124 int status; |
| 125 bool is_cross_origin; |
| 126 }; |
| 127 |
100 typedef std::vector<AppCacheResourceInfo> AppCacheResourceInfoVector; | 128 typedef std::vector<AppCacheResourceInfo> AppCacheResourceInfoVector; |
101 | 129 |
102 struct WEBKIT_STORAGE_COMMON_EXPORT Namespace { | 130 struct WEBKIT_STORAGE_COMMON_EXPORT Namespace { |
103 Namespace(); // Type is set to FALLBACK_NAMESPACE by default. | 131 Namespace(); // Type is set to FALLBACK_NAMESPACE by default. |
104 Namespace(NamespaceType type, const GURL& url, const GURL& target, | 132 Namespace(NamespaceType type, const GURL& url, const GURL& target, |
105 bool is_pattern); | 133 bool is_pattern); |
106 Namespace(NamespaceType type, const GURL& url, const GURL& target, | 134 Namespace(NamespaceType type, const GURL& url, const GURL& target, |
107 bool is_pattern, bool is_executable); | 135 bool is_pattern, bool is_executable); |
108 ~Namespace(); | 136 ~Namespace(); |
109 | 137 |
(...skipping 14 matching lines...) Expand all Loading... |
124 virtual void OnCacheSelected( | 152 virtual void OnCacheSelected( |
125 int host_id, const appcache::AppCacheInfo& info) = 0; | 153 int host_id, const appcache::AppCacheInfo& info) = 0; |
126 virtual void OnStatusChanged(const std::vector<int>& host_ids, | 154 virtual void OnStatusChanged(const std::vector<int>& host_ids, |
127 Status status) = 0; | 155 Status status) = 0; |
128 virtual void OnEventRaised(const std::vector<int>& host_ids, | 156 virtual void OnEventRaised(const std::vector<int>& host_ids, |
129 EventID event_id) = 0; | 157 EventID event_id) = 0; |
130 virtual void OnProgressEventRaised(const std::vector<int>& host_ids, | 158 virtual void OnProgressEventRaised(const std::vector<int>& host_ids, |
131 const GURL& url, | 159 const GURL& url, |
132 int num_total, int num_complete) = 0; | 160 int num_total, int num_complete) = 0; |
133 virtual void OnErrorEventRaised(const std::vector<int>& host_ids, | 161 virtual void OnErrorEventRaised(const std::vector<int>& host_ids, |
134 const std::string& message) = 0; | 162 const appcache::ErrorDetails& details) = 0; |
135 virtual void OnContentBlocked(int host_id, | 163 virtual void OnContentBlocked(int host_id, |
136 const GURL& manifest_url) = 0; | 164 const GURL& manifest_url) = 0; |
137 virtual void OnLogMessage(int host_id, LogLevel log_level, | 165 virtual void OnLogMessage(int host_id, LogLevel log_level, |
138 const std::string& message) = 0; | 166 const std::string& message) = 0; |
139 virtual ~AppCacheFrontend() {} | 167 virtual ~AppCacheFrontend() {} |
140 }; | 168 }; |
141 | 169 |
142 // Interface used by frontend (renderer) to talk to backend (browser-process). | 170 // Interface used by frontend (renderer) to talk to backend (browser-process). |
143 class WEBKIT_STORAGE_COMMON_EXPORT AppCacheBackend { | 171 class WEBKIT_STORAGE_COMMON_EXPORT AppCacheBackend { |
144 public: | 172 public: |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 WEBKIT_STORAGE_COMMON_EXPORT bool IsMethodSupported(const std::string& method); | 212 WEBKIT_STORAGE_COMMON_EXPORT bool IsMethodSupported(const std::string& method); |
185 WEBKIT_STORAGE_COMMON_EXPORT bool IsSchemeAndMethodSupported( | 213 WEBKIT_STORAGE_COMMON_EXPORT bool IsSchemeAndMethodSupported( |
186 const net::URLRequest* request); | 214 const net::URLRequest* request); |
187 | 215 |
188 WEBKIT_STORAGE_COMMON_EXPORT extern const base::FilePath::CharType | 216 WEBKIT_STORAGE_COMMON_EXPORT extern const base::FilePath::CharType |
189 kAppCacheDatabaseName[]; | 217 kAppCacheDatabaseName[]; |
190 | 218 |
191 } // namespace | 219 } // namespace |
192 | 220 |
193 #endif // WEBKIT_COMMON_APPCACHE_APPCACHE_INTERFACES_H_ | 221 #endif // WEBKIT_COMMON_APPCACHE_APPCACHE_INTERFACES_H_ |
OLD | NEW |