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 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 std::string::const_iterator cookie_name_beginning = i; | 491 std::string::const_iterator cookie_name_beginning = i; |
492 while (i != header_value.end() && *i != '=') ++i; | 492 while (i != header_value.end() && *i != '=') ++i; |
493 base::StringPiece cookie_name(cookie_name_beginning, i); | 493 base::StringPiece cookie_name(cookie_name_beginning, i); |
494 | 494 |
495 // Find cookie value. | 495 // Find cookie value. |
496 base::StringPiece cookie_value; | 496 base::StringPiece cookie_value; |
497 if (i != header_value.end()) { // Cookies may have no value. | 497 if (i != header_value.end()) { // Cookies may have no value. |
498 ++i; // Skip '='. | 498 ++i; // Skip '='. |
499 std::string::const_iterator cookie_value_beginning = i; | 499 std::string::const_iterator cookie_value_beginning = i; |
500 if (*i == '"') { | 500 if (*i == '"') { |
| 501 ++i; // Skip '"'. |
501 while (i != header_value.end() && *i != '"') ++i; | 502 while (i != header_value.end() && *i != '"') ++i; |
502 if (i == header_value.end()) return; | 503 if (i == header_value.end()) return; |
503 ++i; // Skip '"'. | 504 ++i; // Skip '"'. |
504 cookie_value = base::StringPiece(cookie_value_beginning, i); | 505 cookie_value = base::StringPiece(cookie_value_beginning, i); |
505 // i points to character after '"', potentially a ';' | 506 // i points to character after '"', potentially a ';' |
506 } else { | 507 } else { |
507 while (i != header_value.end() && *i != ';') ++i; | 508 while (i != header_value.end() && *i != ';') ++i; |
508 cookie_value = base::StringPiece(cookie_value_beginning, i); | 509 cookie_value = base::StringPiece(cookie_value_beginning, i); |
509 // i points to ';' or end of string. | 510 // i points to ';' or end of string. |
510 } | 511 } |
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1271 for (content::RenderProcessHost::iterator it = | 1272 for (content::RenderProcessHost::iterator it = |
1272 content::RenderProcessHost::AllHostsIterator(); | 1273 content::RenderProcessHost::AllHostsIterator(); |
1273 !it.IsAtEnd(); it.Advance()) { | 1274 !it.IsAtEnd(); it.Advance()) { |
1274 content::RenderProcessHost* host = it.GetCurrentValue(); | 1275 content::RenderProcessHost* host = it.GetCurrentValue(); |
1275 if (host->GetBrowserContext() == browser_context) | 1276 if (host->GetBrowserContext() == browser_context) |
1276 SendExtensionWebRequestStatusToHost(host); | 1277 SendExtensionWebRequestStatusToHost(host); |
1277 } | 1278 } |
1278 } | 1279 } |
1279 | 1280 |
1280 } // namespace extension_web_request_api_helpers | 1281 } // namespace extension_web_request_api_helpers |
OLD | NEW |