OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/child/blink_platform_impl.h" | 5 #include "content/child/blink_platform_impl.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
632 int num_args, | 632 int num_args, |
633 const char** arg_names, | 633 const char** arg_names, |
634 const unsigned char* arg_types, | 634 const unsigned char* arg_types, |
635 const unsigned long long* arg_values, | 635 const unsigned long long* arg_values, |
636 unsigned char flags) { | 636 unsigned char flags) { |
637 base::TraceTicks timestamp_tt = | 637 base::TraceTicks timestamp_tt = |
638 base::TraceTicks() + base::TimeDelta::FromSecondsD(timestamp); | 638 base::TraceTicks() + base::TimeDelta::FromSecondsD(timestamp); |
639 base::trace_event::TraceEventHandle handle = | 639 base::trace_event::TraceEventHandle handle = |
640 TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_THREAD_ID_AND_TIMESTAMP( | 640 TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_THREAD_ID_AND_TIMESTAMP( |
641 phase, category_group_enabled, name, id, | 641 phase, category_group_enabled, name, id, |
642 base::PlatformThread::CurrentId(), | 642 base::PlatformThread::CurrentId(), timestamp_tt, num_args, arg_names, |
643 timestamp_tt, | 643 arg_types, arg_values, NULL, flags, 0); |
dsinclair
2015/07/17 13:39:41
kNoId
| |
644 num_args, arg_names, arg_types, arg_values, NULL, flags); | |
645 blink::Platform::TraceEventHandle result; | 644 blink::Platform::TraceEventHandle result; |
646 memcpy(&result, &handle, sizeof(result)); | 645 memcpy(&result, &handle, sizeof(result)); |
647 return result; | 646 return result; |
648 } | 647 } |
649 | 648 |
650 blink::Platform::TraceEventHandle BlinkPlatformImpl::addTraceEvent( | 649 blink::Platform::TraceEventHandle BlinkPlatformImpl::addTraceEvent( |
651 char phase, | 650 char phase, |
652 const unsigned char* category_group_enabled, | 651 const unsigned char* category_group_enabled, |
653 const char* name, | 652 const char* name, |
654 unsigned long long id, | 653 unsigned long long id, |
(...skipping 12 matching lines...) Expand all Loading... | |
667 for (size_t i = 0; i < size; ++i) { | 666 for (size_t i = 0; i < size; ++i) { |
668 if (arg_types[i] == TRACE_VALUE_TYPE_CONVERTABLE) { | 667 if (arg_types[i] == TRACE_VALUE_TYPE_CONVERTABLE) { |
669 convertable_wrappers[i] = | 668 convertable_wrappers[i] = |
670 new ConvertableToTraceFormatWrapper(convertable_values[i]); | 669 new ConvertableToTraceFormatWrapper(convertable_values[i]); |
671 } | 670 } |
672 } | 671 } |
673 } | 672 } |
674 base::TraceTicks timestamp_tt = | 673 base::TraceTicks timestamp_tt = |
675 base::TraceTicks() + base::TimeDelta::FromSecondsD(timestamp); | 674 base::TraceTicks() + base::TimeDelta::FromSecondsD(timestamp); |
676 base::trace_event::TraceEventHandle handle = | 675 base::trace_event::TraceEventHandle handle = |
677 TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_THREAD_ID_AND_TIMESTAMP(phase, | 676 TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_THREAD_ID_AND_TIMESTAMP( |
678 category_group_enabled, | 677 phase, category_group_enabled, name, id, |
679 name, | 678 base::PlatformThread::CurrentId(), timestamp_tt, num_args, arg_names, |
680 id, | 679 arg_types, arg_values, convertable_wrappers, flags, 0); |
dsinclair
2015/07/17 13:39:41
kNoId
| |
681 base::PlatformThread::CurrentId(), | |
682 timestamp_tt, | |
683 num_args, | |
684 arg_names, | |
685 arg_types, | |
686 arg_values, | |
687 convertable_wrappers, | |
688 flags); | |
689 blink::Platform::TraceEventHandle result; | 680 blink::Platform::TraceEventHandle result; |
690 memcpy(&result, &handle, sizeof(result)); | 681 memcpy(&result, &handle, sizeof(result)); |
691 return result; | 682 return result; |
692 } | 683 } |
693 | 684 |
694 void BlinkPlatformImpl::updateTraceEventDuration( | 685 void BlinkPlatformImpl::updateTraceEventDuration( |
695 const unsigned char* category_group_enabled, | 686 const unsigned char* category_group_enabled, |
696 const char* name, | 687 const char* name, |
697 TraceEventHandle handle) { | 688 TraceEventHandle handle) { |
698 base::trace_event::TraceEventHandle traceEventHandle; | 689 base::trace_event::TraceEventHandle traceEventHandle; |
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1380 return WebString::fromUTF8(ui::KeycodeConverter::DomCodeToCodeString( | 1371 return WebString::fromUTF8(ui::KeycodeConverter::DomCodeToCodeString( |
1381 static_cast<ui::DomCode>(dom_code))); | 1372 static_cast<ui::DomCode>(dom_code))); |
1382 } | 1373 } |
1383 | 1374 |
1384 int BlinkPlatformImpl::domEnumFromCodeString(const WebString& code) { | 1375 int BlinkPlatformImpl::domEnumFromCodeString(const WebString& code) { |
1385 return static_cast<int>(ui::KeycodeConverter::CodeStringToDomCode( | 1376 return static_cast<int>(ui::KeycodeConverter::CodeStringToDomCode( |
1386 code.utf8().data())); | 1377 code.utf8().data())); |
1387 } | 1378 } |
1388 | 1379 |
1389 } // namespace content | 1380 } // namespace content |
OLD | NEW |