| 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 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1016 | 1016 |
| 1017 void BlinkPlatformImpl::callOnMainThread( | 1017 void BlinkPlatformImpl::callOnMainThread( |
| 1018 void (*func)(void*), void* context) { | 1018 void (*func)(void*), void* context) { |
| 1019 main_thread_task_runner_->PostTask(FROM_HERE, base::Bind(func, context)); | 1019 main_thread_task_runner_->PostTask(FROM_HERE, base::Bind(func, context)); |
| 1020 } | 1020 } |
| 1021 | 1021 |
| 1022 blink::WebGestureCurve* BlinkPlatformImpl::createFlingAnimationCurve( | 1022 blink::WebGestureCurve* BlinkPlatformImpl::createFlingAnimationCurve( |
| 1023 blink::WebGestureDevice device_source, | 1023 blink::WebGestureDevice device_source, |
| 1024 const blink::WebFloatPoint& velocity, | 1024 const blink::WebFloatPoint& velocity, |
| 1025 const blink::WebSize& cumulative_scroll) { | 1025 const blink::WebSize& cumulative_scroll) { |
| 1026 auto curve = WebGestureCurveImpl::CreateFromDefaultPlatformCurve( | 1026 bool is_main_thread = |
| 1027 gfx::Vector2dF(velocity.x, velocity.y), | 1027 main_thread_task_runner_.get() && |
| 1028 gfx::Vector2dF(cumulative_scroll.width, cumulative_scroll.height)); | 1028 main_thread_task_runner_->BelongsToCurrentThread(); |
| 1029 return curve.release(); | 1029 return WebGestureCurveImpl::CreateFromDefaultPlatformCurve( |
| 1030 gfx::Vector2dF(velocity.x, velocity.y), |
| 1031 gfx::Vector2dF(cumulative_scroll.width, cumulative_scroll.height), |
| 1032 is_main_thread).release(); |
| 1030 } | 1033 } |
| 1031 | 1034 |
| 1032 void BlinkPlatformImpl::didStartWorkerRunLoop( | 1035 void BlinkPlatformImpl::didStartWorkerRunLoop( |
| 1033 const blink::WebWorkerRunLoop& runLoop) { | 1036 const blink::WebWorkerRunLoop& runLoop) { |
| 1034 WorkerTaskRunner* worker_task_runner = WorkerTaskRunner::Instance(); | 1037 WorkerTaskRunner* worker_task_runner = WorkerTaskRunner::Instance(); |
| 1035 worker_task_runner->OnWorkerRunLoopStarted(runLoop); | 1038 worker_task_runner->OnWorkerRunLoopStarted(runLoop); |
| 1036 } | 1039 } |
| 1037 | 1040 |
| 1038 void BlinkPlatformImpl::didStopWorkerRunLoop( | 1041 void BlinkPlatformImpl::didStopWorkerRunLoop( |
| 1039 const blink::WebWorkerRunLoop& runLoop) { | 1042 const blink::WebWorkerRunLoop& runLoop) { |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1221 } | 1224 } |
| 1222 | 1225 |
| 1223 // static | 1226 // static |
| 1224 void BlinkPlatformImpl::DestroyCurrentThread(void* thread) { | 1227 void BlinkPlatformImpl::DestroyCurrentThread(void* thread) { |
| 1225 WebThreadImplForMessageLoop* impl = | 1228 WebThreadImplForMessageLoop* impl = |
| 1226 static_cast<WebThreadImplForMessageLoop*>(thread); | 1229 static_cast<WebThreadImplForMessageLoop*>(thread); |
| 1227 delete impl; | 1230 delete impl; |
| 1228 } | 1231 } |
| 1229 | 1232 |
| 1230 } // namespace content | 1233 } // namespace content |
| OLD | NEW |