| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 26 matching lines...) Expand all Loading... |
| 37 CHECKING_EVENT, | 37 CHECKING_EVENT, |
| 38 ERROR_EVENT, | 38 ERROR_EVENT, |
| 39 NO_UPDATE_EVENT, | 39 NO_UPDATE_EVENT, |
| 40 DOWNLOADING_EVENT, | 40 DOWNLOADING_EVENT, |
| 41 PROGRESS_EVENT, | 41 PROGRESS_EVENT, |
| 42 UPDATE_READY_EVENT, | 42 UPDATE_READY_EVENT, |
| 43 CACHED_EVENT, | 43 CACHED_EVENT, |
| 44 OBSOLETE_EVENT | 44 OBSOLETE_EVENT |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 enum LogLevel { |
| 48 LOG_INFO, |
| 49 LOG_WARNING, |
| 50 LOG_ERROR, |
| 51 }; |
| 52 |
| 47 // Interface used by backend (browser-process) to talk to frontend (renderer). | 53 // Interface used by backend (browser-process) to talk to frontend (renderer). |
| 48 class AppCacheFrontend { | 54 class AppCacheFrontend { |
| 49 public: | 55 public: |
| 50 virtual void OnCacheSelected(int host_id, int64 cache_id , | 56 virtual void OnCacheSelected(int host_id, int64 cache_id , |
| 51 Status status) = 0; | 57 Status status) = 0; |
| 52 virtual void OnStatusChanged(const std::vector<int>& host_ids, | 58 virtual void OnStatusChanged(const std::vector<int>& host_ids, |
| 53 Status status) = 0; | 59 Status status) = 0; |
| 54 virtual void OnEventRaised(const std::vector<int>& host_ids, | 60 virtual void OnEventRaised(const std::vector<int>& host_ids, |
| 55 EventID event_id) = 0; | 61 EventID event_id) = 0; |
| 56 virtual void OnProgressEventRaised(const std::vector<int>& host_ids, | 62 virtual void OnProgressEventRaised(const std::vector<int>& host_ids, |
| 57 const GURL& url, | 63 const GURL& url, |
| 58 int num_total, int num_complete) = 0; | 64 int num_total, int num_complete) = 0; |
| 59 virtual void OnContentBlocked(int host_id) = 0; | 65 virtual void OnContentBlocked(int host_id) = 0; |
| 60 | 66 virtual void OnLogMessage(int host_id, LogLevel log_level, |
| 67 const std::string& message) = 0; |
| 61 virtual ~AppCacheFrontend() {} | 68 virtual ~AppCacheFrontend() {} |
| 62 }; | 69 }; |
| 63 | 70 |
| 64 // Interface used by frontend (renderer) to talk to backend (browser-process). | 71 // Interface used by frontend (renderer) to talk to backend (browser-process). |
| 65 class AppCacheBackend { | 72 class AppCacheBackend { |
| 66 public: | 73 public: |
| 67 virtual void RegisterHost(int host_id) = 0; | 74 virtual void RegisterHost(int host_id) = 0; |
| 68 virtual void UnregisterHost(int host_id) = 0; | 75 virtual void UnregisterHost(int host_id) = 0; |
| 69 virtual void SelectCache(int host_id, | 76 virtual void SelectCache(int host_id, |
| 70 const GURL& document_url, | 77 const GURL& document_url, |
| (...skipping 26 matching lines...) Expand all Loading... |
| 97 | 104 |
| 98 bool IsSchemeSupported(const GURL& url); | 105 bool IsSchemeSupported(const GURL& url); |
| 99 bool IsMethodSupported(const std::string& method); | 106 bool IsMethodSupported(const std::string& method); |
| 100 bool IsSchemeAndMethodSupported(const URLRequest* request); | 107 bool IsSchemeAndMethodSupported(const URLRequest* request); |
| 101 | 108 |
| 102 extern const FilePath::CharType kAppCacheDatabaseName[]; | 109 extern const FilePath::CharType kAppCacheDatabaseName[]; |
| 103 | 110 |
| 104 } // namespace | 111 } // namespace |
| 105 | 112 |
| 106 #endif // WEBKIT_APPCACHE_APPCACHE_INTERFACES_H_ | 113 #endif // WEBKIT_APPCACHE_APPCACHE_INTERFACES_H_ |
| OLD | NEW |