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