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

Side by Side Diff: chrome/browser/extensions/webstore_data_fetcher.cc

Issue 1117703002: Adjust URLFetcher::Create API so that object is returned as scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unneeded Pass() calls 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/extensions/webstore_data_fetcher.h" 5 #include "chrome/browser/extensions/webstore_data_fetcher.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/browser/extensions/webstore_data_fetcher_delegate.h" 9 #include "chrome/browser/extensions/webstore_data_fetcher_delegate.h"
10 #include "chrome/browser/safe_json_parser.h" 10 #include "chrome/browser/safe_json_parser.h"
(...skipping 20 matching lines...) Expand all
31 referrer_url_(referrer_url), 31 referrer_url_(referrer_url),
32 id_(webstore_item_id), 32 id_(webstore_item_id),
33 max_auto_retries_(0) { 33 max_auto_retries_(0) {
34 } 34 }
35 35
36 WebstoreDataFetcher::~WebstoreDataFetcher() {} 36 WebstoreDataFetcher::~WebstoreDataFetcher() {}
37 37
38 void WebstoreDataFetcher::Start() { 38 void WebstoreDataFetcher::Start() {
39 GURL webstore_data_url(extension_urls::GetWebstoreItemJsonDataURL(id_)); 39 GURL webstore_data_url(extension_urls::GetWebstoreItemJsonDataURL(id_));
40 40
41 webstore_data_url_fetcher_.reset(net::URLFetcher::Create( 41 webstore_data_url_fetcher_ =
42 webstore_data_url, net::URLFetcher::GET, this)); 42 net::URLFetcher::Create(webstore_data_url, net::URLFetcher::GET, this);
43 webstore_data_url_fetcher_->SetRequestContext(request_context_); 43 webstore_data_url_fetcher_->SetRequestContext(request_context_);
44 webstore_data_url_fetcher_->SetReferrer(referrer_url_.spec()); 44 webstore_data_url_fetcher_->SetReferrer(referrer_url_.spec());
45 webstore_data_url_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES | 45 webstore_data_url_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES |
46 net::LOAD_DISABLE_CACHE); 46 net::LOAD_DISABLE_CACHE);
47 if (max_auto_retries_ > 0) { 47 if (max_auto_retries_ > 0) {
48 webstore_data_url_fetcher_->SetMaxRetriesOn5xx(max_auto_retries_); 48 webstore_data_url_fetcher_->SetMaxRetriesOn5xx(max_auto_retries_);
49 webstore_data_url_fetcher_->SetAutomaticallyRetryOnNetworkChanges( 49 webstore_data_url_fetcher_->SetAutomaticallyRetryOnNetworkChanges(
50 max_auto_retries_); 50 max_auto_retries_);
51 } 51 }
52 webstore_data_url_fetcher_->Start(); 52 webstore_data_url_fetcher_->Start();
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 new SafeJsonParser(webstore_json_data, 86 new SafeJsonParser(webstore_json_data,
87 base::Bind(&WebstoreDataFetcher::OnJsonParseSuccess, 87 base::Bind(&WebstoreDataFetcher::OnJsonParseSuccess,
88 AsWeakPtr()), 88 AsWeakPtr()),
89 base::Bind(&WebstoreDataFetcher::OnJsonParseFailure, 89 base::Bind(&WebstoreDataFetcher::OnJsonParseFailure,
90 AsWeakPtr())); 90 AsWeakPtr()));
91 // The parser will call us back via one of the callbacks. 91 // The parser will call us back via one of the callbacks.
92 parser->Start(); 92 parser->Start();
93 } 93 }
94 94
95 } // namespace extensions 95 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/install_signer.cc ('k') | chrome/browser/intranet_redirect_detector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698