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

Side by Side Diff: chrome/browser/favicon/favicon_service.h

Issue 14322023: Don't request missing favicon on every page request. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix lint errors Created 7 years, 7 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 | Annotate | Revision Log
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 #ifndef CHROME_BROWSER_FAVICON_FAVICON_SERVICE_H_ 5 #ifndef CHROME_BROWSER_FAVICON_FAVICON_SERVICE_H_
6 #define CHROME_BROWSER_FAVICON_FAVICON_SERVICE_H_ 6 #define CHROME_BROWSER_FAVICON_FAVICON_SERVICE_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/hash_tables.h"
11 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
12 #include "chrome/browser/common/cancelable_request.h" 13 #include "chrome/browser/common/cancelable_request.h"
13 #include "chrome/browser/history/history_types.h" 14 #include "chrome/browser/history/history_types.h"
14 #include "chrome/browser/profiles/profile_keyed_service.h" 15 #include "chrome/browser/profiles/profile_keyed_service.h"
15 #include "chrome/common/cancelable_task_tracker.h" 16 #include "chrome/common/cancelable_task_tracker.h"
16 #include "chrome/common/ref_counted_util.h" 17 #include "chrome/common/ref_counted_util.h"
17 #include "ui/base/layout.h" 18 #include "ui/base/layout.h"
18 19
19 class GURL; 20 class GURL;
20 class HistoryService; 21 class HistoryService;
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 // MergeFavicon() if it does not. 217 // MergeFavicon() if it does not.
217 // TODO(pkotwicz): Save unresized favicon bitmaps to the database. 218 // TODO(pkotwicz): Save unresized favicon bitmaps to the database.
218 // TODO(pkotwicz): Support adding favicons for multiple icon URLs to the 219 // TODO(pkotwicz): Support adding favicons for multiple icon URLs to the
219 // thumbnail database. 220 // thumbnail database.
220 void SetFavicons( 221 void SetFavicons(
221 const GURL& page_url, 222 const GURL& page_url,
222 const GURL& icon_url, 223 const GURL& icon_url,
223 history::IconType icon_type, 224 history::IconType icon_type,
224 const gfx::Image& image); 225 const gfx::Image& image);
225 226
227 // Avoid repeated requests to download missing favicon (crbug 39402).
pauljensen 2013/04/30 14:38:04 The prevailing style is crbug.com/39402.
mef 2013/04/30 21:57:03 Done.
228 void AddMissingFavicon(const GURL& icon_url);
229 bool IsMissingFavicon(const GURL& icon_url) const;
230
226 private: 231 private:
232 base::hash_set<int32> missing_favicon_urls_;
mef 2013/04/29 21:55:03 Lint suggests to add #include for hash_set<>, whic
pauljensen 2013/04/30 14:38:04 Ya, I think lint is wrong and your code is correct
pauljensen 2013/04/30 14:38:04 You should not use int32. The Google C++ coding s
mef 2013/04/30 21:57:03 Done.
mef 2013/04/30 21:57:03 Done.
227 HistoryService* history_service_; 233 HistoryService* history_service_;
228 234
229 // Helper function for GetFaviconImageForURL(), GetRawFaviconForURL() and 235 // Helper function for GetFaviconImageForURL(), GetRawFaviconForURL() and
230 // GetFaviconForURL(). 236 // GetFaviconForURL().
231 CancelableTaskTracker::TaskId GetFaviconForURLImpl( 237 CancelableTaskTracker::TaskId GetFaviconForURLImpl(
232 const FaviconForURLParams& params, 238 const FaviconForURLParams& params,
233 const std::vector<ui::ScaleFactor>& desired_scale_factors, 239 const std::vector<ui::ScaleFactor>& desired_scale_factors,
234 const FaviconResultsCallback& callback, 240 const FaviconResultsCallback& callback,
235 CancelableTaskTracker* tracker); 241 CancelableTaskTracker* tracker);
236 242
(...skipping 12 matching lines...) Expand all
249 void RunFaviconRawCallbackWithBitmapResults( 255 void RunFaviconRawCallbackWithBitmapResults(
250 const FaviconRawCallback& callback, 256 const FaviconRawCallback& callback,
251 int desired_size_in_dip, 257 int desired_size_in_dip,
252 ui::ScaleFactor desired_scale_factor, 258 ui::ScaleFactor desired_scale_factor,
253 const std::vector<history::FaviconBitmapResult>& favicon_bitmap_results); 259 const std::vector<history::FaviconBitmapResult>& favicon_bitmap_results);
254 260
255 DISALLOW_COPY_AND_ASSIGN(FaviconService); 261 DISALLOW_COPY_AND_ASSIGN(FaviconService);
256 }; 262 };
257 263
258 #endif // CHROME_BROWSER_FAVICON_FAVICON_SERVICE_H_ 264 #endif // CHROME_BROWSER_FAVICON_FAVICON_SERVICE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/favicon/favicon_service.cc » ('j') | chrome/browser/favicon/favicon_service.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698