Chromium Code Reviews| 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 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 631 double timestamp, | 631 double timestamp, |
| 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, trace_event_internal::kNoId, | 641 phase, |
| 642 base::PlatformThread::CurrentId(), timestamp_tt, num_args, arg_names, | 642 category_group_enabled, |
| 643 arg_types, arg_values, NULL, flags); | 643 name, |
| 644 id, | |
| 645 base::PlatformThread::CurrentId(), | |
| 646 timestamp_tt, | |
| 647 num_args, | |
|
dsinclair
2015/07/21 18:11:49
Why unwrapped?
| |
| 648 arg_names, | |
| 649 arg_types, | |
| 650 arg_values, | |
| 651 NULL, | |
| 652 flags); | |
| 644 blink::Platform::TraceEventHandle result; | 653 blink::Platform::TraceEventHandle result; |
| 645 memcpy(&result, &handle, sizeof(result)); | 654 memcpy(&result, &handle, sizeof(result)); |
| 646 return result; | 655 return result; |
| 647 } | 656 } |
| 648 | 657 |
| 649 blink::Platform::TraceEventHandle BlinkPlatformImpl::addTraceEvent( | 658 blink::Platform::TraceEventHandle BlinkPlatformImpl::addTraceEvent( |
| 650 char phase, | 659 char phase, |
| 651 const unsigned char* category_group_enabled, | 660 const unsigned char* category_group_enabled, |
| 652 const char* name, | 661 const char* name, |
| 653 unsigned long long id, | 662 unsigned long long id, |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 667 if (arg_types[i] == TRACE_VALUE_TYPE_CONVERTABLE) { | 676 if (arg_types[i] == TRACE_VALUE_TYPE_CONVERTABLE) { |
| 668 convertable_wrappers[i] = | 677 convertable_wrappers[i] = |
| 669 new ConvertableToTraceFormatWrapper(convertable_values[i]); | 678 new ConvertableToTraceFormatWrapper(convertable_values[i]); |
| 670 } | 679 } |
| 671 } | 680 } |
| 672 } | 681 } |
| 673 base::TraceTicks timestamp_tt = | 682 base::TraceTicks timestamp_tt = |
| 674 base::TraceTicks() + base::TimeDelta::FromSecondsD(timestamp); | 683 base::TraceTicks() + base::TimeDelta::FromSecondsD(timestamp); |
| 675 base::trace_event::TraceEventHandle handle = | 684 base::trace_event::TraceEventHandle handle = |
| 676 TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_THREAD_ID_AND_TIMESTAMP( | 685 TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_THREAD_ID_AND_TIMESTAMP( |
| 677 phase, category_group_enabled, name, id, trace_event_internal::kNoId, | 686 phase, |
| 678 base::PlatformThread::CurrentId(), timestamp_tt, num_args, arg_names, | 687 category_group_enabled, |
| 679 arg_types, arg_values, convertable_wrappers, flags); | 688 name, |
| 689 id, | |
| 690 base::PlatformThread::CurrentId(), | |
| 691 timestamp_tt, | |
| 692 num_args, | |
| 693 arg_names, | |
|
dsinclair
2015/07/21 18:11:49
ditto
| |
| 694 arg_types, | |
| 695 arg_values, | |
| 696 convertable_wrappers, | |
| 697 flags); | |
| 680 blink::Platform::TraceEventHandle result; | 698 blink::Platform::TraceEventHandle result; |
| 681 memcpy(&result, &handle, sizeof(result)); | 699 memcpy(&result, &handle, sizeof(result)); |
| 682 return result; | 700 return result; |
| 683 } | 701 } |
| 684 | 702 |
| 685 void BlinkPlatformImpl::updateTraceEventDuration( | 703 void BlinkPlatformImpl::updateTraceEventDuration( |
| 686 const unsigned char* category_group_enabled, | 704 const unsigned char* category_group_enabled, |
| 687 const char* name, | 705 const char* name, |
| 688 TraceEventHandle handle) { | 706 TraceEventHandle handle) { |
| 689 base::trace_event::TraceEventHandle traceEventHandle; | 707 base::trace_event::TraceEventHandle traceEventHandle; |
| (...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1371 return WebString::fromUTF8(ui::KeycodeConverter::DomCodeToCodeString( | 1389 return WebString::fromUTF8(ui::KeycodeConverter::DomCodeToCodeString( |
| 1372 static_cast<ui::DomCode>(dom_code))); | 1390 static_cast<ui::DomCode>(dom_code))); |
| 1373 } | 1391 } |
| 1374 | 1392 |
| 1375 int BlinkPlatformImpl::domEnumFromCodeString(const WebString& code) { | 1393 int BlinkPlatformImpl::domEnumFromCodeString(const WebString& code) { |
| 1376 return static_cast<int>(ui::KeycodeConverter::CodeStringToDomCode( | 1394 return static_cast<int>(ui::KeycodeConverter::CodeStringToDomCode( |
| 1377 code.utf8().data())); | 1395 code.utf8().data())); |
| 1378 } | 1396 } |
| 1379 | 1397 |
| 1380 } // namespace content | 1398 } // namespace content |
| OLD | NEW |