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

Unified Diff: components/image_fetcher/image_fetcher_impl.cc

Issue 2074153002: Pass the ImageDecoder to the ImageFetcher at creation time. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments treib@, bauerb@ Created 4 years, 6 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
« no previous file with comments | « components/image_fetcher/image_fetcher_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/image_fetcher/image_fetcher_impl.cc
diff --git a/chrome/browser/search/suggestions/image_fetcher_impl.cc b/components/image_fetcher/image_fetcher_impl.cc
similarity index 90%
rename from chrome/browser/search/suggestions/image_fetcher_impl.cc
rename to components/image_fetcher/image_fetcher_impl.cc
index 9d046f0a05ba7e381075b2a7b91af406c78d8b55..a0c3adf0ddba8470a174dcbb987ecc6fec25d3c4 100644
--- a/chrome/browser/search/suggestions/image_fetcher_impl.cc
+++ b/components/image_fetcher/image_fetcher_impl.cc
@@ -2,25 +2,23 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/search/suggestions/image_fetcher_impl.h"
+#include "components/image_fetcher/image_fetcher_impl.h"
#include <string>
#include "base/bind.h"
-#include "chrome/browser/search/suggestions/image_decoder_impl.h"
-#include "content/public/browser/browser_thread.h"
#include "net/base/load_flags.h"
#include "net/url_request/url_request_context_getter.h"
-#include "ui/gfx/image/image.h"
-namespace suggestions {
+namespace image_fetcher {
ImageFetcherImpl::ImageFetcherImpl(
+ std::unique_ptr<image_fetcher::ImageDecoder> image_decoder,
net::URLRequestContextGetter* url_request_context)
: delegate_(nullptr), url_request_context_(url_request_context),
- image_decoder_(new suggestions::ImageDecoderImpl()),
+ image_decoder_(std::move(image_decoder)),
image_data_fetcher_(
- new image_fetcher::ImageDataFetcher(url_request_context_)) {
+ new image_fetcher::ImageDataFetcher(url_request_context_.get())) {
Marc Treib 2016/06/29 14:41:33 nit: "image_fetcher::" isn't required anymore :)
markusheintz_ 2016/06/29 14:56:24 Done. Updated here and and in the rest of the file
}
ImageFetcherImpl::~ImageFetcherImpl() {}
@@ -97,4 +95,4 @@ void ImageFetcherImpl::OnImageDecoded(const GURL& image_url,
pending_net_requests_.erase(image_iter);
}
-} // namespace suggestions
+} // namespace image_fetcher
« no previous file with comments | « components/image_fetcher/image_fetcher_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698