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

Side by Side Diff: chrome/browser/apps/drive/drive_app_converter.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
« no previous file with comments | « chrome/browser/android/logo_service.cc ('k') | chrome/browser/bitmap_fetcher/bitmap_fetcher.cc » ('j') | 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/apps/drive/drive_app_converter.h" 5 #include "chrome/browser/apps/drive/drive_app_converter.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 19 matching lines...) Expand all
30 // url is passed from a DriveAppInfo and should follow icon url definition 30 // url is passed from a DriveAppInfo and should follow icon url definition
31 // in Drive API: 31 // in Drive API:
32 // https://developers.google.com/drive/v2/reference/apps#resource 32 // https://developers.google.com/drive/v2/reference/apps#resource
33 // Each icon url represents a single image associated with a certain size. 33 // Each icon url represents a single image associated with a certain size.
34 class DriveAppConverter::IconFetcher : public net::URLFetcherDelegate, 34 class DriveAppConverter::IconFetcher : public net::URLFetcherDelegate,
35 public ImageDecoder::ImageRequest { 35 public ImageDecoder::ImageRequest {
36 public: 36 public:
37 IconFetcher(DriveAppConverter* converter, 37 IconFetcher(DriveAppConverter* converter,
38 const GURL& icon_url, 38 const GURL& icon_url,
39 int expected_size) 39 int expected_size)
40 : ImageRequest( 40 : converter_(converter),
41 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI)),
42 converter_(converter),
43 icon_url_(icon_url), 41 icon_url_(icon_url),
44 expected_size_(expected_size) {} 42 expected_size_(expected_size) {}
45 ~IconFetcher() override {} 43 ~IconFetcher() override {}
46 44
47 void Start() { 45 void Start() {
48 fetcher_.reset( 46 fetcher_.reset(
49 net::URLFetcher::Create(icon_url_, net::URLFetcher::GET, this)); 47 net::URLFetcher::Create(icon_url_, net::URLFetcher::GET, this));
50 fetcher_->SetRequestContext(converter_->profile_->GetRequestContext()); 48 fetcher_->SetRequestContext(converter_->profile_->GetRequestContext());
51 fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES); 49 fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES);
52 fetcher_->Start(); 50 fetcher_->Start();
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 return; 194 return;
197 } 195 }
198 196
199 extension_ = crx_installer_->extension(); 197 extension_ = crx_installer_->extension();
200 is_new_install_ = success && crx_installer_->current_version().empty(); 198 is_new_install_ = success && crx_installer_->current_version().empty();
201 PostInstallCleanUp(); 199 PostInstallCleanUp();
202 200
203 finished_callback_.Run(this, success); 201 finished_callback_.Run(this, success);
204 // |finished_callback_| could delete this. 202 // |finished_callback_| could delete this.
205 } 203 }
OLDNEW
« no previous file with comments | « chrome/browser/android/logo_service.cc ('k') | chrome/browser/bitmap_fetcher/bitmap_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698