| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 state->SetString("nestability", "NON_NESTABLE"); | 47 state->SetString("nestability", "NON_NESTABLE"); |
| 48 break; | 48 break; |
| 49 } | 49 } |
| 50 state->SetInteger("delay", delay.ToInternalValue()); | 50 state->SetInteger("delay", delay.ToInternalValue()); |
| 51 } | 51 } |
| 52 | 52 |
| 53 scoped_refptr<base::debug::ConvertableToTraceFormat> TestPendingTask::AsValue() | 53 scoped_refptr<base::debug::ConvertableToTraceFormat> TestPendingTask::AsValue() |
| 54 const { | 54 const { |
| 55 scoped_refptr<base::debug::TracedValue> state = | 55 scoped_refptr<base::debug::TracedValue> state = |
| 56 new base::debug::TracedValue(); | 56 new base::debug::TracedValue(); |
| 57 AsValueInto(state); | 57 AsValueInto(state.get()); |
| 58 return state; | 58 return state; |
| 59 } | 59 } |
| 60 | 60 |
| 61 std::string TestPendingTask::ToString() const { | 61 std::string TestPendingTask::ToString() const { |
| 62 std::string output("TestPendingTask("); | 62 std::string output("TestPendingTask("); |
| 63 AsValue()->AppendAsTraceFormat(&output); | 63 AsValue()->AppendAsTraceFormat(&output); |
| 64 output += ")"; | 64 output += ")"; |
| 65 return output; | 65 return output; |
| 66 } | 66 } |
| 67 | 67 |
| 68 std::ostream& operator<<(std::ostream& os, const TestPendingTask& task) { | 68 std::ostream& operator<<(std::ostream& os, const TestPendingTask& task) { |
| 69 PrintTo(task, &os); | 69 PrintTo(task, &os); |
| 70 return os; | 70 return os; |
| 71 } | 71 } |
| 72 | 72 |
| 73 void PrintTo(const TestPendingTask& task, std::ostream* os) { | 73 void PrintTo(const TestPendingTask& task, std::ostream* os) { |
| 74 *os << task.ToString(); | 74 *os << task.ToString(); |
| 75 } | 75 } |
| 76 | 76 |
| 77 } // namespace base | 77 } // namespace base |
| OLD | NEW |