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

Side by Side Diff: base/trace_event/memory_dump_manager_unittest.cc

Issue 1306753005: [tracing] Add memory dump config to TraceConfig (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits. Created 5 years, 4 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
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 "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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 63
64 void DumpCallbackAdapter(scoped_refptr<SingleThreadTaskRunner> task_runner, 64 void DumpCallbackAdapter(scoped_refptr<SingleThreadTaskRunner> task_runner,
65 Closure closure, 65 Closure closure,
66 uint64 dump_guid, 66 uint64 dump_guid,
67 bool success) { 67 bool success) {
68 last_callback_success_ = success; 68 last_callback_success_ = success;
69 task_runner->PostTask(FROM_HERE, closure); 69 task_runner->PostTask(FROM_HERE, closure);
70 } 70 }
71 71
72 protected: 72 protected:
73 const char* kTraceCategory = MemoryDumpManager::kTraceCategoryForTesting; 73 const char* kTraceCategory = MemoryDumpManager::kTraceCategory;
Primiano Tucci (use gerrit) 2015/08/24 11:58:35 At this point this level of indirection is not nee
ssid 2015/08/24 15:29:30 Done.
74 74
75 void EnableTracing(const char* category) { 75 void EnableTracing(const char* category) {
76 TraceLog::GetInstance()->SetEnabled( 76 TraceLog::GetInstance()->SetEnabled(
77 TraceConfig(category, ""), TraceLog::RECORDING_MODE); 77 TraceConfig(category, ""), TraceLog::RECORDING_MODE);
78 } 78 }
79 79
80 void DisableTracing() { TraceLog::GetInstance()->SetDisabled(); } 80 void DisableTracing() { TraceLog::GetInstance()->SetDisabled(); }
81 81
82 scoped_ptr<MemoryDumpManager> mdm_; 82 scoped_ptr<MemoryDumpManager> mdm_;
83 bool last_callback_success_; 83 bool last_callback_success_;
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 MessageLoop::current()->task_runner(), run_loop.QuitClosure()); 449 MessageLoop::current()->task_runner(), run_loop.QuitClosure());
450 mdm_->RequestGlobalDump(MemoryDumpType::EXPLICITLY_TRIGGERED, 450 mdm_->RequestGlobalDump(MemoryDumpType::EXPLICITLY_TRIGGERED,
451 high_detail_args, callback); 451 high_detail_args, callback);
452 run_loop.Run(); 452 run_loop.Run();
453 } 453 }
454 EXPECT_FALSE(last_callback_success_); 454 EXPECT_FALSE(last_callback_success_);
455 } 455 }
456 456
457 } // namespace trace_event 457 } // namespace trace_event
458 } // namespace base 458 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698