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

Side by Side Diff: chrome/browser/bitmap_fetcher/bitmap_fetcher.cc

Issue 1067593005: Fix race conditions in ImageDecoder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use TestBrowserThreadBundle, cleanup tests Created 5 years, 8 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/browser/bitmap_fetcher/bitmap_fetcher.h" 5 #include "chrome/browser/bitmap_fetcher/bitmap_fetcher.h"
6 6
7 #include "content/public/browser/browser_thread.h" 7 #include "content/public/browser/browser_thread.h"
8 #include "net/url_request/url_fetcher.h" 8 #include "net/url_request/url_fetcher.h"
9 #include "net/url_request/url_request_context_getter.h" 9 #include "net/url_request/url_request_context_getter.h"
10 #include "net/url_request/url_request_status.h" 10 #include "net/url_request/url_request_status.h"
11 11
12 namespace chrome { 12 namespace chrome {
13 13
14 BitmapFetcher::BitmapFetcher(const GURL& url, BitmapFetcherDelegate* delegate) 14 BitmapFetcher::BitmapFetcher(const GURL& url, BitmapFetcherDelegate* delegate)
15 : ImageRequest(content::BrowserThread::GetMessageLoopProxyForThread( 15 : url_(url),
16 content::BrowserThread::UI)),
17 url_(url),
18 delegate_(delegate) { 16 delegate_(delegate) {
19 } 17 }
20 18
21 BitmapFetcher::~BitmapFetcher() { 19 BitmapFetcher::~BitmapFetcher() {
22 } 20 }
23 21
24 void BitmapFetcher::Start(net::URLRequestContextGetter* request_context, 22 void BitmapFetcher::Start(net::URLRequestContextGetter* request_context,
25 const std::string& referrer, 23 const std::string& referrer,
26 net::URLRequest::ReferrerPolicy referrer_policy, 24 net::URLRequest::ReferrerPolicy referrer_policy,
27 int load_flags) { 25 int load_flags) {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 67
70 void BitmapFetcher::OnDecodeImageFailed() { 68 void BitmapFetcher::OnDecodeImageFailed() {
71 ReportFailure(); 69 ReportFailure();
72 } 70 }
73 71
74 void BitmapFetcher::ReportFailure() { 72 void BitmapFetcher::ReportFailure() {
75 delegate_->OnFetchComplete(url_, NULL); 73 delegate_->OnFetchComplete(url_, NULL);
76 } 74 }
77 75
78 } // namespace chrome 76 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/apps/drive/drive_app_converter.cc ('k') | chrome/browser/bitmap_fetcher/bitmap_fetcher_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698