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

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

Issue 9443020: Use SequencedWorkerPool for disk operations in TraceSubscriberStdio. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 10 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 | « base/debug/trace_event_impl.h ('k') | base/debug/trace_event_unittest.cc » ('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 (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/bind.h" 9 #include "base/bind.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 return; 557 return;
558 558
559 for (size_t i = 0; 559 for (size_t i = 0;
560 i < previous_logged_events.size(); 560 i < previous_logged_events.size();
561 i += kTraceEventBatchSize) { 561 i += kTraceEventBatchSize) {
562 scoped_refptr<RefCountedString> json_events_str_ptr = 562 scoped_refptr<RefCountedString> json_events_str_ptr =
563 new RefCountedString(); 563 new RefCountedString();
564 TraceEvent::AppendEventsAsJSON(previous_logged_events, 564 TraceEvent::AppendEventsAsJSON(previous_logged_events,
565 i, 565 i,
566 kTraceEventBatchSize, 566 kTraceEventBatchSize,
567 &(json_events_str_ptr->data)); 567 &(json_events_str_ptr->data()));
568 output_callback_copy.Run(json_events_str_ptr); 568 output_callback_copy.Run(json_events_str_ptr);
569 } 569 }
570 } 570 }
571 571
572 int TraceLog::AddTraceEvent(char phase, 572 int TraceLog::AddTraceEvent(char phase,
573 const unsigned char* category_enabled, 573 const unsigned char* category_enabled,
574 const char* name, 574 const char* name,
575 unsigned long long id, 575 unsigned long long id,
576 int num_args, 576 int num_args,
577 const char** arg_names, 577 const char** arg_names,
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
756 // Create a FNV hash from the process ID for XORing. 756 // Create a FNV hash from the process ID for XORing.
757 // See http://isthe.com/chongo/tech/comp/fnv/ for algorithm details. 757 // See http://isthe.com/chongo/tech/comp/fnv/ for algorithm details.
758 unsigned long long offset_basis = 14695981039346656037ull; 758 unsigned long long offset_basis = 14695981039346656037ull;
759 unsigned long long fnv_prime = 1099511628211ull; 759 unsigned long long fnv_prime = 1099511628211ull;
760 unsigned long long pid = static_cast<unsigned long long>(process_id_); 760 unsigned long long pid = static_cast<unsigned long long>(process_id_);
761 process_id_hash_ = (offset_basis ^ pid) * fnv_prime; 761 process_id_hash_ = (offset_basis ^ pid) * fnv_prime;
762 } 762 }
763 763
764 } // namespace debug 764 } // namespace debug
765 } // namespace base 765 } // namespace base
OLDNEW
« no previous file with comments | « base/debug/trace_event_impl.h ('k') | base/debug/trace_event_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698