OLD | NEW |
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 Loading... |
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 |
OLD | NEW |