| 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/browser/loader/mime_sniffing_resource_handler.h" | 5 #include "content/browser/loader/mime_sniffing_resource_handler.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 namespace content { | 42 namespace content { |
| 43 | 43 |
| 44 namespace { | 44 namespace { |
| 45 | 45 |
| 46 const char kAcceptHeader[] = "Accept"; | 46 const char kAcceptHeader[] = "Accept"; |
| 47 const char kFrameAcceptHeader[] = | 47 const char kFrameAcceptHeader[] = |
| 48 "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp," | 48 "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp," |
| 49 "*/*;q=0.8"; | 49 "*/*;q=0.8"; |
| 50 const char kStylesheetAcceptHeader[] = "text/css,*/*;q=0.1"; | 50 const char kStylesheetAcceptHeader[] = "text/css,*/*;q=0.1"; |
| 51 const char kImageAcceptHeader[] = "image/webp,image/*,*/*;q=0.8"; | 51 const char kImageAcceptHeader[] = "image/webp,image/apng,image/*,*/*;q=0.8"; |
| 52 const char kDefaultAcceptHeader[] = "*/*"; | 52 const char kDefaultAcceptHeader[] = "*/*"; |
| 53 | 53 |
| 54 // Used to write into an existing IOBuffer at a given offset. | 54 // Used to write into an existing IOBuffer at a given offset. |
| 55 class DependentIOBuffer : public net::WrappedIOBuffer { | 55 class DependentIOBuffer : public net::WrappedIOBuffer { |
| 56 public: | 56 public: |
| 57 DependentIOBuffer(net::IOBuffer* buf, int offset) | 57 DependentIOBuffer(net::IOBuffer* buf, int offset) |
| 58 : net::WrappedIOBuffer(buf->data() + offset), buf_(buf) {} | 58 : net::WrappedIOBuffer(buf->data() + offset), buf_(buf) {} |
| 59 | 59 |
| 60 private: | 60 private: |
| 61 ~DependentIOBuffer() override {} | 61 ~DependentIOBuffer() override {} |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 | 507 |
| 508 void MimeSniffingResourceHandler::OnPluginsLoaded( | 508 void MimeSniffingResourceHandler::OnPluginsLoaded( |
| 509 const std::vector<WebPluginInfo>& plugins) { | 509 const std::vector<WebPluginInfo>& plugins) { |
| 510 // No longer blocking on the plugins being loaded. | 510 // No longer blocking on the plugins being loaded. |
| 511 request()->LogUnblocked(); | 511 request()->LogUnblocked(); |
| 512 if (state_ == STATE_BUFFERING) | 512 if (state_ == STATE_BUFFERING) |
| 513 AdvanceState(); | 513 AdvanceState(); |
| 514 } | 514 } |
| 515 | 515 |
| 516 } // namespace content | 516 } // namespace content |
| OLD | NEW |