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

Side by Side Diff: content/renderer/fetchers/image_resource_fetcher.cc

Issue 532773002: Implement ManifestFetcher, helper to fetch Web Manifests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "content/renderer/fetchers/image_resource_fetcher.h" 5 #include "content/renderer/fetchers/image_resource_fetcher.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/debug/crash_logging.h" 9 #include "base/debug/crash_logging.h"
10 #include "content/child/image_decoder.h" 10 #include "content/child/image_decoder.h"
(...skipping 17 matching lines...) Expand all
28 WebURLRequest::RequestContext request_context, 28 WebURLRequest::RequestContext request_context,
29 const Callback& callback) 29 const Callback& callback)
30 : callback_(callback), 30 : callback_(callback),
31 id_(id), 31 id_(id),
32 image_url_(image_url), 32 image_url_(image_url),
33 image_size_(image_size) { 33 image_size_(image_size) {
34 fetcher_.reset(ResourceFetcher::Create(image_url)); 34 fetcher_.reset(ResourceFetcher::Create(image_url));
35 fetcher_->Start(frame, 35 fetcher_->Start(frame,
36 request_context, 36 request_context,
37 WebURLRequest::FrameTypeNone, 37 WebURLRequest::FrameTypeNone,
38 ResourceFetcher::PLATFORM_LOADER,
38 base::Bind(&ImageResourceFetcher::OnURLFetchComplete, 39 base::Bind(&ImageResourceFetcher::OnURLFetchComplete,
39 base::Unretained(this))); 40 base::Unretained(this)));
40 41
41 // Set subresource URL for crash reporting. 42 // Set subresource URL for crash reporting.
42 base::debug::SetCrashKeyValue("subresource_url", image_url.spec()); 43 base::debug::SetCrashKeyValue("subresource_url", image_url.spec());
43 } 44 }
44 45
45 ImageResourceFetcher::~ImageResourceFetcher() { 46 ImageResourceFetcher::~ImageResourceFetcher() {
46 } 47 }
47 48
(...skipping 11 matching lines...) Expand all
59 // response as an image. The delegate will see a null image, indicating 60 // response as an image. The delegate will see a null image, indicating
60 // that an error occurred. 61 // that an error occurred.
61 62
62 // Take a reference to the callback as running the callback may lead to our 63 // Take a reference to the callback as running the callback may lead to our
63 // destruction. 64 // destruction.
64 Callback callback = callback_; 65 Callback callback = callback_;
65 callback.Run(this, bitmap); 66 callback.Run(this, bitmap);
66 } 67 }
67 68
68 } // namespace content 69 } // namespace content
OLDNEW
« no previous file with comments | « content/public/renderer/resource_fetcher.h ('k') | content/renderer/fetchers/manifest_fetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698