| 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/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "net/url_request/url_request.h" | 10 #include "net/url_request/url_request.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 is_intercept(false), | 42 is_intercept(false), |
| 43 is_fallback(false), | 43 is_fallback(false), |
| 44 is_foreign(false), | 44 is_foreign(false), |
| 45 is_explicit(false), | 45 is_explicit(false), |
| 46 response_id(kNoResponseId) { | 46 response_id(kNoResponseId) { |
| 47 } | 47 } |
| 48 | 48 |
| 49 AppCacheResourceInfo::~AppCacheResourceInfo() { | 49 AppCacheResourceInfo::~AppCacheResourceInfo() { |
| 50 } | 50 } |
| 51 | 51 |
| 52 ErrorDetails::ErrorDetails() | 52 AppCacheErrorDetails::AppCacheErrorDetails() |
| 53 : message(), | 53 : message(), |
| 54 reason(UNKNOWN_ERROR), | 54 reason(UNKNOWN_ERROR), |
| 55 url(), | 55 url(), |
| 56 status(0), | 56 status(0), |
| 57 is_cross_origin(false) {} | 57 is_cross_origin(false) {} |
| 58 | 58 |
| 59 ErrorDetails::ErrorDetails( | 59 AppCacheErrorDetails::AppCacheErrorDetails( |
| 60 std::string in_message, | 60 std::string in_message, |
| 61 ErrorReason in_reason, | 61 AppCacheErrorReason in_reason, |
| 62 GURL in_url, | 62 GURL in_url, |
| 63 int in_status, | 63 int in_status, |
| 64 bool in_is_cross_origin) | 64 bool in_is_cross_origin) |
| 65 : message(in_message), | 65 : message(in_message), |
| 66 reason(in_reason), | 66 reason(in_reason), |
| 67 url(in_url), | 67 url(in_url), |
| 68 status(in_status), | 68 status(in_status), |
| 69 is_cross_origin(in_is_cross_origin) {} | 69 is_cross_origin(in_is_cross_origin) {} |
| 70 | 70 |
| 71 ErrorDetails::~ErrorDetails() {} | 71 AppCacheErrorDetails::~AppCacheErrorDetails() {} |
| 72 | 72 |
| 73 Namespace::Namespace() | 73 Namespace::Namespace() |
| 74 : type(FALLBACK_NAMESPACE), | 74 : type(FALLBACK_NAMESPACE), |
| 75 is_pattern(false), | 75 is_pattern(false), |
| 76 is_executable(false) { | 76 is_executable(false) { |
| 77 } | 77 } |
| 78 | 78 |
| 79 Namespace::Namespace( | 79 Namespace::Namespace( |
| 80 NamespaceType type, const GURL& url, const GURL& target, bool is_pattern) | 80 AppCacheNamespaceType type, const GURL& url, const GURL& target, |
| 81 bool is_pattern) |
| 81 : type(type), | 82 : type(type), |
| 82 namespace_url(url), | 83 namespace_url(url), |
| 83 target_url(target), | 84 target_url(target), |
| 84 is_pattern(is_pattern), | 85 is_pattern(is_pattern), |
| 85 is_executable(false) { | 86 is_executable(false) { |
| 86 } | 87 } |
| 87 | 88 |
| 88 Namespace::Namespace( | 89 Namespace::Namespace( |
| 89 NamespaceType type, const GURL& url, const GURL& target, | 90 AppCacheNamespaceType type, const GURL& url, const GURL& target, |
| 90 bool is_pattern, bool is_executable) | 91 bool is_pattern, bool is_executable) |
| 91 : type(type), | 92 : type(type), |
| 92 namespace_url(url), | 93 namespace_url(url), |
| 93 target_url(target), | 94 target_url(target), |
| 94 is_pattern(is_pattern), | 95 is_pattern(is_pattern), |
| 95 is_executable(is_executable) { | 96 is_executable(is_executable) { |
| 96 } | 97 } |
| 97 | 98 |
| 98 Namespace::~Namespace() { | 99 Namespace::~Namespace() { |
| 99 } | 100 } |
| (...skipping 29 matching lines...) Expand all Loading... |
| 129 bool IsMethodSupported(const std::string& method) { | 130 bool IsMethodSupported(const std::string& method) { |
| 130 return (method == kHttpGETMethod) || (method == kHttpHEADMethod); | 131 return (method == kHttpGETMethod) || (method == kHttpHEADMethod); |
| 131 } | 132 } |
| 132 | 133 |
| 133 bool IsSchemeAndMethodSupported(const net::URLRequest* request) { | 134 bool IsSchemeAndMethodSupported(const net::URLRequest* request) { |
| 134 return IsSchemeSupported(request->url()) && | 135 return IsSchemeSupported(request->url()) && |
| 135 IsMethodSupported(request->method()); | 136 IsMethodSupported(request->method()); |
| 136 } | 137 } |
| 137 | 138 |
| 138 } // namespace appcache | 139 } // namespace appcache |
| OLD | NEW |