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

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

Issue 1549233002: Convert Pass()→std::move() in //chrome/browser/extensions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 12 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 <utility>
8
7 #include "base/bind.h" 9 #include "base/bind.h"
8 #include "base/values.h" 10 #include "base/values.h"
9 #include "chrome/browser/extensions/webstore_data_fetcher_delegate.h" 11 #include "chrome/browser/extensions/webstore_data_fetcher_delegate.h"
10 #include "components/safe_json/safe_json_parser.h" 12 #include "components/safe_json/safe_json_parser.h"
11 #include "extensions/common/extension_urls.h" 13 #include "extensions/common/extension_urls.h"
12 #include "net/base/load_flags.h" 14 #include "net/base/load_flags.h"
13 #include "net/url_request/url_fetcher.h" 15 #include "net/url_request/url_fetcher.h"
14 #include "net/url_request/url_request_status.h" 16 #include "net/url_request/url_request_status.h"
15 17
16 namespace { 18 namespace {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 } 66 }
65 67
66 void WebstoreDataFetcher::OnJsonParseFailure( 68 void WebstoreDataFetcher::OnJsonParseFailure(
67 const std::string& error) { 69 const std::string& error) {
68 delegate_->OnWebstoreResponseParseFailure(error); 70 delegate_->OnWebstoreResponseParseFailure(error);
69 } 71 }
70 72
71 void WebstoreDataFetcher::OnURLFetchComplete(const net::URLFetcher* source) { 73 void WebstoreDataFetcher::OnURLFetchComplete(const net::URLFetcher* source) {
72 CHECK_EQ(webstore_data_url_fetcher_.get(), source); 74 CHECK_EQ(webstore_data_url_fetcher_.get(), source);
73 75
74 scoped_ptr<net::URLFetcher> fetcher(webstore_data_url_fetcher_.Pass()); 76 scoped_ptr<net::URLFetcher> fetcher(std::move(webstore_data_url_fetcher_));
75 77
76 if (!fetcher->GetStatus().is_success() || 78 if (!fetcher->GetStatus().is_success() ||
77 fetcher->GetResponseCode() != 200) { 79 fetcher->GetResponseCode() != 200) {
78 delegate_->OnWebstoreRequestFailure(); 80 delegate_->OnWebstoreRequestFailure();
79 return; 81 return;
80 } 82 }
81 83
82 std::string webstore_json_data; 84 std::string webstore_json_data;
83 fetcher->GetResponseAsString(&webstore_json_data); 85 fetcher->GetResponseAsString(&webstore_json_data);
84 86
85 // The parser will call us back via one of the callbacks. 87 // The parser will call us back via one of the callbacks.
86 safe_json::SafeJsonParser::Parse( 88 safe_json::SafeJsonParser::Parse(
87 webstore_json_data, 89 webstore_json_data,
88 base::Bind(&WebstoreDataFetcher::OnJsonParseSuccess, AsWeakPtr()), 90 base::Bind(&WebstoreDataFetcher::OnJsonParseSuccess, AsWeakPtr()),
89 base::Bind(&WebstoreDataFetcher::OnJsonParseFailure, AsWeakPtr())); 91 base::Bind(&WebstoreDataFetcher::OnJsonParseFailure, AsWeakPtr()));
90 } 92 }
91 93
92 } // namespace extensions 94 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/user_script_listener_unittest.cc ('k') | chrome/browser/extensions/webstore_inline_installer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698