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 "content/common/appcache_interfaces.h" | 5 #include "content/common/appcache_interfaces.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/strings/pattern.h" | 9 #include "base/strings/pattern.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
11 #include "content/public/common/url_constants.h" | 11 #include "content/public/common/url_constants.h" |
12 #include "net/url_request/url_request.h" | |
13 #include "url/gurl.h" | 12 #include "url/gurl.h" |
14 #include "url/url_constants.h" | 13 #include "url/url_constants.h" |
15 | 14 |
16 namespace content { | 15 namespace content { |
17 | 16 |
18 const char kHttpGETMethod[] = "GET"; | 17 const char kHttpGETMethod[] = "GET"; |
19 const char kHttpHEADMethod[] = "HEAD"; | 18 const char kHttpHEADMethod[] = "HEAD"; |
20 | 19 |
21 const char kEnableExecutableHandlers[] = "enable-appcache-executable-handlers"; | 20 const char kEnableExecutableHandlers[] = "enable-appcache-executable-handlers"; |
22 | 21 |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 // doesn't work just yet. | 130 // doesn't work just yet. |
132 // supported |= url.SchemeIsFile(); | 131 // supported |= url.SchemeIsFile(); |
133 #endif | 132 #endif |
134 return supported; | 133 return supported; |
135 } | 134 } |
136 | 135 |
137 bool IsMethodSupportedForAppCache(const std::string& method) { | 136 bool IsMethodSupportedForAppCache(const std::string& method) { |
138 return (method == kHttpGETMethod) || (method == kHttpHEADMethod); | 137 return (method == kHttpGETMethod) || (method == kHttpHEADMethod); |
139 } | 138 } |
140 | 139 |
141 bool IsSchemeAndMethodSupportedForAppCache(const net::URLRequest* request) { | |
142 return IsSchemeSupportedForAppCache(request->url()) && | |
143 IsMethodSupportedForAppCache(request->method()); | |
144 } | |
145 | |
146 } // namespace content | 140 } // namespace content |
OLD | NEW |