| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "net/url_request/url_request_http_job.h" | 5 #include "net/url_request/url_request_http_job.h" |
| 6 | 6 |
| 7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 const std::vector<CookieStore::CookieInfo>& cookie_infos, | 59 const std::vector<CookieStore::CookieInfo>& cookie_infos, |
| 60 HttpRequestInfo* request_info) { | 60 HttpRequestInfo* request_info) { |
| 61 const GURL& url = request_info->url; | 61 const GURL& url = request_info->url; |
| 62 const std::string& method = request_info->method; | 62 const std::string& method = request_info->method; |
| 63 std::string request_uri = HttpUtil::PathForRequest(url); | 63 std::string request_uri = HttpUtil::PathForRequest(url); |
| 64 const std::string& host = url.host(); | 64 const std::string& host = url.host(); |
| 65 int port = url.EffectiveIntPort(); | 65 int port = url.EffectiveIntPort(); |
| 66 for (size_t i = 0; i < cookie_infos.size(); ++i) { | 66 for (size_t i = 0; i < cookie_infos.size(); ++i) { |
| 67 HttpMacSignature signature; | 67 HttpMacSignature signature; |
| 68 if (!signature.AddStateInfo(cookie_infos[i].name, | 68 if (!signature.AddStateInfo(cookie_infos[i].name, |
| 69 cookie_infos[i].creation_date, |
| 69 cookie_infos[i].mac_key, | 70 cookie_infos[i].mac_key, |
| 70 cookie_infos[i].mac_algorithm)) { | 71 cookie_infos[i].mac_algorithm)) { |
| 71 continue; | 72 continue; |
| 72 } | 73 } |
| 73 if (!signature.AddHttpInfo(method, request_uri, host, port)) | 74 if (!signature.AddHttpInfo(method, request_uri, host, port)) |
| 74 continue; | 75 continue; |
| 75 request_info->extra_headers.SetHeader( | 76 request_info->extra_headers.SetHeader( |
| 76 HttpRequestHeaders::kAuthorization, | 77 HttpRequestHeaders::kAuthorization, |
| 77 signature.GenerateAuthorizationHeader()); | 78 signature.GenerateAuthorizationHeader()); |
| 78 return; // Only add the first valid header. | 79 return; // Only add the first valid header. |
| (...skipping 1308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1387 } | 1388 } |
| 1388 | 1389 |
| 1389 bool URLRequestHttpJob::IsCompressibleContent() const { | 1390 bool URLRequestHttpJob::IsCompressibleContent() const { |
| 1390 std::string mime_type; | 1391 std::string mime_type; |
| 1391 return GetMimeType(&mime_type) && | 1392 return GetMimeType(&mime_type) && |
| 1392 (IsSupportedJavascriptMimeType(mime_type.c_str()) || | 1393 (IsSupportedJavascriptMimeType(mime_type.c_str()) || |
| 1393 IsSupportedNonImageMimeType(mime_type.c_str())); | 1394 IsSupportedNonImageMimeType(mime_type.c_str())); |
| 1394 } | 1395 } |
| 1395 | 1396 |
| 1396 } // namespace net | 1397 } // namespace net |
| OLD | NEW |