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

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

Issue 1875623002: Convert //chromecast from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « chromecast/crash/linux/crash_testing_utils.cc ('k') | chromecast/crash/linux/dump_info.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 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/crash_util.h" 5 #include "chromecast/crash/linux/crash_util.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/threading/thread_restrictions.h" 10 #include "base/threading/thread_restrictions.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 AppStateTracker::GetPreviousApp(), 51 AppStateTracker::GetPreviousApp(),
52 AppStateTracker::GetCurrentApp(), 52 AppStateTracker::GetCurrentApp(),
53 AppStateTracker::GetLastLaunchedApp(), 53 AppStateTracker::GetLastLaunchedApp(),
54 CAST_BUILD_RELEASE, 54 CAST_BUILD_RELEASE,
55 CAST_BUILD_INCREMENTAL, 55 CAST_BUILD_INCREMENTAL,
56 "" /* reason */); 56 "" /* reason */);
57 DummyMinidumpGenerator minidump_generator(existing_minidump_path); 57 DummyMinidumpGenerator minidump_generator(existing_minidump_path);
58 58
59 base::FilePath filename = base::FilePath(existing_minidump_path).BaseName(); 59 base::FilePath filename = base::FilePath(existing_minidump_path).BaseName();
60 60
61 scoped_ptr<MinidumpWriter> writer; 61 std::unique_ptr<MinidumpWriter> writer;
62 if (g_dumpstate_cb) { 62 if (g_dumpstate_cb) {
63 writer.reset(new MinidumpWriter( 63 writer.reset(new MinidumpWriter(
64 &minidump_generator, filename.value(), params, *g_dumpstate_cb)); 64 &minidump_generator, filename.value(), params, *g_dumpstate_cb));
65 } else { 65 } else {
66 writer.reset( 66 writer.reset(
67 new MinidumpWriter(&minidump_generator, filename.value(), params)); 67 new MinidumpWriter(&minidump_generator, filename.value(), params));
68 } 68 }
69 bool success = false; 69 bool success = false;
70 writer->set_non_blocking(false); 70 writer->set_non_blocking(false);
71 success = (0 == writer->Write()); // error already logged. 71 success = (0 == writer->Write()); // error already logged.
(...skipping 16 matching lines...) Expand all
88 return success; 88 return success;
89 } 89 }
90 90
91 void CrashUtil::SetDumpStateCbForTest( 91 void CrashUtil::SetDumpStateCbForTest(
92 const base::Callback<int(const std::string&)>& cb) { 92 const base::Callback<int(const std::string&)>& cb) {
93 DCHECK(!g_dumpstate_cb); 93 DCHECK(!g_dumpstate_cb);
94 g_dumpstate_cb = new base::Callback<int(const std::string&)>(cb); 94 g_dumpstate_cb = new base::Callback<int(const std::string&)>(cb);
95 } 95 }
96 96
97 } // namespace chromecast 97 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/crash/linux/crash_testing_utils.cc ('k') | chromecast/crash/linux/dump_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698