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

Side by Side Diff: chromecast/crash/linux/synchronized_minidump_manager.cc

Issue 2816513002: Revert of Change base::Value::ListStorage to std::vector<base::Value> (Closed)
Patch Set: Created 3 years, 8 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "chromecast/crash/linux/synchronized_minidump_manager.h" 5 #include "chromecast/crash/linux/synchronized_minidump_manager.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <string.h> 8 #include <string.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 return true; 260 return true;
261 } 261 }
262 262
263 bool SynchronizedMinidumpManager::WriteFiles(const base::ListValue* dumps, 263 bool SynchronizedMinidumpManager::WriteFiles(const base::ListValue* dumps,
264 const base::Value* metadata) { 264 const base::Value* metadata) {
265 DCHECK(dumps); 265 DCHECK(dumps);
266 DCHECK(metadata); 266 DCHECK(metadata);
267 std::string lockfile; 267 std::string lockfile;
268 268
269 for (const auto& elem : *dumps) { 269 for (const auto& elem : *dumps) {
270 std::unique_ptr<std::string> dump_info = SerializeToJson(elem); 270 std::unique_ptr<std::string> dump_info = SerializeToJson(*elem);
271 RCHECK(dump_info, false); 271 RCHECK(dump_info, false);
272 lockfile += *dump_info; 272 lockfile += *dump_info;
273 lockfile += "\n"; // Add line seperatators 273 lockfile += "\n"; // Add line seperatators
274 } 274 }
275 275
276 if (WriteFile(lockfile_path_, lockfile.c_str(), lockfile.size()) < 0) { 276 if (WriteFile(lockfile_path_, lockfile.c_str(), lockfile.size()) < 0) {
277 return false; 277 return false;
278 } 278 }
279 279
280 return SerializeJsonToFile(metadata_path_, *metadata); 280 return SerializeJsonToFile(metadata_path_, *metadata);
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 } 325 }
326 326
327 dumps_.reset(); 327 dumps_.reset();
328 metadata_.reset(); 328 metadata_.reset();
329 } 329 }
330 330
331 std::vector<std::unique_ptr<DumpInfo>> SynchronizedMinidumpManager::GetDumps() { 331 std::vector<std::unique_ptr<DumpInfo>> SynchronizedMinidumpManager::GetDumps() {
332 std::vector<std::unique_ptr<DumpInfo>> dumps; 332 std::vector<std::unique_ptr<DumpInfo>> dumps;
333 333
334 for (const auto& elem : *dumps_) { 334 for (const auto& elem : *dumps_) {
335 dumps.push_back(std::unique_ptr<DumpInfo>(new DumpInfo(&elem))); 335 dumps.push_back(std::unique_ptr<DumpInfo>(new DumpInfo(elem.get())));
336 } 336 }
337 337
338 return dumps; 338 return dumps;
339 } 339 }
340 340
341 bool SynchronizedMinidumpManager::SetCurrentDumps( 341 bool SynchronizedMinidumpManager::SetCurrentDumps(
342 const std::vector<std::unique_ptr<DumpInfo>>& dumps) { 342 const std::vector<std::unique_ptr<DumpInfo>>& dumps) {
343 dumps_->Clear(); 343 dumps_->Clear();
344 344
345 for (auto& dump : dumps) 345 for (auto& dump : dumps)
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 406
407 bool SynchronizedMinidumpManager::InitializeFileState() { 407 bool SynchronizedMinidumpManager::InitializeFileState() {
408 if (!AcquireLockFile()) 408 if (!AcquireLockFile())
409 return false; // Error logged 409 return false; // Error logged
410 410
411 ReleaseLockFile(); 411 ReleaseLockFile();
412 return true; 412 return true;
413 } 413 }
414 414
415 } // namespace chromecast 415 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/crash/linux/crash_testing_utils.cc ('k') | chromeos/dbus/fake_shill_manager_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698