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 "content/renderer/npapi/webplugin_impl.h" | 5 #include "content/renderer/npapi/webplugin_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/crash_logging.h" | 9 #include "base/debug/crash_logging.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 | 201 |
202 // If the length comes in as -1, then it indicates that it was not | 202 // If the length comes in as -1, then it indicates that it was not |
203 // read off the HTTP headers. We replicate Safari webkit behavior here, | 203 // read off the HTTP headers. We replicate Safari webkit behavior here, |
204 // which is to set it to 0. | 204 // which is to set it to 0. |
205 response_info->expected_length = | 205 response_info->expected_length = |
206 static_cast<uint32>(std::max(response.expectedContentLength(), 0LL)); | 206 static_cast<uint32>(std::max(response.expectedContentLength(), 0LL)); |
207 | 207 |
208 WebString content_encoding = | 208 WebString content_encoding = |
209 response.httpHeaderField(WebString::fromUTF8("Content-Encoding")); | 209 response.httpHeaderField(WebString::fromUTF8("Content-Encoding")); |
210 if (!content_encoding.isNull() && | 210 if (!content_encoding.isNull() && |
211 !EqualsASCII(content_encoding, "identity")) { | 211 !base::EqualsASCII(content_encoding, "identity")) { |
212 // Don't send the compressed content length to the plugin, which only | 212 // Don't send the compressed content length to the plugin, which only |
213 // cares about the decoded length. | 213 // cares about the decoded length. |
214 response_info->expected_length = 0; | 214 response_info->expected_length = 0; |
215 } | 215 } |
216 } | 216 } |
217 | 217 |
218 } // namespace | 218 } // namespace |
219 | 219 |
220 // blink::WebPlugin ---------------------------------------------------------- | 220 // blink::WebPlugin ---------------------------------------------------------- |
221 | 221 |
(...skipping 1319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1541 case PLUGIN_SRC: | 1541 case PLUGIN_SRC: |
1542 webframe_->setReferrerForRequest(*request, plugin_url_); | 1542 webframe_->setReferrerForRequest(*request, plugin_url_); |
1543 break; | 1543 break; |
1544 | 1544 |
1545 default: | 1545 default: |
1546 break; | 1546 break; |
1547 } | 1547 } |
1548 } | 1548 } |
1549 | 1549 |
1550 } // namespace content | 1550 } // namespace content |
OLD | NEW |