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

Side by Side Diff: base/test/test_pending_task.cc

Issue 1852433005: Convert //base to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase after r384946 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 | « base/test/test_pending_task.h ('k') | base/test/test_pending_task_unittest.cc » ('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 <string> 5 #include <string>
6 6
7 #include "base/test/test_pending_task.h" 7 #include "base/test/test_pending_task.h"
8 8
9 namespace base { 9 namespace base {
10 10
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 case NESTABLE: 45 case NESTABLE:
46 state->SetString("nestability", "NESTABLE"); 46 state->SetString("nestability", "NESTABLE");
47 break; 47 break;
48 case NON_NESTABLE: 48 case NON_NESTABLE:
49 state->SetString("nestability", "NON_NESTABLE"); 49 state->SetString("nestability", "NON_NESTABLE");
50 break; 50 break;
51 } 51 }
52 state->SetInteger("delay", delay.ToInternalValue()); 52 state->SetInteger("delay", delay.ToInternalValue());
53 } 53 }
54 54
55 scoped_ptr<base::trace_event::ConvertableToTraceFormat> 55 std::unique_ptr<base::trace_event::ConvertableToTraceFormat>
56 TestPendingTask::AsValue() const { 56 TestPendingTask::AsValue() const {
57 scoped_ptr<base::trace_event::TracedValue> state( 57 std::unique_ptr<base::trace_event::TracedValue> state(
58 new base::trace_event::TracedValue()); 58 new base::trace_event::TracedValue());
59 AsValueInto(state.get()); 59 AsValueInto(state.get());
60 return std::move(state); 60 return std::move(state);
61 } 61 }
62 62
63 std::string TestPendingTask::ToString() const { 63 std::string TestPendingTask::ToString() const {
64 std::string output("TestPendingTask("); 64 std::string output("TestPendingTask(");
65 AsValue()->AppendAsTraceFormat(&output); 65 AsValue()->AppendAsTraceFormat(&output);
66 output += ")"; 66 output += ")";
67 return output; 67 return output;
68 } 68 }
69 69
70 std::ostream& operator<<(std::ostream& os, const TestPendingTask& task) { 70 std::ostream& operator<<(std::ostream& os, const TestPendingTask& task) {
71 PrintTo(task, &os); 71 PrintTo(task, &os);
72 return os; 72 return os;
73 } 73 }
74 74
75 void PrintTo(const TestPendingTask& task, std::ostream* os) { 75 void PrintTo(const TestPendingTask& task, std::ostream* os) {
76 *os << task.ToString(); 76 *os << task.ToString();
77 } 77 }
78 78
79 } // namespace base 79 } // namespace base
OLDNEW
« no previous file with comments | « base/test/test_pending_task.h ('k') | base/test/test_pending_task_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698