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

Side by Side Diff: chrome/browser/ui/webui/large_icon_source.cc

Issue 2634413002: Faster Reload: Specify AllowCaching = false for some URLDataSources that need it (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « chrome/browser/ui/webui/large_icon_source.h ('k') | chrome/browser/ui/webui/theme_source.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "chrome/browser/ui/webui/large_icon_source.h" 5 #include "chrome/browser/ui/webui/large_icon_source.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/memory/ref_counted_memory.h" 9 #include "base/memory/ref_counted_memory.h"
10 #include "chrome/browser/search/instant_io_context.h" 10 #include "chrome/browser/search/instant_io_context.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 parser.size_in_pixels()), 72 parser.size_in_pixels()),
73 &cancelable_task_tracker_); 73 &cancelable_task_tracker_);
74 } 74 }
75 75
76 std::string LargeIconSource::GetMimeType(const std::string&) const { 76 std::string LargeIconSource::GetMimeType(const std::string&) const {
77 // We need to explicitly return a mime type, otherwise if the user tries to 77 // We need to explicitly return a mime type, otherwise if the user tries to
78 // drag the image they get no extension. 78 // drag the image they get no extension.
79 return "image/png"; 79 return "image/png";
80 } 80 }
81 81
82 bool LargeIconSource::AllowCaching() const {
83 return false;
84 }
85
82 bool LargeIconSource::ShouldReplaceExistingSource() const { 86 bool LargeIconSource::ShouldReplaceExistingSource() const {
83 // Leave the existing DataSource in place, otherwise we'll drop any pending 87 // Leave the existing DataSource in place, otherwise we'll drop any pending
84 // requests on the floor. 88 // requests on the floor.
85 return false; 89 return false;
86 } 90 }
87 91
88 bool LargeIconSource::ShouldServiceRequest( 92 bool LargeIconSource::ShouldServiceRequest(
89 const net::URLRequest* request) const { 93 const net::URLRequest* request) const {
90 if (request->url().SchemeIs(chrome::kChromeSearchScheme)) 94 if (request->url().SchemeIs(chrome::kChromeSearchScheme))
91 return InstantIOContext::ShouldServiceRequest(request); 95 return InstantIOContext::ShouldServiceRequest(request);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 url, size, *result.fallback_icon_style); 128 url, size, *result.fallback_icon_style);
125 #endif 129 #endif
126 130
127 callback.Run(base::RefCountedBytes::TakeVector(&bitmap_data)); 131 callback.Run(base::RefCountedBytes::TakeVector(&bitmap_data));
128 } 132 }
129 133
130 void LargeIconSource::SendNotFoundResponse( 134 void LargeIconSource::SendNotFoundResponse(
131 const content::URLDataSource::GotDataCallback& callback) { 135 const content::URLDataSource::GotDataCallback& callback) {
132 callback.Run(nullptr); 136 callback.Run(nullptr);
133 } 137 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/large_icon_source.h ('k') | chrome/browser/ui/webui/theme_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698