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

Unified Diff: components/favicon/core/large_icon_service.h

Issue 1122103003: [Large Icon Service] Move icon resizing into worker thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename Session to LargeIconWorker and move to anonymous namespace; use PostTaskAndReply(). Created 5 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 side-by-side diff with in-line comments
Download patch
Index: components/favicon/core/large_icon_service.h
diff --git a/components/favicon/core/large_icon_service.h b/components/favicon/core/large_icon_service.h
index a214e2037a8438b3fbc0a6f9444412523a775458..f5c932312e92b16d04ec0738c2ca58cba08c0b75 100644
--- a/components/favicon/core/large_icon_service.h
+++ b/components/favicon/core/large_icon_service.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2015 The Chromium Authors. All rights reserved.
+// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -7,14 +7,15 @@
#include <vector>
+#include "base/memory/ref_counted.h"
pkotwicz 2015/05/11 18:57:39 Nit: The include can now be in the .cc file?
huangs 2015/05/11 20:24:37 Done.
#include "base/task/cancelable_task_tracker.h"
#include "components/favicon_base/favicon_callback.h"
#include "components/keyed_service/core/keyed_service.h"
class GURL;
-namespace favicon_base {
-struct FaviconRawBitmapResult;
+namespace base {
+class TaskRunner;
}
namespace favicon {
@@ -47,33 +48,18 @@ class LargeIconService : public KeyedService {
const favicon_base::LargeIconCallback& callback,
base::CancelableTaskTracker* tracker);
+ // Returns TaskRunner used to execute background task.
+ virtual scoped_refptr<base::TaskRunner> GetBackgroundTaskRunner();
+
private:
// For testing.
friend class TestLargeIconService;
- // Resizes |bitmap_result| to |desired_size_in_pixel|x|desired_size_in_pixel|.
- // Stores the resized bitmap data in |resized_bitmap_result| and returns true
- // if successful.
- bool ResizeLargeIconIfValid(
- int min_source_size_in_pixel,
- int desired_size_in_pixel,
- const favicon_base::FaviconRawBitmapResult& bitmap_result,
- favicon_base::FaviconRawBitmapResult* resized_bitmap_result);
-
- // Intermediate callback for GetLargeIconOrFallbackStyle(). Tries to resize
- // |bitmap_result| and pass the output to |callback|. If that does not work,
- // computes the icon fallback style and uses it to invoke |callback|.
- void RunLargeIconCallback(
- const favicon_base::LargeIconCallback& callback,
- int min_source_size_in_pixel,
- int desired_size_in_pixel,
- const favicon_base::FaviconRawBitmapResult& bitmap_result);
-
FaviconService* favicon_service_;
- // A pre-populated list of the types of icon files to consider when looking
- // for large icons. This is an optimization over populating an icon type
- // vector on each request.
+ // A pre-populated list of icon types to consider when looking for large
+ // icons. This is an optimization over populating an icon type vector on each
+ // request.
std::vector<int> large_icon_types_;
DISALLOW_COPY_AND_ASSIGN(LargeIconService);

Powered by Google App Engine
This is Rietveld 408576698