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

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

Issue 1103343005: favor DCHECK_CURRENTLY_ON for better logs in chrome/browser/autocomplete,banners,background (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/banners/app_banner_data_fetcher.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
(...skipping 19 matching lines...) Expand all
30 url_fetcher_->SetRequestContext(request_context); 30 url_fetcher_->SetRequestContext(request_context);
31 url_fetcher_->SetReferrer(referrer); 31 url_fetcher_->SetReferrer(referrer);
32 url_fetcher_->SetReferrerPolicy(referrer_policy); 32 url_fetcher_->SetReferrerPolicy(referrer_policy);
33 url_fetcher_->SetLoadFlags(load_flags); 33 url_fetcher_->SetLoadFlags(load_flags);
34 url_fetcher_->Start(); 34 url_fetcher_->Start();
35 } 35 }
36 36
37 // Methods inherited from URLFetcherDelegate. 37 // Methods inherited from URLFetcherDelegate.
38 38
39 void BitmapFetcher::OnURLFetchComplete(const net::URLFetcher* source) { 39 void BitmapFetcher::OnURLFetchComplete(const net::URLFetcher* source) {
40 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 40 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
41 41
42 if (source->GetStatus().status() != net::URLRequestStatus::SUCCESS) { 42 if (source->GetStatus().status() != net::URLRequestStatus::SUCCESS) {
43 ReportFailure(); 43 ReportFailure();
44 return; 44 return;
45 } 45 }
46 46
47 std::string image_data; 47 std::string image_data;
48 source->GetResponseAsString(&image_data); 48 source->GetResponseAsString(&image_data);
49 49
50 // Call start to begin decoding. The ImageDecoder will call OnImageDecoded 50 // Call start to begin decoding. The ImageDecoder will call OnImageDecoded
(...skipping 16 matching lines...) Expand all
67 67
68 void BitmapFetcher::OnDecodeImageFailed() { 68 void BitmapFetcher::OnDecodeImageFailed() {
69 ReportFailure(); 69 ReportFailure();
70 } 70 }
71 71
72 void BitmapFetcher::ReportFailure() { 72 void BitmapFetcher::ReportFailure() {
73 delegate_->OnFetchComplete(url_, NULL); 73 delegate_->OnFetchComplete(url_, NULL);
74 } 74 }
75 75
76 } // namespace chrome 76 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/banners/app_banner_data_fetcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698