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 15 matching lines...) Expand all Loading... |
26 #include "base/synchronization/waitable_event.h" | 26 #include "base/synchronization/waitable_event.h" |
27 #include "base/sys_info.h" | 27 #include "base/sys_info.h" |
28 #include "base/threading/platform_thread.h" | 28 #include "base/threading/platform_thread.h" |
29 #include "base/time/time.h" | 29 #include "base/time/time.h" |
30 #include "blink/public/resources/grit/blink_resources.h" | 30 #include "blink/public/resources/grit/blink_resources.h" |
31 #include "content/app/resources/grit/content_resources.h" | 31 #include "content/app/resources/grit/content_resources.h" |
32 #include "content/app/strings/grit/content_strings.h" | 32 #include "content/app/strings/grit/content_strings.h" |
33 #include "content/child/child_thread.h" | 33 #include "content/child/child_thread.h" |
34 #include "content/child/content_child_helpers.h" | 34 #include "content/child/content_child_helpers.h" |
35 #include "content/child/geofencing/web_geofencing_provider_impl.h" | 35 #include "content/child/geofencing/web_geofencing_provider_impl.h" |
36 #include "content/child/touch_fling_gesture_curve.h" | |
37 #include "content/child/web_discardable_memory_impl.h" | 36 #include "content/child/web_discardable_memory_impl.h" |
| 37 #include "content/child/web_gesture_curve_impl.h" |
38 #include "content/child/web_socket_stream_handle_impl.h" | 38 #include "content/child/web_socket_stream_handle_impl.h" |
39 #include "content/child/web_url_loader_impl.h" | 39 #include "content/child/web_url_loader_impl.h" |
40 #include "content/child/websocket_bridge.h" | 40 #include "content/child/websocket_bridge.h" |
41 #include "content/child/webthread_impl.h" | 41 #include "content/child/webthread_impl.h" |
42 #include "content/child/worker_task_runner.h" | 42 #include "content/child/worker_task_runner.h" |
43 #include "content/public/common/content_client.h" | 43 #include "content/public/common/content_client.h" |
44 #include "net/base/data_url.h" | 44 #include "net/base/data_url.h" |
45 #include "net/base/mime_util.h" | 45 #include "net/base/mime_util.h" |
46 #include "net/base/net_errors.h" | 46 #include "net/base/net_errors.h" |
47 #include "net/base/net_util.h" | 47 #include "net/base/net_util.h" |
48 #include "third_party/WebKit/public/platform/WebConvertableToTraceFormat.h" | 48 #include "third_party/WebKit/public/platform/WebConvertableToTraceFormat.h" |
49 #include "third_party/WebKit/public/platform/WebData.h" | 49 #include "third_party/WebKit/public/platform/WebData.h" |
| 50 #include "third_party/WebKit/public/platform/WebFloatPoint.h" |
50 #include "third_party/WebKit/public/platform/WebString.h" | 51 #include "third_party/WebKit/public/platform/WebString.h" |
51 #include "third_party/WebKit/public/platform/WebURL.h" | 52 #include "third_party/WebKit/public/platform/WebURL.h" |
52 #include "third_party/WebKit/public/platform/WebWaitableEvent.h" | 53 #include "third_party/WebKit/public/platform/WebWaitableEvent.h" |
53 #include "third_party/WebKit/public/web/WebSecurityOrigin.h" | 54 #include "third_party/WebKit/public/web/WebSecurityOrigin.h" |
54 #include "ui/base/layout.h" | 55 #include "ui/base/layout.h" |
55 | 56 |
56 #if defined(OS_ANDROID) | |
57 #include "content/child/fling_animator_impl_android.h" | |
58 #endif | |
59 | |
60 #if !defined(NO_TCMALLOC) && defined(USE_TCMALLOC) && !defined(OS_WIN) | 57 #if !defined(NO_TCMALLOC) && defined(USE_TCMALLOC) && !defined(OS_WIN) |
61 #include "third_party/tcmalloc/chromium/src/gperftools/heap-profiler.h" | 58 #include "third_party/tcmalloc/chromium/src/gperftools/heap-profiler.h" |
62 #endif | 59 #endif |
63 | 60 |
64 using blink::WebData; | 61 using blink::WebData; |
65 using blink::WebFallbackThemeEngine; | 62 using blink::WebFallbackThemeEngine; |
66 using blink::WebLocalizedString; | 63 using blink::WebLocalizedString; |
67 using blink::WebString; | 64 using blink::WebString; |
68 using blink::WebSocketStreamHandle; | 65 using blink::WebSocketStreamHandle; |
69 using blink::WebThemeEngine; | 66 using blink::WebThemeEngine; |
(...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
993 | 990 |
994 void BlinkPlatformImpl::callOnMainThread( | 991 void BlinkPlatformImpl::callOnMainThread( |
995 void (*func)(void*), void* context) { | 992 void (*func)(void*), void* context) { |
996 main_loop_->PostTask(FROM_HERE, base::Bind(func, context)); | 993 main_loop_->PostTask(FROM_HERE, base::Bind(func, context)); |
997 } | 994 } |
998 | 995 |
999 blink::WebGestureCurve* BlinkPlatformImpl::createFlingAnimationCurve( | 996 blink::WebGestureCurve* BlinkPlatformImpl::createFlingAnimationCurve( |
1000 blink::WebGestureDevice device_source, | 997 blink::WebGestureDevice device_source, |
1001 const blink::WebFloatPoint& velocity, | 998 const blink::WebFloatPoint& velocity, |
1002 const blink::WebSize& cumulative_scroll) { | 999 const blink::WebSize& cumulative_scroll) { |
1003 #if defined(OS_ANDROID) | 1000 auto curve = WebGestureCurveImpl::CreateFromDefaultPlatformCurve( |
1004 return FlingAnimatorImpl::CreateAndroidGestureCurve( | 1001 gfx::Vector2dF(velocity.x, velocity.y), |
1005 velocity, | 1002 gfx::Vector2dF(cumulative_scroll.width, cumulative_scroll.height)); |
1006 cumulative_scroll); | 1003 return curve.release(); |
1007 #endif | |
1008 | |
1009 return TouchFlingGestureCurve::Create(velocity, cumulative_scroll); | |
1010 } | 1004 } |
1011 | 1005 |
1012 void BlinkPlatformImpl::didStartWorkerRunLoop( | 1006 void BlinkPlatformImpl::didStartWorkerRunLoop( |
1013 const blink::WebWorkerRunLoop& runLoop) { | 1007 const blink::WebWorkerRunLoop& runLoop) { |
1014 WorkerTaskRunner* worker_task_runner = WorkerTaskRunner::Instance(); | 1008 WorkerTaskRunner* worker_task_runner = WorkerTaskRunner::Instance(); |
1015 worker_task_runner->OnWorkerRunLoopStarted(runLoop); | 1009 worker_task_runner->OnWorkerRunLoopStarted(runLoop); |
1016 } | 1010 } |
1017 | 1011 |
1018 void BlinkPlatformImpl::didStopWorkerRunLoop( | 1012 void BlinkPlatformImpl::didStopWorkerRunLoop( |
1019 const blink::WebWorkerRunLoop& runLoop) { | 1013 const blink::WebWorkerRunLoop& runLoop) { |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1208 } | 1202 } |
1209 | 1203 |
1210 // static | 1204 // static |
1211 void BlinkPlatformImpl::DestroyCurrentThread(void* thread) { | 1205 void BlinkPlatformImpl::DestroyCurrentThread(void* thread) { |
1212 WebThreadImplForMessageLoop* impl = | 1206 WebThreadImplForMessageLoop* impl = |
1213 static_cast<WebThreadImplForMessageLoop*>(thread); | 1207 static_cast<WebThreadImplForMessageLoop*>(thread); |
1214 delete impl; | 1208 delete impl; |
1215 } | 1209 } |
1216 | 1210 |
1217 } // namespace content | 1211 } // namespace content |
OLD | NEW |