| 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 #include "webkit/appcache/appcache_interfaces.h" | 5 #include "webkit/appcache/appcache_interfaces.h" |
| 6 | 6 |
| 7 #include "googleurl/src/gurl.h" | 7 #include "googleurl/src/gurl.h" |
| 8 #include "net/url_request/url_request.h" | 8 #include "net/url_request/url_request.h" |
| 9 #include "third_party/WebKit/WebKit/chromium/public/WebApplicationCacheHost.h" | 9 #include "third_party/WebKit/WebKit/chromium/public/WebApplicationCacheHost.h" |
| 10 #include "third_party/WebKit/WebKit/chromium/public/WebConsoleMessage.h" | 10 #include "third_party/WebKit/WebKit/chromium/public/WebConsoleMessage.h" |
| 11 | 11 |
| 12 using WebKit::WebApplicationCacheHost; | 12 using WebKit::WebApplicationCacheHost; |
| 13 using WebKit::WebConsoleMessage; | 13 using WebKit::WebConsoleMessage; |
| 14 | 14 |
| 15 namespace appcache { | 15 namespace appcache { |
| 16 | 16 |
| 17 const char kManifestMimeType[] = "text/cache-manifest"; | 17 const char kManifestMimeType[] = "text/cache-manifest"; |
| 18 | 18 |
| 19 const char kHttpScheme[] = "http"; | 19 const char kHttpScheme[] = "http"; |
| 20 const char kHttpsScheme[] = "https"; | 20 const char kHttpsScheme[] = "https"; |
| 21 const char kHttpGETMethod[] = "GET"; | 21 const char kHttpGETMethod[] = "GET"; |
| 22 const char kHttpHEADMethod[] = "HEAD"; | 22 const char kHttpHEADMethod[] = "HEAD"; |
| 23 | 23 |
| 24 const FilePath::CharType kAppCacheDatabaseName[] = FILE_PATH_LITERAL("Index"); | 24 const FilePath::CharType kAppCacheDatabaseName[] = FILE_PATH_LITERAL("Index"); |
| 25 | 25 |
| 26 AppCacheInfo::AppCacheInfo() |
| 27 : cache_id(kNoCacheId), |
| 28 status(UNCACHED), |
| 29 size(0), |
| 30 is_complete(false) { |
| 31 } |
| 32 |
| 33 AppCacheInfo::~AppCacheInfo() { |
| 34 } |
| 35 |
| 36 AppCacheResourceInfo::AppCacheResourceInfo() |
| 37 : url(), |
| 38 size(0), |
| 39 is_master(0), |
| 40 is_manifest(0), |
| 41 is_fallback(0), |
| 42 is_foreign(0), |
| 43 is_explicit(0) { |
| 44 } |
| 45 |
| 46 AppCacheResourceInfo::~AppCacheResourceInfo() { |
| 47 } |
| 48 |
| 26 bool IsSchemeSupported(const GURL& url) { | 49 bool IsSchemeSupported(const GURL& url) { |
| 27 bool supported = url.SchemeIs(kHttpScheme) || url.SchemeIs(kHttpsScheme); | 50 bool supported = url.SchemeIs(kHttpScheme) || url.SchemeIs(kHttpsScheme); |
| 28 #ifndef NDEBUG | 51 #ifndef NDEBUG |
| 29 // TODO(michaeln): It would be really nice if this could optionally work for | 52 // TODO(michaeln): It would be really nice if this could optionally work for |
| 30 // file urls too to help web developers experiment and test their apps, | 53 // file urls too to help web developers experiment and test their apps, |
| 31 // perhaps enabled via a cmd line flag or some other developer tool setting. | 54 // perhaps enabled via a cmd line flag or some other developer tool setting. |
| 32 // Unfortunately file scheme URLRequest don't produce the same signalling | 55 // Unfortunately file scheme URLRequest don't produce the same signalling |
| 33 // (200 response codes, headers) as http URLRequests, so this doesn't work | 56 // (200 response codes, headers) as http URLRequests, so this doesn't work |
| 34 // just yet. | 57 // just yet. |
| 35 // supported |= url.SchemeIsFile(); | 58 // supported |= url.SchemeIsFile(); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 (int)OBSOLETE_EVENT, ObsoleteEvent); | 101 (int)OBSOLETE_EVENT, ObsoleteEvent); |
| 79 COMPILE_ASSERT((int)WebConsoleMessage::LevelTip == | 102 COMPILE_ASSERT((int)WebConsoleMessage::LevelTip == |
| 80 (int)LOG_TIP, LevelTip); | 103 (int)LOG_TIP, LevelTip); |
| 81 COMPILE_ASSERT((int)WebConsoleMessage::LevelLog == | 104 COMPILE_ASSERT((int)WebConsoleMessage::LevelLog == |
| 82 (int)LOG_INFO, LevelLog); | 105 (int)LOG_INFO, LevelLog); |
| 83 COMPILE_ASSERT((int)WebConsoleMessage::LevelWarning == | 106 COMPILE_ASSERT((int)WebConsoleMessage::LevelWarning == |
| 84 (int)LOG_WARNING, LevelWarning); | 107 (int)LOG_WARNING, LevelWarning); |
| 85 COMPILE_ASSERT((int)WebConsoleMessage::LevelError == | 108 COMPILE_ASSERT((int)WebConsoleMessage::LevelError == |
| 86 (int)LOG_ERROR, LevelError); | 109 (int)LOG_ERROR, LevelError); |
| 87 | 110 |
| 88 } // namespace | 111 } // namespace appcache |
| OLD | NEW |