| 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 | 52 |
| 53 // Used as callback argument for MemoryDumpManager::RequestGlobalDump(): | 53 // Used as callback argument for MemoryDumpManager::RequestGlobalDump(): |
| 54 void OnGlobalMemoryDumpDone( | 54 void OnGlobalMemoryDumpDone( |
| 55 scoped_refptr<base::SingleThreadTaskRunner> task_runner, | 55 scoped_refptr<base::SingleThreadTaskRunner> task_runner, |
| 56 base::Closure closure, | 56 base::Closure closure, |
| 57 uint32_t request_index, | 57 uint32_t request_index, |
| 58 uint64_t dump_guid, | 58 uint64_t dump_guid, |
| 59 bool success) { | 59 bool success) { |
| 60 // Make sure we run the RunLoop closure on the same thread that originated | 60 // Make sure we run the RunLoop closure on the same thread that originated |
| 61 // the run loop (which is the IN_PROC_BROWSER_TEST_F main thread). | 61 // the run loop (which is the IN_PROC_BROWSER_TEST_F main thread). |
| 62 if (!task_runner->RunsTasksOnCurrentThread()) { | 62 if (!task_runner->RunsTasksInCurrentSequence()) { |
| 63 task_runner->PostTask( | 63 task_runner->PostTask( |
| 64 FROM_HERE, base::Bind(&MemoryTracingTest::OnGlobalMemoryDumpDone, | 64 FROM_HERE, base::Bind(&MemoryTracingTest::OnGlobalMemoryDumpDone, |
| 65 base::Unretained(this), task_runner, closure, | 65 base::Unretained(this), task_runner, closure, |
| 66 request_index, dump_guid, success)); | 66 request_index, dump_guid, success)); |
| 67 return; | 67 return; |
| 68 } | 68 } |
| 69 if (success) | 69 if (success) |
| 70 EXPECT_NE(0u, dump_guid); | 70 EXPECT_NE(0u, dump_guid); |
| 71 OnMemoryDumpDone(request_index, success); | 71 OnMemoryDumpDone(request_index, success); |
| 72 if (!closure.is_null()) | 72 if (!closure.is_null()) |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 EXPECT_CALL(*this, OnMemoryDumpDone(_, true /* success */)); | 318 EXPECT_CALL(*this, OnMemoryDumpDone(_, true /* success */)); |
| 319 | 319 |
| 320 EnableMemoryTracing(); | 320 EnableMemoryTracing(); |
| 321 RequestGlobalDumpAndWait(false /* from_renderer_thread */, | 321 RequestGlobalDumpAndWait(false /* from_renderer_thread */, |
| 322 MemoryDumpType::EXPLICITLY_TRIGGERED, | 322 MemoryDumpType::EXPLICITLY_TRIGGERED, |
| 323 MemoryDumpLevelOfDetail::DETAILED); | 323 MemoryDumpLevelOfDetail::DETAILED); |
| 324 DisableTracing(); | 324 DisableTracing(); |
| 325 } | 325 } |
| 326 | 326 |
| 327 } // namespace content | 327 } // namespace content |
| OLD | NEW |