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 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 628 double timestamp, | 628 double timestamp, |
| 629 int num_args, | 629 int num_args, |
| 630 const char** arg_names, | 630 const char** arg_names, |
| 631 const unsigned char* arg_types, | 631 const unsigned char* arg_types, |
| 632 const unsigned long long* arg_values, | 632 const unsigned long long* arg_values, |
| 633 unsigned char flags) { | 633 unsigned char flags) { |
| 634 base::TraceTicks timestamp_tt = | 634 base::TraceTicks timestamp_tt = |
| 635 base::TraceTicks() + base::TimeDelta::FromSecondsD(timestamp); | 635 base::TraceTicks() + base::TimeDelta::FromSecondsD(timestamp); |
| 636 base::trace_event::TraceEventHandle handle = | 636 base::trace_event::TraceEventHandle handle = |
| 637 TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_THREAD_ID_AND_TIMESTAMP( | 637 TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_THREAD_ID_AND_TIMESTAMP( |
| 638 phase, category_group_enabled, name, id, trace_event_internal::kNoId, | 638 phase, |
| 639 base::PlatformThread::CurrentId(), timestamp_tt, num_args, arg_names, | 639 category_group_enabled, |
| 640 arg_types, arg_values, NULL, flags); | 640 name, |
| 641 id, | |
| 642 trace_event_internal::kNoId, // context_id | |
| 643 base::PlatformThread::CurrentId(), | |
|
beaudoin
2015/07/29 18:55:43
Should you have one for CurrentId()? It is it's un
| |
| 644 timestamp_tt, | |
| 645 num_args, | |
| 646 arg_names, | |
| 647 arg_types, | |
| 648 arg_values, | |
| 649 NULL, | |
| 650 flags); | |
| 641 blink::Platform::TraceEventHandle result; | 651 blink::Platform::TraceEventHandle result; |
| 642 memcpy(&result, &handle, sizeof(result)); | 652 memcpy(&result, &handle, sizeof(result)); |
| 643 return result; | 653 return result; |
| 644 } | 654 } |
| 645 | 655 |
| 646 blink::Platform::TraceEventHandle BlinkPlatformImpl::addTraceEvent( | 656 blink::Platform::TraceEventHandle BlinkPlatformImpl::addTraceEvent( |
| 647 char phase, | 657 char phase, |
| 648 const unsigned char* category_group_enabled, | 658 const unsigned char* category_group_enabled, |
| 649 const char* name, | 659 const char* name, |
| 650 unsigned long long id, | 660 unsigned long long id, |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 664 if (arg_types[i] == TRACE_VALUE_TYPE_CONVERTABLE) { | 674 if (arg_types[i] == TRACE_VALUE_TYPE_CONVERTABLE) { |
| 665 convertable_wrappers[i] = | 675 convertable_wrappers[i] = |
| 666 new ConvertableToTraceFormatWrapper(convertable_values[i]); | 676 new ConvertableToTraceFormatWrapper(convertable_values[i]); |
| 667 } | 677 } |
| 668 } | 678 } |
| 669 } | 679 } |
| 670 base::TraceTicks timestamp_tt = | 680 base::TraceTicks timestamp_tt = |
| 671 base::TraceTicks() + base::TimeDelta::FromSecondsD(timestamp); | 681 base::TraceTicks() + base::TimeDelta::FromSecondsD(timestamp); |
| 672 base::trace_event::TraceEventHandle handle = | 682 base::trace_event::TraceEventHandle handle = |
| 673 TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_THREAD_ID_AND_TIMESTAMP( | 683 TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_THREAD_ID_AND_TIMESTAMP( |
| 674 phase, category_group_enabled, name, id, trace_event_internal::kNoId, | 684 phase, |
| 675 base::PlatformThread::CurrentId(), timestamp_tt, num_args, arg_names, | 685 category_group_enabled, |
| 676 arg_types, arg_values, convertable_wrappers, flags); | 686 name, |
| 687 id, | |
| 688 trace_event_internal::kNoId, // context_id | |
| 689 base::PlatformThread::CurrentId(), | |
|
beaudoin
2015/07/29 18:55:43
Ditto.
| |
| 690 timestamp_tt, | |
| 691 num_args, | |
| 692 arg_names, | |
| 693 arg_types, | |
| 694 arg_values, | |
| 695 convertable_wrappers, | |
| 696 flags); | |
| 677 blink::Platform::TraceEventHandle result; | 697 blink::Platform::TraceEventHandle result; |
| 678 memcpy(&result, &handle, sizeof(result)); | 698 memcpy(&result, &handle, sizeof(result)); |
| 679 return result; | 699 return result; |
| 680 } | 700 } |
| 681 | 701 |
| 682 void BlinkPlatformImpl::updateTraceEventDuration( | 702 void BlinkPlatformImpl::updateTraceEventDuration( |
| 683 const unsigned char* category_group_enabled, | 703 const unsigned char* category_group_enabled, |
| 684 const char* name, | 704 const char* name, |
| 685 TraceEventHandle handle) { | 705 TraceEventHandle handle) { |
| 686 base::trace_event::TraceEventHandle traceEventHandle; | 706 base::trace_event::TraceEventHandle traceEventHandle; |
| (...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1364 return WebString::fromUTF8(ui::KeycodeConverter::DomCodeToCodeString( | 1384 return WebString::fromUTF8(ui::KeycodeConverter::DomCodeToCodeString( |
| 1365 static_cast<ui::DomCode>(dom_code))); | 1385 static_cast<ui::DomCode>(dom_code))); |
| 1366 } | 1386 } |
| 1367 | 1387 |
| 1368 int BlinkPlatformImpl::domEnumFromCodeString(const WebString& code) { | 1388 int BlinkPlatformImpl::domEnumFromCodeString(const WebString& code) { |
| 1369 return static_cast<int>(ui::KeycodeConverter::CodeStringToDomCode( | 1389 return static_cast<int>(ui::KeycodeConverter::CodeStringToDomCode( |
| 1370 code.utf8().data())); | 1390 code.utf8().data())); |
| 1371 } | 1391 } |
| 1372 | 1392 |
| 1373 } // namespace content | 1393 } // namespace content |
| OLD | NEW |