Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(335)

Side by Side Diff: content/browser/loader/mime_sniffing_resource_handler.cc

Issue 2618633004: Add support for Animated PNG (Closed)
Patch Set: Respond to comments Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 29 matching lines...) Expand all
40 #include "ppapi/features/features.h" 40 #include "ppapi/features/features.h"
41 #include "url/origin.h" 41 #include "url/origin.h"
42 42
43 namespace content { 43 namespace content {
44 44
45 namespace { 45 namespace {
46 46
47 const char kAcceptHeader[] = "Accept"; 47 const char kAcceptHeader[] = "Accept";
48 const char kFrameAcceptHeader[] = 48 const char kFrameAcceptHeader[] =
49 "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp," 49 "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,"
50 "*/*;q=0.8"; 50 "image/apng,*/*;q=0.8";
51 const char kStylesheetAcceptHeader[] = "text/css,*/*;q=0.1"; 51 const char kStylesheetAcceptHeader[] = "text/css,*/*;q=0.1";
52 const char kImageAcceptHeader[] = "image/webp,image/*,*/*;q=0.8"; 52 const char kImageAcceptHeader[] = "image/webp,image/apng,image/*,*/*;q=0.8";
53 const char kDefaultAcceptHeader[] = "*/*"; 53 const char kDefaultAcceptHeader[] = "*/*";
54 54
55 // Used to write into an existing IOBuffer at a given offset. 55 // Used to write into an existing IOBuffer at a given offset.
56 class DependentIOBuffer : public net::WrappedIOBuffer { 56 class DependentIOBuffer : public net::WrappedIOBuffer {
57 public: 57 public:
58 DependentIOBuffer(net::IOBuffer* buf, int offset) 58 DependentIOBuffer(net::IOBuffer* buf, int offset)
59 : net::WrappedIOBuffer(buf->data() + offset), buf_(buf) {} 59 : net::WrappedIOBuffer(buf->data() + offset), buf_(buf) {}
60 60
61 private: 61 private:
62 ~DependentIOBuffer() override {} 62 ~DependentIOBuffer() override {}
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 555
556 void MimeSniffingResourceHandler::OnPluginsLoaded( 556 void MimeSniffingResourceHandler::OnPluginsLoaded(
557 const std::vector<WebPluginInfo>& plugins) { 557 const std::vector<WebPluginInfo>& plugins) {
558 // No longer blocking on the plugins being loaded. 558 // No longer blocking on the plugins being loaded.
559 request()->LogUnblocked(); 559 request()->LogUnblocked();
560 if (state_ == STATE_BUFFERING) 560 if (state_ == STATE_BUFFERING)
561 AdvanceState(); 561 AdvanceState();
562 } 562 }
563 563
564 } // namespace content 564 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698