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

Unified Diff: chrome/browser/bitmap_fetcher/bitmap_fetcher_service.h

Issue 2682263002: Network traffic annotation added to chrome::BitmapFetcher. (Closed)
Patch Set: Unittests added. Created 3 years, 10 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: chrome/browser/bitmap_fetcher/bitmap_fetcher_service.h
diff --git a/chrome/browser/bitmap_fetcher/bitmap_fetcher_service.h b/chrome/browser/bitmap_fetcher/bitmap_fetcher_service.h
index b3bdcf2df4ecbd0725d194cc0388addeefbe3848..8c8e355aae59da5080c4b573088628f327991646 100644
--- a/chrome/browser/bitmap_fetcher/bitmap_fetcher_service.h
+++ b/chrome/browser/bitmap_fetcher/bitmap_fetcher_service.h
@@ -12,6 +12,7 @@
#include "base/memory/scoped_vector.h"
#include "chrome/browser/bitmap_fetcher/bitmap_fetcher_delegate.h"
#include "components/keyed_service/core/keyed_service.h"
+#include "net/traffic_annotation/network_traffic_annotation.h"
namespace content {
class BrowserContext;
@@ -56,22 +57,30 @@ class BitmapFetcherService : public KeyedService,
// downloaded one.
// NOTE: The observer might be called back synchronously from RequestImage if
// the image is already in the cache.
- RequestId RequestImage(const GURL& url, Observer* observer);
+ RequestId RequestImage(
+ const GURL& url,
+ Observer* observer,
+ const net::NetworkTrafficAnnotationTag& traffic_annotation);
// Start fetching the image at the given |url|.
- void Prefetch(const GURL& url);
+ void Prefetch(const GURL& url,
+ const net::NetworkTrafficAnnotationTag& traffic_annotation);
protected:
// Create a bitmap fetcher for the given |url| and start it. Virtual method
// so tests can override this for different behavior.
- virtual std::unique_ptr<chrome::BitmapFetcher> CreateFetcher(const GURL& url);
+ virtual std::unique_ptr<chrome::BitmapFetcher> CreateFetcher(
+ const GURL& url,
+ const net::NetworkTrafficAnnotationTag& traffic_annotation);
private:
friend class BitmapFetcherServiceTest;
// Gets the existing fetcher for |url| or constructs a new one if it doesn't
// exist.
- const chrome::BitmapFetcher* EnsureFetcherForUrl(const GURL& url);
+ const chrome::BitmapFetcher* EnsureFetcherForUrl(
+ const GURL& url,
+ const net::NetworkTrafficAnnotationTag& traffic_annotation);
// Find a fetcher with a given |url|. Return NULL if none is found.
const chrome::BitmapFetcher* FindFetcherForUrl(const GURL& url);

Powered by Google App Engine
This is Rietveld 408576698