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

Side by Side Diff: base/debug/trace_event_impl.cc

Issue 655003004: Use scoped_ptr::Pass instead of scoped_ptr::PassAs<T>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 | base/memory/discardable_memory_android.cc » ('j') | base/metrics/histogram.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/debug/trace_event_impl.h" 5 #include "base/debug/trace_event_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/base_switches.h" 9 #include "base/base_switches.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 virtual scoped_ptr<TraceBuffer> CloneForIteration() const override { 215 virtual scoped_ptr<TraceBuffer> CloneForIteration() const override {
216 scoped_ptr<ClonedTraceBuffer> cloned_buffer(new ClonedTraceBuffer()); 216 scoped_ptr<ClonedTraceBuffer> cloned_buffer(new ClonedTraceBuffer());
217 for (size_t queue_index = queue_head_; queue_index != queue_tail_; 217 for (size_t queue_index = queue_head_; queue_index != queue_tail_;
218 queue_index = NextQueueIndex(queue_index)) { 218 queue_index = NextQueueIndex(queue_index)) {
219 size_t chunk_index = recyclable_chunks_queue_[queue_index]; 219 size_t chunk_index = recyclable_chunks_queue_[queue_index];
220 if (chunk_index >= chunks_.size()) // Skip uninitialized chunks. 220 if (chunk_index >= chunks_.size()) // Skip uninitialized chunks.
221 continue; 221 continue;
222 TraceBufferChunk* chunk = chunks_[chunk_index]; 222 TraceBufferChunk* chunk = chunks_[chunk_index];
223 cloned_buffer->chunks_.push_back(chunk ? chunk->Clone().release() : NULL); 223 cloned_buffer->chunks_.push_back(chunk ? chunk->Clone().release() : NULL);
224 } 224 }
225 return cloned_buffer.PassAs<TraceBuffer>(); 225 return cloned_buffer.Pass();
226 } 226 }
227 227
228 private: 228 private:
229 class ClonedTraceBuffer : public TraceBuffer { 229 class ClonedTraceBuffer : public TraceBuffer {
230 public: 230 public:
231 ClonedTraceBuffer() : current_iteration_index_(0) {} 231 ClonedTraceBuffer() : current_iteration_index_(0) {}
232 232
233 // The only implemented method. 233 // The only implemented method.
234 virtual const TraceBufferChunk* NextChunk() override { 234 virtual const TraceBufferChunk* NextChunk() override {
235 return current_iteration_index_ < chunks_.size() ? 235 return current_iteration_index_ < chunks_.size() ?
(...skipping 2335 matching lines...) Expand 10 before | Expand all | Expand 10 after
2571 } 2571 }
2572 2572
2573 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() { 2573 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() {
2574 if (*category_group_enabled_) { 2574 if (*category_group_enabled_) {
2575 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, 2575 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_,
2576 name_, event_handle_); 2576 name_, event_handle_);
2577 } 2577 }
2578 } 2578 }
2579 2579
2580 } // namespace trace_event_internal 2580 } // namespace trace_event_internal
OLDNEW
« no previous file with comments | « no previous file | base/memory/discardable_memory_android.cc » ('j') | base/metrics/histogram.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698