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 "extensions/browser/api/web_request/web_request_api_helpers.h" | 5 #include "extensions/browser/api/web_request/web_request_api_helpers.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 void* iter = NULL; | 343 void* iter = NULL; |
344 std::string name; | 344 std::string name; |
345 std::string value; | 345 std::string value; |
346 while (old_response_headers->EnumerateHeaderLines(&iter, &name, &value)) { | 346 while (old_response_headers->EnumerateHeaderLines(&iter, &name, &value)) { |
347 std::string name_lowercase(name); | 347 std::string name_lowercase(name); |
348 base::StringToLowerASCII(&name_lowercase); | 348 base::StringToLowerASCII(&name_lowercase); |
349 | 349 |
350 bool header_found = false; | 350 bool header_found = false; |
351 for (ResponseHeaders::const_iterator i = new_response_headers->begin(); | 351 for (ResponseHeaders::const_iterator i = new_response_headers->begin(); |
352 i != new_response_headers->end(); ++i) { | 352 i != new_response_headers->end(); ++i) { |
353 if (LowerCaseEqualsASCII(i->first, name_lowercase.c_str()) && | 353 if (base::LowerCaseEqualsASCII(i->first, name_lowercase.c_str()) && |
354 value == i->second) { | 354 value == i->second) { |
355 header_found = true; | 355 header_found = true; |
356 break; | 356 break; |
357 } | 357 } |
358 } | 358 } |
359 if (!header_found) | 359 if (!header_found) |
360 result->deleted_response_headers.push_back(ResponseHeader(name, value)); | 360 result->deleted_response_headers.push_back(ResponseHeader(name, value)); |
361 } | 361 } |
362 } | 362 } |
363 | 363 |
(...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1279 std::find(kResourceTypeStrings, | 1279 std::find(kResourceTypeStrings, |
1280 kResourceTypeStrings + kResourceTypeStringsLength, | 1280 kResourceTypeStrings + kResourceTypeStringsLength, |
1281 type_str); | 1281 type_str); |
1282 if (iter == (kResourceTypeStrings + kResourceTypeStringsLength)) | 1282 if (iter == (kResourceTypeStrings + kResourceTypeStringsLength)) |
1283 return false; | 1283 return false; |
1284 *type = kResourceTypeValues[iter - kResourceTypeStrings]; | 1284 *type = kResourceTypeValues[iter - kResourceTypeStrings]; |
1285 return true; | 1285 return true; |
1286 } | 1286 } |
1287 | 1287 |
1288 } // namespace extension_web_request_api_helpers | 1288 } // namespace extension_web_request_api_helpers |
OLD | NEW |