 Chromium Code Reviews
 Chromium Code Reviews Issue 476293002:
  Pass through geofencing API calls to the browser process.  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src
    
  
    Issue 476293002:
  Pass through geofencing API calls to the browser process.  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src| 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 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 405 return -1; | 406 return -1; | 
| 406 } | 407 } | 
| 407 | 408 | 
| 408 BlinkPlatformImpl::BlinkPlatformImpl() | 409 BlinkPlatformImpl::BlinkPlatformImpl() | 
| 409 : main_loop_(base::MessageLoop::current()), | 410 : main_loop_(base::MessageLoop::current()), | 
| 410 shared_timer_func_(NULL), | 411 shared_timer_func_(NULL), | 
| 411 shared_timer_fire_time_(0.0), | 412 shared_timer_fire_time_(0.0), | 
| 412 shared_timer_fire_time_was_set_while_suspended_(false), | 413 shared_timer_fire_time_was_set_while_suspended_(false), | 
| 413 shared_timer_suspended_(0), | 414 shared_timer_suspended_(0), | 
| 414 fling_curve_configuration_(new FlingCurveConfiguration), | 415 fling_curve_configuration_(new FlingCurveConfiguration), | 
| 415 current_thread_slot_(&DestroyCurrentThread) {} | 416 current_thread_slot_(&DestroyCurrentThread) { | 
| 417 // ChildThread may not exist in some tests. | |
| 418 if (ChildThread::current()) { | |
| 419 geofencing_provider_.reset(new WebGeofencingProviderImpl( | |
| 420 ChildThread::current()->thread_safe_sender())); | |
| 421 } | |
| 422 } | |
| 416 | 423 | 
| 417 BlinkPlatformImpl::~BlinkPlatformImpl() { | 424 BlinkPlatformImpl::~BlinkPlatformImpl() { | 
| 418 } | 425 } | 
| 419 | 426 | 
| 420 WebURLLoader* BlinkPlatformImpl::createURLLoader() { | 427 WebURLLoader* BlinkPlatformImpl::createURLLoader() { | 
| 421 ChildThread* child_thread = ChildThread::current(); | 428 ChildThread* child_thread = ChildThread::current(); | 
| 422 // There may be no child thread in RenderViewTests. These tests can still use | 429 // There may be no child thread in RenderViewTests. These tests can still use | 
| 423 // data URLs to bypass the ResourceDispatcher. | 430 // data URLs to bypass the ResourceDispatcher. | 
| 424 return new WebURLLoaderImpl( | 431 return new WebURLLoaderImpl( | 
| 425 child_thread ? child_thread->resource_dispatcher() : NULL); | 432 child_thread ? child_thread->resource_dispatcher() : NULL); | 
| (...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 988 void BlinkPlatformImpl::didStopWorkerRunLoop( | 995 void BlinkPlatformImpl::didStopWorkerRunLoop( | 
| 989 const blink::WebWorkerRunLoop& runLoop) { | 996 const blink::WebWorkerRunLoop& runLoop) { | 
| 990 WorkerTaskRunner* worker_task_runner = WorkerTaskRunner::Instance(); | 997 WorkerTaskRunner* worker_task_runner = WorkerTaskRunner::Instance(); | 
| 991 worker_task_runner->OnWorkerRunLoopStopped(runLoop); | 998 worker_task_runner->OnWorkerRunLoopStopped(runLoop); | 
| 992 } | 999 } | 
| 993 | 1000 | 
| 994 blink::WebCrypto* BlinkPlatformImpl::crypto() { | 1001 blink::WebCrypto* BlinkPlatformImpl::crypto() { | 
| 995 return &web_crypto_; | 1002 return &web_crypto_; | 
| 996 } | 1003 } | 
| 997 | 1004 | 
| 1005 blink::WebGeofencingProvider* BlinkPlatformImpl::geofencingProvider() { | |
| 
jochen (gone - plz use gerrit)
2014/09/17 18:26:44
the WebGeofencingProvider only exists on the main
 
Marijn Kruisselbrink
2014/09/18 16:32:05
No, that's not right. Just like the WebCrypto abov
 | |
| 1006 return geofencing_provider_.get(); | |
| 1007 } | |
| 998 | 1008 | 
| 999 WebThemeEngine* BlinkPlatformImpl::themeEngine() { | 1009 WebThemeEngine* BlinkPlatformImpl::themeEngine() { | 
| 1000 return &native_theme_engine_; | 1010 return &native_theme_engine_; | 
| 1001 } | 1011 } | 
| 1002 | 1012 | 
| 1003 WebFallbackThemeEngine* BlinkPlatformImpl::fallbackThemeEngine() { | 1013 WebFallbackThemeEngine* BlinkPlatformImpl::fallbackThemeEngine() { | 
| 1004 return &fallback_theme_engine_; | 1014 return &fallback_theme_engine_; | 
| 1005 } | 1015 } | 
| 1006 | 1016 | 
| 1007 blink::Platform::FileHandle BlinkPlatformImpl::databaseOpenFile( | 1017 blink::Platform::FileHandle BlinkPlatformImpl::databaseOpenFile( | 
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1181 } | 1191 } | 
| 1182 | 1192 | 
| 1183 // static | 1193 // static | 
| 1184 void BlinkPlatformImpl::DestroyCurrentThread(void* thread) { | 1194 void BlinkPlatformImpl::DestroyCurrentThread(void* thread) { | 
| 1185 WebThreadImplForMessageLoop* impl = | 1195 WebThreadImplForMessageLoop* impl = | 
| 1186 static_cast<WebThreadImplForMessageLoop*>(thread); | 1196 static_cast<WebThreadImplForMessageLoop*>(thread); | 
| 1187 delete impl; | 1197 delete impl; | 
| 1188 } | 1198 } | 
| 1189 | 1199 | 
| 1190 } // namespace content | 1200 } // namespace content | 
| OLD | NEW |