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 14 matching lines...) Expand all Loading... |
25 #include "base/synchronization/lock.h" | 25 #include "base/synchronization/lock.h" |
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/touch_fling_gesture_curve.h" | 36 #include "content/child/touch_fling_gesture_curve.h" |
36 #include "content/child/web_discardable_memory_impl.h" | 37 #include "content/child/web_discardable_memory_impl.h" |
37 #include "content/child/web_socket_stream_handle_impl.h" | 38 #include "content/child/web_socket_stream_handle_impl.h" |
38 #include "content/child/web_url_loader_impl.h" | 39 #include "content/child/web_url_loader_impl.h" |
39 #include "content/child/websocket_bridge.h" | 40 #include "content/child/websocket_bridge.h" |
40 #include "content/child/webthread_impl.h" | 41 #include "content/child/webthread_impl.h" |
41 #include "content/child/worker_task_runner.h" | 42 #include "content/child/worker_task_runner.h" |
42 #include "content/public/common/content_client.h" | 43 #include "content/public/common/content_client.h" |
43 #include "net/base/data_url.h" | 44 #include "net/base/data_url.h" |
44 #include "net/base/mime_util.h" | 45 #include "net/base/mime_util.h" |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 } | 416 } |
416 return -1; | 417 return -1; |
417 } | 418 } |
418 | 419 |
419 BlinkPlatformImpl::BlinkPlatformImpl() | 420 BlinkPlatformImpl::BlinkPlatformImpl() |
420 : main_loop_(base::MessageLoop::current()), | 421 : main_loop_(base::MessageLoop::current()), |
421 shared_timer_func_(NULL), | 422 shared_timer_func_(NULL), |
422 shared_timer_fire_time_(0.0), | 423 shared_timer_fire_time_(0.0), |
423 shared_timer_fire_time_was_set_while_suspended_(false), | 424 shared_timer_fire_time_was_set_while_suspended_(false), |
424 shared_timer_suspended_(0), | 425 shared_timer_suspended_(0), |
425 current_thread_slot_(&DestroyCurrentThread) {} | 426 current_thread_slot_(&DestroyCurrentThread) { |
| 427 // ChildThread may not exist in some tests. |
| 428 if (ChildThread::current()) { |
| 429 geofencing_provider_.reset(new WebGeofencingProviderImpl( |
| 430 ChildThread::current()->thread_safe_sender())); |
| 431 } |
| 432 } |
426 | 433 |
427 BlinkPlatformImpl::~BlinkPlatformImpl() { | 434 BlinkPlatformImpl::~BlinkPlatformImpl() { |
428 } | 435 } |
429 | 436 |
430 WebURLLoader* BlinkPlatformImpl::createURLLoader() { | 437 WebURLLoader* BlinkPlatformImpl::createURLLoader() { |
431 ChildThread* child_thread = ChildThread::current(); | 438 ChildThread* child_thread = ChildThread::current(); |
432 // There may be no child thread in RenderViewTests. These tests can still use | 439 // There may be no child thread in RenderViewTests. These tests can still use |
433 // data URLs to bypass the ResourceDispatcher. | 440 // data URLs to bypass the ResourceDispatcher. |
434 return new WebURLLoaderImpl( | 441 return new WebURLLoaderImpl( |
435 child_thread ? child_thread->resource_dispatcher() : NULL); | 442 child_thread ? child_thread->resource_dispatcher() : NULL); |
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1011 void BlinkPlatformImpl::didStopWorkerRunLoop( | 1018 void BlinkPlatformImpl::didStopWorkerRunLoop( |
1012 const blink::WebWorkerRunLoop& runLoop) { | 1019 const blink::WebWorkerRunLoop& runLoop) { |
1013 WorkerTaskRunner* worker_task_runner = WorkerTaskRunner::Instance(); | 1020 WorkerTaskRunner* worker_task_runner = WorkerTaskRunner::Instance(); |
1014 worker_task_runner->OnWorkerRunLoopStopped(runLoop); | 1021 worker_task_runner->OnWorkerRunLoopStopped(runLoop); |
1015 } | 1022 } |
1016 | 1023 |
1017 blink::WebCrypto* BlinkPlatformImpl::crypto() { | 1024 blink::WebCrypto* BlinkPlatformImpl::crypto() { |
1018 return &web_crypto_; | 1025 return &web_crypto_; |
1019 } | 1026 } |
1020 | 1027 |
| 1028 blink::WebGeofencingProvider* BlinkPlatformImpl::geofencingProvider() { |
| 1029 return geofencing_provider_.get(); |
| 1030 } |
1021 | 1031 |
1022 WebThemeEngine* BlinkPlatformImpl::themeEngine() { | 1032 WebThemeEngine* BlinkPlatformImpl::themeEngine() { |
1023 return &native_theme_engine_; | 1033 return &native_theme_engine_; |
1024 } | 1034 } |
1025 | 1035 |
1026 WebFallbackThemeEngine* BlinkPlatformImpl::fallbackThemeEngine() { | 1036 WebFallbackThemeEngine* BlinkPlatformImpl::fallbackThemeEngine() { |
1027 return &fallback_theme_engine_; | 1037 return &fallback_theme_engine_; |
1028 } | 1038 } |
1029 | 1039 |
1030 blink::Platform::FileHandle BlinkPlatformImpl::databaseOpenFile( | 1040 blink::Platform::FileHandle BlinkPlatformImpl::databaseOpenFile( |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1198 } | 1208 } |
1199 | 1209 |
1200 // static | 1210 // static |
1201 void BlinkPlatformImpl::DestroyCurrentThread(void* thread) { | 1211 void BlinkPlatformImpl::DestroyCurrentThread(void* thread) { |
1202 WebThreadImplForMessageLoop* impl = | 1212 WebThreadImplForMessageLoop* impl = |
1203 static_cast<WebThreadImplForMessageLoop*>(thread); | 1213 static_cast<WebThreadImplForMessageLoop*>(thread); |
1204 delete impl; | 1214 delete impl; |
1205 } | 1215 } |
1206 | 1216 |
1207 } // namespace content | 1217 } // namespace content |
OLD | NEW |