Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Side by Side Diff: content/child/blink_platform_impl.cc

Issue 634373003: Consolidate content fling implementations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix win build Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/child/OWNERS ('k') | content/child/fling_animator_impl_android.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 925 matching lines...) Expand 10 before | Expand all | Expand 10 after
995 992
996 void BlinkPlatformImpl::callOnMainThread( 993 void BlinkPlatformImpl::callOnMainThread(
997 void (*func)(void*), void* context) { 994 void (*func)(void*), void* context) {
998 main_loop_->PostTask(FROM_HERE, base::Bind(func, context)); 995 main_loop_->PostTask(FROM_HERE, base::Bind(func, context));
999 } 996 }
1000 997
1001 blink::WebGestureCurve* BlinkPlatformImpl::createFlingAnimationCurve( 998 blink::WebGestureCurve* BlinkPlatformImpl::createFlingAnimationCurve(
1002 blink::WebGestureDevice device_source, 999 blink::WebGestureDevice device_source,
1003 const blink::WebFloatPoint& velocity, 1000 const blink::WebFloatPoint& velocity,
1004 const blink::WebSize& cumulative_scroll) { 1001 const blink::WebSize& cumulative_scroll) {
1005 #if defined(OS_ANDROID) 1002 auto curve = WebGestureCurveImpl::CreateFromDefaultPlatformCurve(
1006 return FlingAnimatorImpl::CreateAndroidGestureCurve( 1003 gfx::Vector2dF(velocity.x, velocity.y),
1007 velocity, 1004 gfx::Vector2dF(cumulative_scroll.width, cumulative_scroll.height));
1008 cumulative_scroll); 1005 return curve.release();
1009 #endif
1010
1011 return TouchFlingGestureCurve::Create(velocity, cumulative_scroll);
1012 } 1006 }
1013 1007
1014 void BlinkPlatformImpl::didStartWorkerRunLoop( 1008 void BlinkPlatformImpl::didStartWorkerRunLoop(
1015 const blink::WebWorkerRunLoop& runLoop) { 1009 const blink::WebWorkerRunLoop& runLoop) {
1016 WorkerTaskRunner* worker_task_runner = WorkerTaskRunner::Instance(); 1010 WorkerTaskRunner* worker_task_runner = WorkerTaskRunner::Instance();
1017 worker_task_runner->OnWorkerRunLoopStarted(runLoop); 1011 worker_task_runner->OnWorkerRunLoopStarted(runLoop);
1018 } 1012 }
1019 1013
1020 void BlinkPlatformImpl::didStopWorkerRunLoop( 1014 void BlinkPlatformImpl::didStopWorkerRunLoop(
1021 const blink::WebWorkerRunLoop& runLoop) { 1015 const blink::WebWorkerRunLoop& runLoop) {
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
1210 } 1204 }
1211 1205
1212 // static 1206 // static
1213 void BlinkPlatformImpl::DestroyCurrentThread(void* thread) { 1207 void BlinkPlatformImpl::DestroyCurrentThread(void* thread) {
1214 WebThreadImplForMessageLoop* impl = 1208 WebThreadImplForMessageLoop* impl =
1215 static_cast<WebThreadImplForMessageLoop*>(thread); 1209 static_cast<WebThreadImplForMessageLoop*>(thread);
1216 delete impl; 1210 delete impl;
1217 } 1211 }
1218 1212
1219 } // namespace content 1213 } // namespace content
OLDNEW
« no previous file with comments | « content/child/OWNERS ('k') | content/child/fling_animator_impl_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698