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

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

Issue 1131113004: Convert JsonWriter::Write to taking a const ref for the in-param (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another rebase 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/install_signer.h" 5 #include "chrome/browser/extensions/install_signer.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 // } 381 // }
382 base::DictionaryValue dictionary; 382 base::DictionaryValue dictionary;
383 dictionary.SetInteger(kProtocolVersionKey, 1); 383 dictionary.SetInteger(kProtocolVersionKey, 1);
384 dictionary.SetString(kHashKey, hash_base64); 384 dictionary.SetString(kHashKey, hash_base64);
385 scoped_ptr<base::ListValue> id_list(new base::ListValue); 385 scoped_ptr<base::ListValue> id_list(new base::ListValue);
386 for (ExtensionIdSet::const_iterator i = ids_.begin(); i != ids_.end(); ++i) { 386 for (ExtensionIdSet::const_iterator i = ids_.begin(); i != ids_.end(); ++i) {
387 id_list->AppendString(*i); 387 id_list->AppendString(*i);
388 } 388 }
389 dictionary.Set(kIdsKey, id_list.release()); 389 dictionary.Set(kIdsKey, id_list.release());
390 std::string json; 390 std::string json;
391 base::JSONWriter::Write(&dictionary, &json); 391 base::JSONWriter::Write(dictionary, &json);
392 if (json.empty()) { 392 if (json.empty()) {
393 ReportErrorViaCallback(); 393 ReportErrorViaCallback();
394 return; 394 return;
395 } 395 }
396 url_fetcher_->SetUploadData("application/json", json); 396 url_fetcher_->SetUploadData("application/json", json);
397 LogRequestStartHistograms(); 397 LogRequestStartHistograms();
398 request_start_time_ = base::Time::Now(); 398 request_start_time_ = base::Time::Now();
399 VLOG(1) << "Sending request: " << json; 399 VLOG(1) << "Sending request: " << json;
400 url_fetcher_->Start(); 400 url_fetcher_->Start();
401 } 401 }
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 if (!verified) 501 if (!verified)
502 result.reset(); 502 result.reset();
503 } 503 }
504 504
505 if (!callback_.is_null()) 505 if (!callback_.is_null())
506 callback_.Run(result.Pass()); 506 callback_.Run(result.Pass());
507 } 507 }
508 508
509 509
510 } // namespace extensions 510 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_messages_apitest.cc ('k') | chrome/browser/extensions/test_extension_environment.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698