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 "chrome/browser/extensions/api/web_request/web_request_api_helpers.h" | 5 #include "chrome/browser/extensions/api/web_request/web_request_api_helpers.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 1224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1235 content::BrowserContext* browser_context = profile; | 1235 content::BrowserContext* browser_context = profile; |
1236 for (content::RenderProcessHost::iterator it = | 1236 for (content::RenderProcessHost::iterator it = |
1237 content::RenderProcessHost::AllHostsIterator(); | 1237 content::RenderProcessHost::AllHostsIterator(); |
1238 !it.IsAtEnd(); it.Advance()) { | 1238 !it.IsAtEnd(); it.Advance()) { |
1239 content::RenderProcessHost* host = it.GetCurrentValue(); | 1239 content::RenderProcessHost* host = it.GetCurrentValue(); |
1240 if (host->GetBrowserContext() == browser_context) | 1240 if (host->GetBrowserContext() == browser_context) |
1241 SendExtensionWebRequestStatusToHost(host); | 1241 SendExtensionWebRequestStatusToHost(host); |
1242 } | 1242 } |
1243 } | 1243 } |
1244 | 1244 |
1245 bool IsValidHeaderName(const std::string& name) { | |
1246 // Check whether the header name is RFC 2616-compliant. | |
1247 return net::HttpUtil::IsToken(name); | |
1248 } | |
1249 | |
1250 bool IsValidHeaderValue(const std::string& value) { | |
1251 // Just a sanity check: disallow NUL and CRLF. | |
1252 return value.find('\0') == std::string::npos && | |
1253 value.find("\r\n") == std::string::npos; | |
1254 } | |
1255 | |
1256 } // namespace extension_web_request_api_helpers | 1245 } // namespace extension_web_request_api_helpers |
OLD | NEW |