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

Side by Side Diff: components/favicon/core/large_icon_service.cc

Issue 2856873002: [Thumbnails DB] Allow setting last_requested time when accessing favicons. (Closed)
Patch Set: Splitting off clearing Created 3 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
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 "components/favicon/core/large_icon_service.h" 5 #include "components/favicon/core/large_icon_service.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/feature_list.h" 10 #include "base/feature_list.h"
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 std::string original_icon_url = metadata.content_location_header; 287 std::string original_icon_url = metadata.content_location_header;
288 if (original_icon_url.empty()) { 288 if (original_icon_url.empty()) {
289 original_icon_url = server_request_url; 289 original_icon_url = server_request_url;
290 } 290 }
291 291
292 // Write fetched icons to FaviconService's cache, but only if no icon was 292 // Write fetched icons to FaviconService's cache, but only if no icon was
293 // available (clients are encouraged to do this in advance, but meanwhile 293 // available (clients are encouraged to do this in advance, but meanwhile
294 // something else could've been written). By marking the icons initially 294 // something else could've been written). By marking the icons initially
295 // expired (out-of-date), they will be refetched when we visit the original 295 // expired (out-of-date), they will be refetched when we visit the original
296 // page any time in the future. 296 // page any time in the future.
297 favicon_service->SetLastResortFavicons(page_url, GURL(original_icon_url), 297 favicon_service->SetOnDemandFavicons(page_url, GURL(original_icon_url),
298 favicon_base::IconType::TOUCH_ICON, 298 favicon_base::IconType::TOUCH_ICON,
299 image, callback); 299 image, callback);
300 } 300 }
301 301
302 } // namespace 302 } // namespace
303 303
304 LargeIconService::LargeIconService( 304 LargeIconService::LargeIconService(
305 FaviconService* favicon_service, 305 FaviconService* favicon_service,
306 const scoped_refptr<base::TaskRunner>& background_task_runner, 306 const scoped_refptr<base::TaskRunner>& background_task_runner,
307 std::unique_ptr<image_fetcher::ImageFetcher> image_fetcher) 307 std::unique_ptr<image_fetcher::ImageFetcher> image_fetcher)
308 : favicon_service_(favicon_service), 308 : favicon_service_(favicon_service),
309 background_task_runner_(background_task_runner), 309 background_task_runner_(background_task_runner),
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 // TODO(beaudoin): For now this is just a wrapper around 412 // TODO(beaudoin): For now this is just a wrapper around
413 // GetLargestRawFaviconForPageURL. Add the logic required to select the best 413 // GetLargestRawFaviconForPageURL. Add the logic required to select the best
414 // possible large icon. Also add logic to fetch-on-demand when the URL of 414 // possible large icon. Also add logic to fetch-on-demand when the URL of
415 // a large icon is known but its bitmap is not available. 415 // a large icon is known but its bitmap is not available.
416 return favicon_service_->GetLargestRawFaviconForPageURL( 416 return favicon_service_->GetLargestRawFaviconForPageURL(
417 page_url, large_icon_types_, min_source_size_in_pixel, 417 page_url, large_icon_types_, min_source_size_in_pixel,
418 base::Bind(&LargeIconWorker::OnIconLookupComplete, worker), tracker); 418 base::Bind(&LargeIconWorker::OnIconLookupComplete, worker), tracker);
419 } 419 }
420 420
421 } // namespace favicon 421 } // namespace favicon
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698