| 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 #include "webkit/common/appcache/appcache_interfaces.h" | 5 #include "webkit/common/appcache/appcache_interfaces.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| 11 #include "net/url_request/url_request.h" | 11 #include "net/url_request/url_request.h" |
| 12 #include "url/gurl.h" | 12 #include "url/gurl.h" |
| 13 | 13 |
| 14 namespace { | 14 namespace { |
| 15 | 15 |
| 16 base::LazyInstance<std::set<std::string> >::Leaky g_supported_schemes = | 16 base::LazyInstance<std::set<std::string> >::Leaky g_supported_schemes = |
| 17 LAZY_INSTANCE_INITIALIZER; | 17 LAZY_INSTANCE_INITIALIZER; |
| 18 | 18 |
| 19 } // namespace | 19 } // namespace |
| 20 | 20 |
| 21 namespace appcache { | 21 namespace appcache { |
| 22 | 22 |
| 23 const char kHttpScheme[] = "http"; | 23 const char kHttpScheme[] = "http"; |
| 24 const char kHttpsScheme[] = "https"; | 24 const char kHttpsScheme[] = "https"; |
| 25 const char kHttpGETMethod[] = "GET"; | 25 const char kHttpGETMethod[] = "GET"; |
| 26 const char kHttpHEADMethod[] = "HEAD"; | 26 const char kHttpHEADMethod[] = "HEAD"; |
| 27 | 27 |
| 28 const char kEnableExecutableHandlers[] = "enable-appcache-executable-handlers"; | |
| 29 | |
| 30 const base::FilePath::CharType kAppCacheDatabaseName[] = | 28 const base::FilePath::CharType kAppCacheDatabaseName[] = |
| 31 FILE_PATH_LITERAL("Index"); | 29 FILE_PATH_LITERAL("Index"); |
| 32 | 30 |
| 33 AppCacheInfo::AppCacheInfo() | 31 AppCacheInfo::AppCacheInfo() |
| 34 : cache_id(kNoCacheId), | 32 : cache_id(kNoCacheId), |
| 35 group_id(0), | 33 group_id(0), |
| 36 status(UNCACHED), | 34 status(UNCACHED), |
| 37 size(0), | 35 size(0), |
| 38 is_complete(false) { | 36 is_complete(false) { |
| 39 } | 37 } |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 bool IsMethodSupported(const std::string& method) { | 119 bool IsMethodSupported(const std::string& method) { |
| 122 return (method == kHttpGETMethod) || (method == kHttpHEADMethod); | 120 return (method == kHttpGETMethod) || (method == kHttpHEADMethod); |
| 123 } | 121 } |
| 124 | 122 |
| 125 bool IsSchemeAndMethodSupported(const net::URLRequest* request) { | 123 bool IsSchemeAndMethodSupported(const net::URLRequest* request) { |
| 126 return IsSchemeSupported(request->url()) && | 124 return IsSchemeSupported(request->url()) && |
| 127 IsMethodSupported(request->method()); | 125 IsMethodSupported(request->method()); |
| 128 } | 126 } |
| 129 | 127 |
| 130 } // namespace appcache | 128 } // namespace appcache |
| OLD | NEW |