OLD | NEW |
---|---|
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 "base/trace_event/memory_dump_manager.h" | 5 #include "base/trace_event/memory_dump_manager.h" |
6 | 6 |
7 #include "base/bind_helpers.h" | 7 #include "base/bind_helpers.h" |
8 #include "base/memory/scoped_vector.h" | 8 #include "base/memory/scoped_vector.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
57 uint64 dump_guid, | 57 uint64 dump_guid, |
58 bool success) { | 58 bool success) { |
59 task_runner->PostTask(FROM_HERE, closure); | 59 task_runner->PostTask(FROM_HERE, closure); |
60 } | 60 } |
61 | 61 |
62 protected: | 62 protected: |
63 const char* kTraceCategory = MemoryDumpManager::kTraceCategoryForTesting; | 63 const char* kTraceCategory = MemoryDumpManager::kTraceCategoryForTesting; |
64 | 64 |
65 void EnableTracing(const char* category) { | 65 void EnableTracing(const char* category) { |
66 TraceLog::GetInstance()->SetEnabled( | 66 TraceLog::GetInstance()->SetEnabled( |
67 CategoryFilter(category), TraceLog::RECORDING_MODE, TraceOptions()); | 67 TraceConfig(category, ""), TraceLog::RECORDING_MODE); |
dsinclair
2015/06/02 13:56:54
Can we add a default value of "" to the trace conf
Zhen Wang
2015/06/02 16:24:41
TraceConfig has the following two constructors
1.
| |
68 } | 68 } |
69 | 69 |
70 void DisableTracing() { TraceLog::GetInstance()->SetDisabled(); } | 70 void DisableTracing() { TraceLog::GetInstance()->SetDisabled(); } |
71 | 71 |
72 scoped_ptr<MemoryDumpManager> mdm_; | 72 scoped_ptr<MemoryDumpManager> mdm_; |
73 | 73 |
74 private: | 74 private: |
75 scoped_ptr<MessageLoop> message_loop_; | 75 scoped_ptr<MessageLoop> message_loop_; |
76 MemoryDumpManagerDelegateForTesting delegate_; | 76 MemoryDumpManagerDelegateForTesting delegate_; |
77 | 77 |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
267 | 267 |
268 EXPECT_CALL(mdp1, OnMemoryDump(_)).Times(0); | 268 EXPECT_CALL(mdp1, OnMemoryDump(_)).Times(0); |
269 EXPECT_CALL(mdp2, OnMemoryDump(_)).Times(1).WillRepeatedly(Return(false)); | 269 EXPECT_CALL(mdp2, OnMemoryDump(_)).Times(1).WillRepeatedly(Return(false)); |
270 mdm_->RequestGlobalDump(MemoryDumpType::EXPLICITLY_TRIGGERED); | 270 mdm_->RequestGlobalDump(MemoryDumpType::EXPLICITLY_TRIGGERED); |
271 | 271 |
272 DisableTracing(); | 272 DisableTracing(); |
273 } | 273 } |
274 | 274 |
275 } // namespace trace_event | 275 } // namespace trace_event |
276 } // namespace base | 276 } // namespace base |
OLD | NEW |