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

Side by Side Diff: webkit/glue/webkitplatformsupport_impl.cc

Issue 11366109: Adding raw tracing to trace framework. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changing AddTraceEvent API to always accept a tid and timestamp. Created 8 years 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 | Annotate | Revision Log
« base/debug/trace_event.h ('K') | « base/debug/trace_event_unittest.cc ('k') | no next file » | 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 "webkit/glue/webkitplatformsupport_impl.h" 5 #include "webkit/glue/webkitplatformsupport_impl.h"
6 6
7 #if defined(OS_LINUX) 7 #if defined(OS_LINUX)
8 #include <malloc.h> 8 #include <malloc.h>
9 #endif 9 #endif
10 10
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 const unsigned char* category_enabled, 375 const unsigned char* category_enabled,
376 const char* name, 376 const char* name,
377 unsigned long long id, 377 unsigned long long id,
378 int num_args, 378 int num_args,
379 const char** arg_names, 379 const char** arg_names,
380 const unsigned char* arg_types, 380 const unsigned char* arg_types,
381 const unsigned long long* arg_values, 381 const unsigned long long* arg_values,
382 int threshold_begin_id, 382 int threshold_begin_id,
383 long long threshold, 383 long long threshold,
384 unsigned char flags) { 384 unsigned char flags) {
385 int thread_id = static_cast<int>(base::PlatformThread::CurrentId());
386 base::TimeTicks now = base::TimeTicks::NowFromSystemTraceTime() -
387 base::debug::TraceLog::GetInstance()->GetTimeOffset();
385 TRACE_EVENT_API_ADD_TRACE_EVENT(phase, category_enabled, name, id, 388 TRACE_EVENT_API_ADD_TRACE_EVENT(phase, category_enabled, name, id,
389 thread_id, now.ToInternalValue(),
386 num_args, arg_names, arg_types, 390 num_args, arg_names, arg_types,
387 arg_values, flags); 391 arg_values, flags);
388 return -1; 392 return -1;
389 } 393 }
390 394
391 void WebKitPlatformSupportImpl::addTraceEvent( 395 void WebKitPlatformSupportImpl::addTraceEvent(
392 char phase, 396 char phase,
393 const unsigned char* category_enabled, 397 const unsigned char* category_enabled,
394 const char* name, 398 const char* name,
395 unsigned long long id, 399 unsigned long long id,
396 int num_args, 400 int num_args,
397 const char** arg_names, 401 const char** arg_names,
398 const unsigned char* arg_types, 402 const unsigned char* arg_types,
399 const unsigned long long* arg_values, 403 const unsigned long long* arg_values,
400 unsigned char flags) { 404 unsigned char flags) {
405 int thread_id = static_cast<int>(base::PlatformThread::CurrentId());
406 base::TimeTicks now = base::TimeTicks::NowFromSystemTraceTime() -
407 base::debug::TraceLog::GetInstance()->GetTimeOffset();
401 TRACE_EVENT_API_ADD_TRACE_EVENT(phase, category_enabled, name, id, 408 TRACE_EVENT_API_ADD_TRACE_EVENT(phase, category_enabled, name, id,
409 thread_id, now.ToInternalValue(),
402 num_args, arg_names, arg_types, 410 num_args, arg_names, arg_types,
403 arg_values, flags); 411 arg_values, flags);
404 } 412 }
405 413
406 414
407 namespace { 415 namespace {
408 416
409 WebData loadAudioSpatializationResource(WebKitPlatformSupportImpl* platform, 417 WebData loadAudioSpatializationResource(WebKitPlatformSupportImpl* platform,
410 const char* name) { 418 const char* name) {
411 #ifdef IDR_AUDIO_SPATIALIZATION_T000_P000 419 #ifdef IDR_AUDIO_SPATIALIZATION_T000_P000
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
894 #endif 902 #endif
895 903
896 if (device_source == WebKit::WebGestureEvent::Touchscreen) 904 if (device_source == WebKit::WebGestureEvent::Touchscreen)
897 return TouchFlingGestureCurve::CreateForTouchScreen(velocity, 905 return TouchFlingGestureCurve::CreateForTouchScreen(velocity,
898 cumulative_scroll); 906 cumulative_scroll);
899 907
900 return TouchFlingGestureCurve::CreateForTouchPad(velocity, cumulative_scroll); 908 return TouchFlingGestureCurve::CreateForTouchPad(velocity, cumulative_scroll);
901 } 909 }
902 910
903 } // namespace webkit_glue 911 } // namespace webkit_glue
OLDNEW
« base/debug/trace_event.h ('K') | « base/debug/trace_event_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698