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

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

Issue 10837044: Correct const accessors in base/values.(h|cc), Part II (ListValue) (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: David's comments Created 8 years, 4 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/extensions/webstore_inline_installer.cc ('k') | chrome/browser/gpu_blacklist.h » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_install_helper.h" 5 #include "chrome/browser/extensions/webstore_install_helper.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 145 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
146 icon_decode_complete_ = true; 146 icon_decode_complete_ = true;
147 error_ = kImageDecodeError; 147 error_ = kImageDecodeError;
148 parse_error_ = Delegate::ICON_ERROR; 148 parse_error_ = Delegate::ICON_ERROR;
149 ReportResultsIfComplete(); 149 ReportResultsIfComplete();
150 } 150 }
151 151
152 void WebstoreInstallHelper::OnJSONParseSucceeded(const ListValue& wrapper) { 152 void WebstoreInstallHelper::OnJSONParseSucceeded(const ListValue& wrapper) {
153 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 153 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
154 manifest_parse_complete_ = true; 154 manifest_parse_complete_ = true;
155 Value* value = NULL; 155 const Value* value = NULL;
156 CHECK(wrapper.Get(0, &value)); 156 CHECK(wrapper.Get(0, &value));
157 if (value->IsType(Value::TYPE_DICTIONARY)) { 157 if (value->IsType(Value::TYPE_DICTIONARY)) {
158 parsed_manifest_.reset( 158 parsed_manifest_.reset(
159 static_cast<DictionaryValue*>(value)->DeepCopy()); 159 static_cast<const DictionaryValue*>(value)->DeepCopy());
160 } else { 160 } else {
161 parse_error_ = Delegate::MANIFEST_ERROR; 161 parse_error_ = Delegate::MANIFEST_ERROR;
162 } 162 }
163 ReportResultsIfComplete(); 163 ReportResultsIfComplete();
164 } 164 }
165 165
166 void WebstoreInstallHelper::OnJSONParseFailed( 166 void WebstoreInstallHelper::OnJSONParseFailed(
167 const std::string& error_message) { 167 const std::string& error_message) {
168 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 168 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
169 manifest_parse_complete_ = true; 169 manifest_parse_complete_ = true;
(...skipping 22 matching lines...) Expand all
192 192
193 void WebstoreInstallHelper::ReportResultFromUIThread() { 193 void WebstoreInstallHelper::ReportResultFromUIThread() {
194 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 194 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
195 if (error_.empty() && parsed_manifest_.get()) 195 if (error_.empty() && parsed_manifest_.get())
196 delegate_->OnWebstoreParseSuccess(id_, icon_, parsed_manifest_.release()); 196 delegate_->OnWebstoreParseSuccess(id_, icon_, parsed_manifest_.release());
197 else 197 else
198 delegate_->OnWebstoreParseFailure(id_, parse_error_, error_); 198 delegate_->OnWebstoreParseFailure(id_, parse_error_, error_);
199 } 199 }
200 200
201 } // namespace extensions 201 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/webstore_inline_installer.cc ('k') | chrome/browser/gpu_blacklist.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698