| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // An implementation of WebURLLoader in terms of ResourceLoaderBridge. | 5 // An implementation of WebURLLoader in terms of ResourceLoaderBridge. |
| 6 | 6 |
| 7 #include "content/child/web_url_loader_impl.h" | 7 #include "content/child/web_url_loader_impl.h" |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 public: | 73 public: |
| 74 HeaderFlattener() : has_accept_header_(false) {} | 74 HeaderFlattener() : has_accept_header_(false) {} |
| 75 | 75 |
| 76 virtual void visitHeader(const WebString& name, const WebString& value) { | 76 virtual void visitHeader(const WebString& name, const WebString& value) { |
| 77 // Headers are latin1. | 77 // Headers are latin1. |
| 78 const std::string& name_latin1 = name.latin1(); | 78 const std::string& name_latin1 = name.latin1(); |
| 79 const std::string& value_latin1 = value.latin1(); | 79 const std::string& value_latin1 = value.latin1(); |
| 80 | 80 |
| 81 // Skip over referrer headers found in the header map because we already | 81 // Skip over referrer headers found in the header map because we already |
| 82 // pulled it out as a separate parameter. | 82 // pulled it out as a separate parameter. |
| 83 if (LowerCaseEqualsASCII(name_latin1, "referer")) | 83 if (base::LowerCaseEqualsASCII(name_latin1, "referer")) |
| 84 return; | 84 return; |
| 85 | 85 |
| 86 if (LowerCaseEqualsASCII(name_latin1, "accept")) | 86 if (base::LowerCaseEqualsASCII(name_latin1, "accept")) |
| 87 has_accept_header_ = true; | 87 has_accept_header_ = true; |
| 88 | 88 |
| 89 if (!buffer_.empty()) | 89 if (!buffer_.empty()) |
| 90 buffer_.append("\r\n"); | 90 buffer_.append("\r\n"); |
| 91 buffer_.append(name_latin1 + ": " + value_latin1); | 91 buffer_.append(name_latin1 + ": " + value_latin1); |
| 92 } | 92 } |
| 93 | 93 |
| 94 const std::string& GetBuffer() { | 94 const std::string& GetBuffer() { |
| 95 // In some cases, WebKit doesn't add an Accept header, but not having the | 95 // In some cases, WebKit doesn't add an Accept header, but not having the |
| 96 // header confuses some web servers. See bug 808613. | 96 // header confuses some web servers. See bug 808613. |
| (...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 893 int intra_priority_value) { | 893 int intra_priority_value) { |
| 894 context_->DidChangePriority(new_priority, intra_priority_value); | 894 context_->DidChangePriority(new_priority, intra_priority_value); |
| 895 } | 895 } |
| 896 | 896 |
| 897 bool WebURLLoaderImpl::attachThreadedDataReceiver( | 897 bool WebURLLoaderImpl::attachThreadedDataReceiver( |
| 898 blink::WebThreadedDataReceiver* threaded_data_receiver) { | 898 blink::WebThreadedDataReceiver* threaded_data_receiver) { |
| 899 return context_->AttachThreadedDataReceiver(threaded_data_receiver); | 899 return context_->AttachThreadedDataReceiver(threaded_data_receiver); |
| 900 } | 900 } |
| 901 | 901 |
| 902 } // namespace content | 902 } // namespace content |
| OLD | NEW |