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

Side by Side Diff: content/browser/tracing/tracing_controller_browsertest.cc

Issue 2152603002: Tracing: do not pass entire trace content in TraceDataEndpoint::ReceiveTraceFinalContents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments addressed Created 4 years, 5 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
« no previous file with comments | « no previous file | content/browser/tracing/tracing_controller_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 base::Callback<void(std::unique_ptr<const base::DictionaryValue>, 64 base::Callback<void(std::unique_ptr<const base::DictionaryValue>,
65 base::RefCountedString*)> done_callback) 65 base::RefCountedString*)> done_callback)
66 : done_callback_(done_callback) {} 66 : done_callback_(done_callback) {}
67 67
68 void ReceiveTraceChunk(const std::string& chunk) override { 68 void ReceiveTraceChunk(const std::string& chunk) override {
69 EXPECT_FALSE(chunk.empty()); 69 EXPECT_FALSE(chunk.empty());
70 trace_ += chunk; 70 trace_ += chunk;
71 } 71 }
72 72
73 void ReceiveTraceFinalContents( 73 void ReceiveTraceFinalContents(
74 std::unique_ptr<const base::DictionaryValue> metadata, 74 std::unique_ptr<const base::DictionaryValue> metadata) override {
75 const std::string& contents) override {
76 EXPECT_EQ(trace_, contents);
77
78 std::string tmp = contents;
79 scoped_refptr<base::RefCountedString> chunk_ptr = 75 scoped_refptr<base::RefCountedString> chunk_ptr =
80 base::RefCountedString::TakeString(&tmp); 76 base::RefCountedString::TakeString(&trace_);
81 77
82 BrowserThread::PostTask( 78 BrowserThread::PostTask(
83 BrowserThread::UI, FROM_HERE, 79 BrowserThread::UI, FROM_HERE,
84 base::Bind(done_callback_, base::Passed(std::move(metadata)), 80 base::Bind(done_callback_, base::Passed(std::move(metadata)),
85 base::RetainedRef(chunk_ptr))); 81 base::RetainedRef(chunk_ptr)));
86 } 82 }
87 83
88 protected: 84 protected:
89 ~TracingControllerTestEndpoint() override {} 85 ~TracingControllerTestEndpoint() override {}
90 86
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 435
440 TracingController* controller = TracingController::GetInstance(); 436 TracingController* controller = TracingController::GetInstance();
441 EXPECT_TRUE(controller->StartTracing( 437 EXPECT_TRUE(controller->StartTracing(
442 TraceConfig(), 438 TraceConfig(),
443 TracingController::StartTracingDoneCallback())); 439 TracingController::StartTracingDoneCallback()));
444 EXPECT_TRUE(controller->StopTracing(NULL)); 440 EXPECT_TRUE(controller->StopTracing(NULL));
445 base::RunLoop().RunUntilIdle(); 441 base::RunLoop().RunUntilIdle();
446 } 442 }
447 443
448 } // namespace content 444 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/tracing/tracing_controller_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698