OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/public/browser/tracing_controller.h" | 5 #include "content/public/browser/tracing_controller.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 const std::string& contents) override { | 73 const std::string& contents) override { |
74 EXPECT_EQ(trace_, contents); | 74 EXPECT_EQ(trace_, contents); |
75 | 75 |
76 std::string tmp = contents; | 76 std::string tmp = contents; |
77 scoped_refptr<base::RefCountedString> chunk_ptr = | 77 scoped_refptr<base::RefCountedString> chunk_ptr = |
78 base::RefCountedString::TakeString(&tmp); | 78 base::RefCountedString::TakeString(&tmp); |
79 | 79 |
80 BrowserThread::PostTask( | 80 BrowserThread::PostTask( |
81 BrowserThread::UI, FROM_HERE, | 81 BrowserThread::UI, FROM_HERE, |
82 base::Bind(done_callback_, base::Passed(std::move(metadata)), | 82 base::Bind(done_callback_, base::Passed(std::move(metadata)), |
83 chunk_ptr)); | 83 base::RetainedRef(chunk_ptr))); |
84 } | 84 } |
85 | 85 |
86 protected: | 86 protected: |
87 ~TracingControllerTestEndpoint() override {} | 87 ~TracingControllerTestEndpoint() override {} |
88 | 88 |
89 std::string trace_; | 89 std::string trace_; |
90 base::Callback<void(scoped_ptr<const base::DictionaryValue>, | 90 base::Callback<void(scoped_ptr<const base::DictionaryValue>, |
91 base::RefCountedString*)> done_callback_; | 91 base::RefCountedString*)> done_callback_; |
92 }; | 92 }; |
93 | 93 |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 | 454 |
455 TracingController* controller = TracingController::GetInstance(); | 455 TracingController* controller = TracingController::GetInstance(); |
456 EXPECT_TRUE(controller->StartTracing( | 456 EXPECT_TRUE(controller->StartTracing( |
457 TraceConfig(), | 457 TraceConfig(), |
458 TracingController::StartTracingDoneCallback())); | 458 TracingController::StartTracingDoneCallback())); |
459 EXPECT_TRUE(controller->StopTracing(NULL)); | 459 EXPECT_TRUE(controller->StopTracing(NULL)); |
460 base::RunLoop().RunUntilIdle(); | 460 base::RunLoop().RunUntilIdle(); |
461 } | 461 } |
462 | 462 |
463 } // namespace content | 463 } // namespace content |
OLD | NEW |