| 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 <memory> | 9 #include <memory> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 #include "build/build_config.h" | 36 #include "build/build_config.h" |
| 37 #include "components/mime_util/mime_util.h" | 37 #include "components/mime_util/mime_util.h" |
| 38 #include "components/scheduler/child/web_task_runner_impl.h" | 38 #include "components/scheduler/child/web_task_runner_impl.h" |
| 39 #include "components/scheduler/child/webthread_impl_for_worker_scheduler.h" | 39 #include "components/scheduler/child/webthread_impl_for_worker_scheduler.h" |
| 40 #include "content/app/resources/grit/content_resources.h" | 40 #include "content/app/resources/grit/content_resources.h" |
| 41 #include "content/app/strings/grit/content_strings.h" | 41 #include "content/app/strings/grit/content_strings.h" |
| 42 #include "content/child/background_sync/background_sync_provider.h" | 42 #include "content/child/background_sync/background_sync_provider.h" |
| 43 #include "content/child/child_thread_impl.h" | 43 #include "content/child/child_thread_impl.h" |
| 44 #include "content/child/content_child_helpers.h" | 44 #include "content/child/content_child_helpers.h" |
| 45 #include "content/child/geofencing/web_geofencing_provider_impl.h" | 45 #include "content/child/geofencing/web_geofencing_provider_impl.h" |
| 46 #include "content/child/notifications/notification_dispatcher.h" | |
| 47 #include "content/child/notifications/notification_manager.h" | |
| 48 #include "content/child/permissions/permission_dispatcher.h" | 46 #include "content/child/permissions/permission_dispatcher.h" |
| 49 #include "content/child/permissions/permission_dispatcher_thread_proxy.h" | 47 #include "content/child/permissions/permission_dispatcher_thread_proxy.h" |
| 50 #include "content/child/push_messaging/push_dispatcher.h" | 48 #include "content/child/push_messaging/push_dispatcher.h" |
| 51 #include "content/child/push_messaging/push_provider.h" | 49 #include "content/child/push_messaging/push_provider.h" |
| 52 #include "content/child/thread_safe_sender.h" | 50 #include "content/child/thread_safe_sender.h" |
| 53 #include "content/child/web_url_loader_impl.h" | 51 #include "content/child/web_url_loader_impl.h" |
| 54 #include "content/child/web_url_request_util.h" | 52 #include "content/child/web_url_request_util.h" |
| 55 #include "content/child/websocket_bridge.h" | 53 #include "content/child/websocket_bridge.h" |
| 56 #include "content/child/worker_thread_registry.h" | 54 #include "content/child/worker_thread_registry.h" |
| 57 #include "content/public/common/content_client.h" | 55 #include "content/public/common/content_client.h" |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 compositor_thread_(nullptr) { | 378 compositor_thread_(nullptr) { |
| 381 InternalInit(); | 379 InternalInit(); |
| 382 } | 380 } |
| 383 | 381 |
| 384 void BlinkPlatformImpl::InternalInit() { | 382 void BlinkPlatformImpl::InternalInit() { |
| 385 // ChildThread may not exist in some tests. | 383 // ChildThread may not exist in some tests. |
| 386 if (ChildThreadImpl::current()) { | 384 if (ChildThreadImpl::current()) { |
| 387 geofencing_provider_.reset(new WebGeofencingProviderImpl( | 385 geofencing_provider_.reset(new WebGeofencingProviderImpl( |
| 388 ChildThreadImpl::current()->thread_safe_sender())); | 386 ChildThreadImpl::current()->thread_safe_sender())); |
| 389 thread_safe_sender_ = ChildThreadImpl::current()->thread_safe_sender(); | 387 thread_safe_sender_ = ChildThreadImpl::current()->thread_safe_sender(); |
| 390 notification_dispatcher_ = | |
| 391 ChildThreadImpl::current()->notification_dispatcher(); | |
| 392 push_dispatcher_ = ChildThreadImpl::current()->push_dispatcher(); | 388 push_dispatcher_ = ChildThreadImpl::current()->push_dispatcher(); |
| 393 permission_client_.reset(new PermissionDispatcher( | 389 permission_client_.reset(new PermissionDispatcher( |
| 394 ChildThreadImpl::current()->service_registry())); | 390 ChildThreadImpl::current()->service_registry())); |
| 395 main_thread_sync_provider_.reset( | 391 main_thread_sync_provider_.reset( |
| 396 new BackgroundSyncProvider(main_thread_task_runner_.get())); | 392 new BackgroundSyncProvider(main_thread_task_runner_.get())); |
| 397 } | 393 } |
| 398 } | 394 } |
| 399 | 395 |
| 400 void BlinkPlatformImpl::WaitUntilWebThreadTLSUpdate( | 396 void BlinkPlatformImpl::WaitUntilWebThreadTLSUpdate( |
| 401 scheduler::WebThreadBase* thread) { | 397 scheduler::WebThreadBase* thread) { |
| (...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 859 } | 855 } |
| 860 | 856 |
| 861 blink::WebCrypto* BlinkPlatformImpl::crypto() { | 857 blink::WebCrypto* BlinkPlatformImpl::crypto() { |
| 862 return &web_crypto_; | 858 return &web_crypto_; |
| 863 } | 859 } |
| 864 | 860 |
| 865 blink::WebGeofencingProvider* BlinkPlatformImpl::geofencingProvider() { | 861 blink::WebGeofencingProvider* BlinkPlatformImpl::geofencingProvider() { |
| 866 return geofencing_provider_.get(); | 862 return geofencing_provider_.get(); |
| 867 } | 863 } |
| 868 | 864 |
| 869 blink::WebNotificationManager* | |
| 870 BlinkPlatformImpl::notificationManager() { | |
| 871 if (!thread_safe_sender_.get() || !notification_dispatcher_.get()) | |
| 872 return nullptr; | |
| 873 | |
| 874 return NotificationManager::ThreadSpecificInstance( | |
| 875 thread_safe_sender_.get(), | |
| 876 notification_dispatcher_.get()); | |
| 877 } | |
| 878 | |
| 879 blink::WebPushProvider* BlinkPlatformImpl::pushProvider() { | 865 blink::WebPushProvider* BlinkPlatformImpl::pushProvider() { |
| 880 if (!thread_safe_sender_.get() || !push_dispatcher_.get()) | 866 if (!thread_safe_sender_.get() || !push_dispatcher_.get()) |
| 881 return nullptr; | 867 return nullptr; |
| 882 | 868 |
| 883 return PushProvider::ThreadSpecificInstance(thread_safe_sender_.get(), | 869 return PushProvider::ThreadSpecificInstance(thread_safe_sender_.get(), |
| 884 push_dispatcher_.get()); | 870 push_dispatcher_.get()); |
| 885 } | 871 } |
| 886 | 872 |
| 887 blink::WebPermissionClient* BlinkPlatformImpl::permissionClient() { | 873 blink::WebPermissionClient* BlinkPlatformImpl::permissionClient() { |
| 888 if (!permission_client_.get()) | 874 if (!permission_client_.get()) |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1006 return WebString::fromUTF8(ui::KeycodeConverter::DomKeyToKeyString( | 992 return WebString::fromUTF8(ui::KeycodeConverter::DomKeyToKeyString( |
| 1007 static_cast<ui::DomKey>(dom_key))); | 993 static_cast<ui::DomKey>(dom_key))); |
| 1008 } | 994 } |
| 1009 | 995 |
| 1010 int BlinkPlatformImpl::domKeyEnumFromString(const WebString& key_string) { | 996 int BlinkPlatformImpl::domKeyEnumFromString(const WebString& key_string) { |
| 1011 return static_cast<int>( | 997 return static_cast<int>( |
| 1012 ui::KeycodeConverter::KeyStringToDomKey(key_string.utf8())); | 998 ui::KeycodeConverter::KeyStringToDomKey(key_string.utf8())); |
| 1013 } | 999 } |
| 1014 | 1000 |
| 1015 } // namespace content | 1001 } // namespace content |
| OLD | NEW |