| OLD | NEW |
| 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/child/webkitplatformsupport_impl.h" | 5 #include "webkit/child/webkitplatformsupport_impl.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 const unsigned long long* arg_values, | 483 const unsigned long long* arg_values, |
| 484 unsigned char flags) { | 484 unsigned char flags) { |
| 485 base::debug::TraceEventHandle handle = TRACE_EVENT_API_ADD_TRACE_EVENT( | 485 base::debug::TraceEventHandle handle = TRACE_EVENT_API_ADD_TRACE_EVENT( |
| 486 phase, category_group_enabled, name, id, | 486 phase, category_group_enabled, name, id, |
| 487 num_args, arg_names, arg_types, arg_values, NULL, flags); | 487 num_args, arg_names, arg_types, arg_values, NULL, flags); |
| 488 blink::Platform::TraceEventHandle result; | 488 blink::Platform::TraceEventHandle result; |
| 489 memcpy(&result, &handle, sizeof(result)); | 489 memcpy(&result, &handle, sizeof(result)); |
| 490 return result; | 490 return result; |
| 491 } | 491 } |
| 492 | 492 |
| 493 // TODO(wangxianzhu): Remove this. |
| 493 void WebKitPlatformSupportImpl::updateTraceEventDuration( | 494 void WebKitPlatformSupportImpl::updateTraceEventDuration( |
| 494 TraceEventHandle handle) { | 495 TraceEventHandle handle) { |
| 496 updateTraceEventDuration(NULL, NULL, handle); |
| 497 } |
| 498 |
| 499 void WebKitPlatformSupportImpl::updateTraceEventDuration( |
| 500 const unsigned char* category_group_enabled, |
| 501 const char* name, |
| 502 TraceEventHandle handle) { |
| 495 base::debug::TraceEventHandle traceEventHandle; | 503 base::debug::TraceEventHandle traceEventHandle; |
| 496 memcpy(&traceEventHandle, &handle, sizeof(handle)); | 504 memcpy(&traceEventHandle, &handle, sizeof(handle)); |
| 497 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(traceEventHandle); | 505 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION( |
| 506 category_group_enabled, name, traceEventHandle); |
| 498 } | 507 } |
| 499 | 508 |
| 500 namespace { | 509 namespace { |
| 501 | 510 |
| 502 WebData loadAudioSpatializationResource(WebKitPlatformSupportImpl* platform, | 511 WebData loadAudioSpatializationResource(WebKitPlatformSupportImpl* platform, |
| 503 const char* name) { | 512 const char* name) { |
| 504 #ifdef IDR_AUDIO_SPATIALIZATION_COMPOSITE | 513 #ifdef IDR_AUDIO_SPATIALIZATION_COMPOSITE |
| 505 if (!strcmp(name, "Composite")) { | 514 if (!strcmp(name, "Composite")) { |
| 506 base::StringPiece resource = | 515 base::StringPiece resource = |
| 507 platform->GetDataResource(IDR_AUDIO_SPATIALIZATION_COMPOSITE, | 516 platform->GetDataResource(IDR_AUDIO_SPATIALIZATION_COMPOSITE, |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 928 if (--shared_timer_suspended_ == 0 && | 937 if (--shared_timer_suspended_ == 0 && |
| 929 (!shared_timer_.IsRunning() || | 938 (!shared_timer_.IsRunning() || |
| 930 shared_timer_fire_time_was_set_while_suspended_)) { | 939 shared_timer_fire_time_was_set_while_suspended_)) { |
| 931 shared_timer_fire_time_was_set_while_suspended_ = false; | 940 shared_timer_fire_time_was_set_while_suspended_ = false; |
| 932 setSharedTimerFireInterval( | 941 setSharedTimerFireInterval( |
| 933 shared_timer_fire_time_ - monotonicallyIncreasingTime()); | 942 shared_timer_fire_time_ - monotonicallyIncreasingTime()); |
| 934 } | 943 } |
| 935 } | 944 } |
| 936 | 945 |
| 937 } // namespace webkit_glue | 946 } // namespace webkit_glue |
| OLD | NEW |