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

Side by Side Diff: components/tracing/core/scattered_stream_writer.cc

Issue 2196663002: tracing v2: Introduce TraceBufferWriter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@proto_refactor
Patch Set: Add TRACING_EXPORT also to nested class Created 4 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "components/tracing/core/scattered_stream_writer.h" 5 #include "components/tracing/core/scattered_stream_writer.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
11 #include "base/logging.h" 11 #include "base/logging.h"
12 12
13 namespace tracing { 13 namespace tracing {
14 namespace v2 { 14 namespace v2 {
15 15
16 ScatteredStreamWriter::Delegate::~Delegate() {}
17
16 ScatteredStreamWriter::ScatteredStreamWriter(Delegate* delegate) 18 ScatteredStreamWriter::ScatteredStreamWriter(Delegate* delegate)
17 : delegate_(delegate), 19 : delegate_(delegate),
18 cur_range_({nullptr, nullptr}), 20 cur_range_({nullptr, nullptr}),
19 write_ptr_(nullptr) {} 21 write_ptr_(nullptr) {}
20 22
21 ScatteredStreamWriter::~ScatteredStreamWriter() {} 23 ScatteredStreamWriter::~ScatteredStreamWriter() {}
22 24
23 void ScatteredStreamWriter::Reset(ContiguousMemoryRange range) { 25 void ScatteredStreamWriter::Reset(ContiguousMemoryRange range) {
24 cur_range_ = range; 26 cur_range_ = range;
25 write_ptr_ = range.begin; 27 write_ptr_ = range.begin;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 uint8_t* begin = write_ptr_; 72 uint8_t* begin = write_ptr_;
71 write_ptr_ += size; 73 write_ptr_ += size;
72 #ifndef NDEBUG 74 #ifndef NDEBUG
73 memset(begin, '\xFF', size); 75 memset(begin, '\xFF', size);
74 #endif 76 #endif
75 return {begin, begin + size}; 77 return {begin, begin + size};
76 } 78 }
77 79
78 } // namespace v2 80 } // namespace v2
79 } // namespace tracing 81 } // namespace tracing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698