OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project 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 "src/libplatform/default-platform.h" | 5 #include "src/libplatform/default-platform.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <queue> | 8 #include <queue> |
9 | 9 |
10 #include "src/base/logging.h" | 10 #include "src/base/logging.h" |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 | 171 |
172 | 172 |
173 bool DefaultPlatform::IdleTasksEnabled(Isolate* isolate) { return false; } | 173 bool DefaultPlatform::IdleTasksEnabled(Isolate* isolate) { return false; } |
174 | 174 |
175 | 175 |
176 double DefaultPlatform::MonotonicallyIncreasingTime() { | 176 double DefaultPlatform::MonotonicallyIncreasingTime() { |
177 return base::TimeTicks::HighResolutionNow().ToInternalValue() / | 177 return base::TimeTicks::HighResolutionNow().ToInternalValue() / |
178 static_cast<double>(base::Time::kMicrosecondsPerSecond); | 178 static_cast<double>(base::Time::kMicrosecondsPerSecond); |
179 } | 179 } |
180 | 180 |
| 181 |
181 uint64_t DefaultPlatform::AddTraceEvent( | 182 uint64_t DefaultPlatform::AddTraceEvent( |
182 char phase, const uint8_t* category_enabled_flag, const char* name, | 183 char phase, const uint8_t* category_enabled_flag, const char* name, |
183 const char* scope, uint64_t id, uint64_t bind_id, int num_args, | 184 const char* scope, uint64_t id, uint64_t bind_id, int num_args, |
184 const char** arg_names, const uint8_t* arg_types, | 185 const char** arg_names, const uint8_t* arg_types, |
185 const uint64_t* arg_values, | 186 const uint64_t* arg_values, unsigned int flags) { |
186 std::unique_ptr<v8::ConvertableToTraceFormat>* arg_convertables, | |
187 unsigned int flags) { | |
188 if (tracing_controller_) { | 187 if (tracing_controller_) { |
189 return tracing_controller_->AddTraceEvent( | 188 return tracing_controller_->AddTraceEvent( |
190 phase, category_enabled_flag, name, scope, id, bind_id, num_args, | 189 phase, category_enabled_flag, name, scope, id, bind_id, num_args, |
191 arg_names, arg_types, arg_values, arg_convertables, flags); | 190 arg_names, arg_types, arg_values, flags); |
192 } | 191 } |
193 | 192 |
194 return 0; | 193 return 0; |
195 } | 194 } |
196 | 195 |
197 void DefaultPlatform::UpdateTraceEventDuration( | 196 void DefaultPlatform::UpdateTraceEventDuration( |
198 const uint8_t* category_enabled_flag, const char* name, uint64_t handle) { | 197 const uint8_t* category_enabled_flag, const char* name, uint64_t handle) { |
199 if (tracing_controller_) { | 198 if (tracing_controller_) { |
200 tracing_controller_->UpdateTraceEventDuration(category_enabled_flag, name, | 199 tracing_controller_->UpdateTraceEventDuration(category_enabled_flag, name, |
201 handle); | 200 handle); |
(...skipping 19 matching lines...) Expand all Loading... |
221 tracing::TracingController* tracing_controller) { | 220 tracing::TracingController* tracing_controller) { |
222 tracing_controller_ = tracing_controller; | 221 tracing_controller_ = tracing_controller; |
223 } | 222 } |
224 | 223 |
225 size_t DefaultPlatform::NumberOfAvailableBackgroundThreads() { | 224 size_t DefaultPlatform::NumberOfAvailableBackgroundThreads() { |
226 return static_cast<size_t>(thread_pool_size_); | 225 return static_cast<size_t>(thread_pool_size_); |
227 } | 226 } |
228 | 227 |
229 } // namespace platform | 228 } // namespace platform |
230 } // namespace v8 | 229 } // namespace v8 |
OLD | NEW |