Chromium Code Reviews| Index: content/common/appcache_interfaces.h |
| diff --git a/webkit/common/appcache/appcache_interfaces.h b/content/common/appcache_interfaces.h |
| similarity index 63% |
| rename from webkit/common/appcache/appcache_interfaces.h |
| rename to content/common/appcache_interfaces.h |
| index 558d6e2e4dde841fb718a132feda23acb2acf4c4..91f349894fcd89accbdf8fd13e625c072fdcff0a 100644 |
| --- a/webkit/common/appcache/appcache_interfaces.h |
| +++ b/content/common/appcache_interfaces.h |
| @@ -2,41 +2,20 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#ifndef WEBKIT_COMMON_APPCACHE_APPCACHE_INTERFACES_H_ |
| -#define WEBKIT_COMMON_APPCACHE_APPCACHE_INTERFACES_H_ |
| +#ifndef CONTENT_COMMON_APPCACHE_APPCACHE_INTERFACES_H_ |
| +#define CONTENT_COMMON_APPCACHE_APPCACHE_INTERFACES_H_ |
| #include <string> |
| -#include <vector> |
| #include "base/basictypes.h" |
| #include "base/files/file_path.h" |
| -#include "base/time/time.h" |
| -#include "url/gurl.h" |
| -#include "webkit/common/webkit_storage_common_export.h" |
| +#include "content/public/common/appcache_info.h" |
| namespace net { |
| class URLRequest; |
| } |
| -namespace appcache { |
| - |
| -// Defines constants, types, and abstract classes used in the main |
| -// process and in child processes. |
|
michaeln
2014/06/20 22:21:11
please retain this comment in this .h file
|
| - |
| -static const int kAppCacheNoHostId = 0; |
| -static const int64 kAppCacheNoCacheId = 0; |
| -static const int64 kAppCacheNoResponseId = 0; |
| -static const int64 kAppCacheUnknownCacheId = -1; |
| - |
| -enum AppCacheStatus { |
| - APPCACHE_STATUS_UNCACHED, |
| - APPCACHE_STATUS_IDLE, |
| - APPCACHE_STATUS_CHECKING, |
| - APPCACHE_STATUS_DOWNLOADING, |
| - APPCACHE_STATUS_UPDATE_READY, |
| - APPCACHE_STATUS_OBSOLETE, |
| - APPCACHE_STATUS_LAST = APPCACHE_STATUS_OBSOLETE |
| -}; |
| +namespace content { |
| enum AppCacheEventID { |
| APPCACHE_CHECKING_EVENT, |
| @@ -76,25 +55,8 @@ enum AppCacheErrorReason { |
| APPCACHE_ERROR_REASON_LAST = APPCACHE_UNKNOWN_ERROR |
| }; |
| -struct WEBKIT_STORAGE_COMMON_EXPORT AppCacheInfo { |
| - AppCacheInfo(); |
| - ~AppCacheInfo(); |
| - |
| - GURL manifest_url; |
| - base::Time creation_time; |
| - base::Time last_update_time; |
| - base::Time last_access_time; |
| - int64 cache_id; |
| - int64 group_id; |
| - AppCacheStatus status; |
| - int64 size; |
| - bool is_complete; |
| -}; |
| - |
| -typedef std::vector<AppCacheInfo> AppCacheInfoVector; |
| - |
| // Type to hold information about a single appcache resource. |
| -struct WEBKIT_STORAGE_COMMON_EXPORT AppCacheResourceInfo { |
| +struct CONTENT_EXPORT AppCacheResourceInfo { |
| AppCacheResourceInfo(); |
| ~AppCacheResourceInfo(); |
| @@ -109,7 +71,7 @@ struct WEBKIT_STORAGE_COMMON_EXPORT AppCacheResourceInfo { |
| int64 response_id; |
| }; |
| -struct WEBKIT_STORAGE_COMMON_EXPORT AppCacheErrorDetails { |
| +struct CONTENT_EXPORT AppCacheErrorDetails { |
| AppCacheErrorDetails(); |
| AppCacheErrorDetails(std::string message, |
| AppCacheErrorReason reason, |
| @@ -127,13 +89,13 @@ struct WEBKIT_STORAGE_COMMON_EXPORT AppCacheErrorDetails { |
| typedef std::vector<AppCacheResourceInfo> AppCacheResourceInfoVector; |
| -struct WEBKIT_STORAGE_COMMON_EXPORT Namespace { |
| - Namespace(); // Type is set to APPCACHE_FALLBACK_NAMESPACE by default. |
| - Namespace(AppCacheNamespaceType type, const GURL& url, const GURL& target, |
| - bool is_pattern); |
| - Namespace(AppCacheNamespaceType type, const GURL& url, const GURL& target, |
| - bool is_pattern, bool is_executable); |
| - ~Namespace(); |
| +struct CONTENT_EXPORT AppCacheNamespace { |
| + AppCacheNamespace(); // Type is APPCACHE_FALLBACK_NAMESPACE by default. |
| + AppCacheNamespace(AppCacheNamespaceType type, const GURL& url, |
| + const GURL& target, bool is_pattern); |
| + AppCacheNamespace(AppCacheNamespaceType type, const GURL& url, |
| + const GURL& target, bool is_pattern, bool is_executable); |
| + ~AppCacheNamespace(); |
| bool IsMatch(const GURL& url) const; |
| @@ -144,13 +106,13 @@ struct WEBKIT_STORAGE_COMMON_EXPORT Namespace { |
| bool is_executable; |
| }; |
| -typedef std::vector<Namespace> NamespaceVector; |
| +typedef std::vector<AppCacheNamespace> AppCacheNamespaceVector; |
| // Interface used by backend (browser-process) to talk to frontend (renderer). |
| -class WEBKIT_STORAGE_COMMON_EXPORT AppCacheFrontend { |
| +class CONTENT_EXPORT AppCacheFrontend { |
| public: |
| virtual void OnCacheSelected( |
| - int host_id, const appcache::AppCacheInfo& info) = 0; |
| + int host_id, const AppCacheInfo& info) = 0; |
| virtual void OnStatusChanged(const std::vector<int>& host_ids, |
| AppCacheStatus status) = 0; |
| virtual void OnEventRaised(const std::vector<int>& host_ids, |
| @@ -160,7 +122,7 @@ class WEBKIT_STORAGE_COMMON_EXPORT AppCacheFrontend { |
| int num_total, int num_complete) = 0; |
| virtual void OnErrorEventRaised( |
| const std::vector<int>& host_ids, |
| - const appcache::AppCacheErrorDetails& details) = 0; |
| + const AppCacheErrorDetails& details) = 0; |
| virtual void OnContentBlocked(int host_id, |
| const GURL& manifest_url) = 0; |
| virtual void OnLogMessage(int host_id, AppCacheLogLevel log_level, |
| @@ -169,7 +131,7 @@ class WEBKIT_STORAGE_COMMON_EXPORT AppCacheFrontend { |
| }; |
| // Interface used by frontend (renderer) to talk to backend (browser-process). |
| -class WEBKIT_STORAGE_COMMON_EXPORT AppCacheBackend { |
| +class CONTENT_EXPORT AppCacheBackend { |
| public: |
| virtual void RegisterHost(int host_id) = 0; |
| virtual void UnregisterHost(int host_id) = 0; |
| @@ -199,24 +161,25 @@ class WEBKIT_STORAGE_COMMON_EXPORT AppCacheBackend { |
| // Useful string constants. |
| // Note: These are also defined elsewhere in the chrome code base in |
| -// url_contants.h .cc, however the appcache library doesn't not have |
| +// url_contants.h .cc, however the content library can not have |
| // any dependencies on the chrome library, so we can't use them in here. |
| -WEBKIT_STORAGE_COMMON_EXPORT extern const char kHttpScheme[]; |
| -WEBKIT_STORAGE_COMMON_EXPORT extern const char kHttpsScheme[]; |
| -WEBKIT_STORAGE_COMMON_EXPORT extern const char kHttpGETMethod[]; |
| -WEBKIT_STORAGE_COMMON_EXPORT extern const char kHttpHEADMethod[]; |
| +CONTENT_EXPORT extern const char kHttpScheme[]; |
| +CONTENT_EXPORT extern const char kHttpsScheme[]; |
| +CONTENT_EXPORT extern const char kHttpGETMethod[]; |
| +CONTENT_EXPORT extern const char kHttpHEADMethod[]; |
| // CommandLine flag to turn this experimental feature on. |
| -WEBKIT_STORAGE_COMMON_EXPORT extern const char kEnableExecutableHandlers[]; |
| +CONTENT_EXPORT extern const char kEnableExecutableHandlers[]; |
| -WEBKIT_STORAGE_COMMON_EXPORT bool IsSchemeSupported(const GURL& url); |
| -WEBKIT_STORAGE_COMMON_EXPORT bool IsMethodSupported(const std::string& method); |
| -WEBKIT_STORAGE_COMMON_EXPORT bool IsSchemeAndMethodSupported( |
| +CONTENT_EXPORT bool IsSchemeSupportedForAppCache(const GURL& url); |
| +CONTENT_EXPORT bool IsMethodSupportedForAppCache( |
| + const std::string& method); |
| +CONTENT_EXPORT bool IsSchemeAndMethodSupportedForAppCache( |
| const net::URLRequest* request); |
| -WEBKIT_STORAGE_COMMON_EXPORT extern const base::FilePath::CharType |
| +CONTENT_EXPORT extern const base::FilePath::CharType |
| kAppCacheDatabaseName[]; |
| } // namespace |
| -#endif // WEBKIT_COMMON_APPCACHE_APPCACHE_INTERFACES_H_ |
| +#endif // CONTENT_COMMON_APPCACHE_APPCACHE_INTERFACES_H_ |