| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 786 OnCanSetCookieCompleted(policy); | 786 OnCanSetCookieCompleted(policy); |
| 787 } | 787 } |
| 788 | 788 |
| 789 void URLRequestHttpJob::FetchResponseCookies( | 789 void URLRequestHttpJob::FetchResponseCookies( |
| 790 const net::HttpResponseInfo* response_info, | 790 const net::HttpResponseInfo* response_info, |
| 791 std::vector<std::string>* cookies) { | 791 std::vector<std::string>* cookies) { |
| 792 std::string name = "Set-Cookie"; | 792 std::string name = "Set-Cookie"; |
| 793 std::string value; | 793 std::string value; |
| 794 | 794 |
| 795 void* iter = NULL; | 795 void* iter = NULL; |
| 796 while (response_info->headers->EnumerateHeader(&iter, name, &value)) | 796 while (response_info->headers->EnumerateHeader(&iter, name, &value)) { |
| 797 cookies->push_back(value); | 797 if (!value.empty()) |
| 798 cookies->push_back(value); |
| 799 } |
| 798 } | 800 } |
| 799 | 801 |
| 800 class HTTPSProberDelegate : public net::HTTPSProberDelegate { | 802 class HTTPSProberDelegate : public net::HTTPSProberDelegate { |
| 801 public: | 803 public: |
| 802 HTTPSProberDelegate(const std::string& host, int max_age, | 804 HTTPSProberDelegate(const std::string& host, int max_age, |
| 803 bool include_subdomains, | 805 bool include_subdomains, |
| 804 net::TransportSecurityState* sts) | 806 net::TransportSecurityState* sts) |
| 805 : host_(host), | 807 : host_(host), |
| 806 max_age_(max_age), | 808 max_age_(max_age), |
| 807 include_subdomains_(include_subdomains), | 809 include_subdomains_(include_subdomains), |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 911 HTTPSProberDelegate* delegate = | 913 HTTPSProberDelegate* delegate = |
| 912 new HTTPSProberDelegate(request_info_.url.host(), max_age, | 914 new HTTPSProberDelegate(request_info_.url.host(), max_age, |
| 913 include_subdomains, | 915 include_subdomains, |
| 914 ctx->transport_security_state()); | 916 ctx->transport_security_state()); |
| 915 if (!prober->ProbeHost(request_info_.url.host(), request()->context(), | 917 if (!prober->ProbeHost(request_info_.url.host(), request()->context(), |
| 916 delegate)) { | 918 delegate)) { |
| 917 delete delegate; | 919 delete delegate; |
| 918 } | 920 } |
| 919 } | 921 } |
| 920 } | 922 } |
| OLD | NEW |