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

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

Issue 2539363004: Make base::Value::TYPE a scoped enum. (Closed)
Patch Set: Rebase Created 4 years 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> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 if (max_auto_retries_ > 0) { 49 if (max_auto_retries_ > 0) {
50 webstore_data_url_fetcher_->SetMaxRetriesOn5xx(max_auto_retries_); 50 webstore_data_url_fetcher_->SetMaxRetriesOn5xx(max_auto_retries_);
51 webstore_data_url_fetcher_->SetAutomaticallyRetryOnNetworkChanges( 51 webstore_data_url_fetcher_->SetAutomaticallyRetryOnNetworkChanges(
52 max_auto_retries_); 52 max_auto_retries_);
53 } 53 }
54 webstore_data_url_fetcher_->Start(); 54 webstore_data_url_fetcher_->Start();
55 } 55 }
56 56
57 void WebstoreDataFetcher::OnJsonParseSuccess( 57 void WebstoreDataFetcher::OnJsonParseSuccess(
58 std::unique_ptr<base::Value> parsed_json) { 58 std::unique_ptr<base::Value> parsed_json) {
59 if (!parsed_json->IsType(base::Value::TYPE_DICTIONARY)) { 59 if (!parsed_json->IsType(base::Value::Type::DICTIONARY)) {
60 OnJsonParseFailure(kInvalidWebstoreResponseError); 60 OnJsonParseFailure(kInvalidWebstoreResponseError);
61 return; 61 return;
62 } 62 }
63 63
64 delegate_->OnWebstoreResponseParseSuccess( 64 delegate_->OnWebstoreResponseParseSuccess(
65 std::unique_ptr<base::DictionaryValue>( 65 std::unique_ptr<base::DictionaryValue>(
66 static_cast<base::DictionaryValue*>(parsed_json.release()))); 66 static_cast<base::DictionaryValue*>(parsed_json.release())));
67 } 67 }
68 68
69 void WebstoreDataFetcher::OnJsonParseFailure( 69 void WebstoreDataFetcher::OnJsonParseFailure(
(...skipping 17 matching lines...) Expand all
87 fetcher->GetResponseAsString(&webstore_json_data); 87 fetcher->GetResponseAsString(&webstore_json_data);
88 88
89 // The parser will call us back via one of the callbacks. 89 // The parser will call us back via one of the callbacks.
90 safe_json::SafeJsonParser::Parse( 90 safe_json::SafeJsonParser::Parse(
91 webstore_json_data, 91 webstore_json_data,
92 base::Bind(&WebstoreDataFetcher::OnJsonParseSuccess, AsWeakPtr()), 92 base::Bind(&WebstoreDataFetcher::OnJsonParseSuccess, AsWeakPtr()),
93 base::Bind(&WebstoreDataFetcher::OnJsonParseFailure, AsWeakPtr())); 93 base::Bind(&WebstoreDataFetcher::OnJsonParseFailure, AsWeakPtr()));
94 } 94 }
95 95
96 } // namespace extensions 96 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/policy_handlers.cc ('k') | chrome/browser/media/webrtc/webrtc_browsertest_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698