| OLD | NEW |
| 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 | 140 |
| 141 TraceEvent::TraceEvent() | 141 TraceEvent::TraceEvent() |
| 142 : id_(0u), | 142 : id_(0u), |
| 143 category_enabled_(NULL), | 143 category_enabled_(NULL), |
| 144 name_(NULL), | 144 name_(NULL), |
| 145 thread_id_(0), | 145 thread_id_(0), |
| 146 phase_(TRACE_EVENT_PHASE_BEGIN), | 146 phase_(TRACE_EVENT_PHASE_BEGIN), |
| 147 flags_(0) { | 147 flags_(0) { |
| 148 arg_names_[0] = NULL; | 148 arg_names_[0] = NULL; |
| 149 arg_names_[1] = NULL; | 149 arg_names_[1] = NULL; |
| 150 memset(arg_values_, 0, sizeof(arg_values_)); |
| 150 } | 151 } |
| 151 | 152 |
| 152 TraceEvent::TraceEvent(int thread_id, | 153 TraceEvent::TraceEvent(int thread_id, |
| 153 TimeTicks timestamp, | 154 TimeTicks timestamp, |
| 154 char phase, | 155 char phase, |
| 155 const unsigned char* category_enabled, | 156 const unsigned char* category_enabled, |
| 156 const char* name, | 157 const char* name, |
| 157 unsigned long long id, | 158 unsigned long long id, |
| 158 int num_args, | 159 int num_args, |
| 159 const char** arg_names, | 160 const char** arg_names, |
| (...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 714 // Create a FNV hash from the process ID for XORing. | 715 // Create a FNV hash from the process ID for XORing. |
| 715 // See http://isthe.com/chongo/tech/comp/fnv/ for algorithm details. | 716 // See http://isthe.com/chongo/tech/comp/fnv/ for algorithm details. |
| 716 unsigned long long offset_basis = 14695981039346656037ull; | 717 unsigned long long offset_basis = 14695981039346656037ull; |
| 717 unsigned long long fnv_prime = 1099511628211ull; | 718 unsigned long long fnv_prime = 1099511628211ull; |
| 718 unsigned long long pid = static_cast<unsigned long long>(process_id_); | 719 unsigned long long pid = static_cast<unsigned long long>(process_id_); |
| 719 process_id_hash_ = (offset_basis ^ pid) * fnv_prime; | 720 process_id_hash_ = (offset_basis ^ pid) * fnv_prime; |
| 720 } | 721 } |
| 721 | 722 |
| 722 } // namespace debug | 723 } // namespace debug |
| 723 } // namespace base | 724 } // namespace base |
| OLD | NEW |