Chromium Code Reviews| 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 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 399 return -1; | 400 return -1; |
| 400 } | 401 } |
| 401 | 402 |
| 402 BlinkPlatformImpl::BlinkPlatformImpl() | 403 BlinkPlatformImpl::BlinkPlatformImpl() |
| 403 : main_loop_(base::MessageLoop::current()), | 404 : main_loop_(base::MessageLoop::current()), |
| 404 shared_timer_func_(NULL), | 405 shared_timer_func_(NULL), |
| 405 shared_timer_fire_time_(0.0), | 406 shared_timer_fire_time_(0.0), |
| 406 shared_timer_fire_time_was_set_while_suspended_(false), | 407 shared_timer_fire_time_was_set_while_suspended_(false), |
| 407 shared_timer_suspended_(0), | 408 shared_timer_suspended_(0), |
| 408 fling_curve_configuration_(new FlingCurveConfiguration), | 409 fling_curve_configuration_(new FlingCurveConfiguration), |
| 409 current_thread_slot_(&DestroyCurrentThread) {} | 410 current_thread_slot_(&DestroyCurrentThread) { |
| 411 // ChildThread may not exist in some tests. | |
| 412 if (ChildThread::current()) { | |
| 413 web_geofencing_provider_.reset(new WebGeofencingProviderImpl( | |
| 414 ChildThread::current()->thread_safe_sender())); | |
| 415 } | |
| 416 } | |
| 410 | 417 |
| 411 BlinkPlatformImpl::~BlinkPlatformImpl() { | 418 BlinkPlatformImpl::~BlinkPlatformImpl() { |
| 412 } | 419 } |
| 413 | 420 |
| 414 WebURLLoader* BlinkPlatformImpl::createURLLoader() { | 421 WebURLLoader* BlinkPlatformImpl::createURLLoader() { |
| 415 ChildThread* child_thread = ChildThread::current(); | 422 ChildThread* child_thread = ChildThread::current(); |
| 416 // There may be no child thread in RenderViewTests. These tests can still use | 423 // There may be no child thread in RenderViewTests. These tests can still use |
| 417 // data URLs to bypass the ResourceDispatcher. | 424 // data URLs to bypass the ResourceDispatcher. |
| 418 return new WebURLLoaderImpl( | 425 return new WebURLLoaderImpl( |
| 419 child_thread ? child_thread->resource_dispatcher() : NULL); | 426 child_thread ? child_thread->resource_dispatcher() : NULL); |
| (...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 984 void BlinkPlatformImpl::didStopWorkerRunLoop( | 991 void BlinkPlatformImpl::didStopWorkerRunLoop( |
| 985 const blink::WebWorkerRunLoop& runLoop) { | 992 const blink::WebWorkerRunLoop& runLoop) { |
| 986 WorkerTaskRunner* worker_task_runner = WorkerTaskRunner::Instance(); | 993 WorkerTaskRunner* worker_task_runner = WorkerTaskRunner::Instance(); |
| 987 worker_task_runner->OnWorkerRunLoopStopped(runLoop); | 994 worker_task_runner->OnWorkerRunLoopStopped(runLoop); |
| 988 } | 995 } |
| 989 | 996 |
| 990 blink::WebCrypto* BlinkPlatformImpl::crypto() { | 997 blink::WebCrypto* BlinkPlatformImpl::crypto() { |
| 991 return &web_crypto_; | 998 return &web_crypto_; |
| 992 } | 999 } |
| 993 | 1000 |
| 1001 blink::WebGeofencingProvider* BlinkPlatformImpl::geofencingProvider() { | |
| 1002 return web_geofencing_provider_.get(); | |
|
jochen (gone - plz use gerrit)
2014/09/11 12:47:27
how will you test the feature in layout tests?
Marijn Kruisselbrink
2014/09/11 17:57:52
To be honest I have no idea. The actual feature I'
jochen (gone - plz use gerrit)
2014/09/12 13:52:54
having a closer look, this should probably be in c
| |
| 1003 } | |
| 994 | 1004 |
| 995 WebThemeEngine* BlinkPlatformImpl::themeEngine() { | 1005 WebThemeEngine* BlinkPlatformImpl::themeEngine() { |
| 996 return &native_theme_engine_; | 1006 return &native_theme_engine_; |
| 997 } | 1007 } |
| 998 | 1008 |
| 999 WebFallbackThemeEngine* BlinkPlatformImpl::fallbackThemeEngine() { | 1009 WebFallbackThemeEngine* BlinkPlatformImpl::fallbackThemeEngine() { |
| 1000 return &fallback_theme_engine_; | 1010 return &fallback_theme_engine_; |
| 1001 } | 1011 } |
| 1002 | 1012 |
| 1003 blink::Platform::FileHandle BlinkPlatformImpl::databaseOpenFile( | 1013 blink::Platform::FileHandle BlinkPlatformImpl::databaseOpenFile( |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1177 } | 1187 } |
| 1178 | 1188 |
| 1179 // static | 1189 // static |
| 1180 void BlinkPlatformImpl::DestroyCurrentThread(void* thread) { | 1190 void BlinkPlatformImpl::DestroyCurrentThread(void* thread) { |
| 1181 WebThreadImplForMessageLoop* impl = | 1191 WebThreadImplForMessageLoop* impl = |
| 1182 static_cast<WebThreadImplForMessageLoop*>(thread); | 1192 static_cast<WebThreadImplForMessageLoop*>(thread); |
| 1183 delete impl; | 1193 delete impl; |
| 1184 } | 1194 } |
| 1185 | 1195 |
| 1186 } // namespace content | 1196 } // namespace content |
| OLD | NEW |