| 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 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 compositor_thread_(nullptr) { | 375 compositor_thread_(nullptr) { |
| 378 InternalInit(); | 376 InternalInit(); |
| 379 } | 377 } |
| 380 | 378 |
| 381 void BlinkPlatformImpl::InternalInit() { | 379 void BlinkPlatformImpl::InternalInit() { |
| 382 // ChildThread may not exist in some tests. | 380 // ChildThread may not exist in some tests. |
| 383 if (ChildThreadImpl::current()) { | 381 if (ChildThreadImpl::current()) { |
| 384 geofencing_provider_.reset(new WebGeofencingProviderImpl( | 382 geofencing_provider_.reset(new WebGeofencingProviderImpl( |
| 385 ChildThreadImpl::current()->thread_safe_sender())); | 383 ChildThreadImpl::current()->thread_safe_sender())); |
| 386 thread_safe_sender_ = ChildThreadImpl::current()->thread_safe_sender(); | 384 thread_safe_sender_ = ChildThreadImpl::current()->thread_safe_sender(); |
| 387 notification_dispatcher_ = | |
| 388 ChildThreadImpl::current()->notification_dispatcher(); | |
| 389 push_dispatcher_ = ChildThreadImpl::current()->push_dispatcher(); | 385 push_dispatcher_ = ChildThreadImpl::current()->push_dispatcher(); |
| 390 permission_client_.reset(new PermissionDispatcher( | 386 permission_client_.reset(new PermissionDispatcher( |
| 391 ChildThreadImpl::current()->service_registry())); | 387 ChildThreadImpl::current()->service_registry())); |
| 392 main_thread_sync_provider_.reset( | 388 main_thread_sync_provider_.reset( |
| 393 new BackgroundSyncProvider(main_thread_task_runner_.get())); | 389 new BackgroundSyncProvider(main_thread_task_runner_.get())); |
| 394 } | 390 } |
| 395 } | 391 } |
| 396 | 392 |
| 397 void BlinkPlatformImpl::WaitUntilWebThreadTLSUpdate( | 393 void BlinkPlatformImpl::WaitUntilWebThreadTLSUpdate( |
| 398 scheduler::WebThreadBase* thread) { | 394 scheduler::WebThreadBase* thread) { |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 855 } | 851 } |
| 856 | 852 |
| 857 blink::WebCrypto* BlinkPlatformImpl::crypto() { | 853 blink::WebCrypto* BlinkPlatformImpl::crypto() { |
| 858 return &web_crypto_; | 854 return &web_crypto_; |
| 859 } | 855 } |
| 860 | 856 |
| 861 blink::WebGeofencingProvider* BlinkPlatformImpl::geofencingProvider() { | 857 blink::WebGeofencingProvider* BlinkPlatformImpl::geofencingProvider() { |
| 862 return geofencing_provider_.get(); | 858 return geofencing_provider_.get(); |
| 863 } | 859 } |
| 864 | 860 |
| 865 blink::WebNotificationManager* | |
| 866 BlinkPlatformImpl::notificationManager() { | |
| 867 if (!thread_safe_sender_.get() || !notification_dispatcher_.get()) | |
| 868 return nullptr; | |
| 869 | |
| 870 return NotificationManager::ThreadSpecificInstance( | |
| 871 thread_safe_sender_.get(), | |
| 872 notification_dispatcher_.get()); | |
| 873 } | |
| 874 | |
| 875 blink::WebPushProvider* BlinkPlatformImpl::pushProvider() { | 861 blink::WebPushProvider* BlinkPlatformImpl::pushProvider() { |
| 876 if (!thread_safe_sender_.get() || !push_dispatcher_.get()) | 862 if (!thread_safe_sender_.get() || !push_dispatcher_.get()) |
| 877 return nullptr; | 863 return nullptr; |
| 878 | 864 |
| 879 return PushProvider::ThreadSpecificInstance(thread_safe_sender_.get(), | 865 return PushProvider::ThreadSpecificInstance(thread_safe_sender_.get(), |
| 880 push_dispatcher_.get()); | 866 push_dispatcher_.get()); |
| 881 } | 867 } |
| 882 | 868 |
| 883 blink::WebPermissionClient* BlinkPlatformImpl::permissionClient() { | 869 blink::WebPermissionClient* BlinkPlatformImpl::permissionClient() { |
| 884 if (!permission_client_.get()) | 870 if (!permission_client_.get()) |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1002 return WebString::fromUTF8(ui::KeycodeConverter::DomKeyToKeyString( | 988 return WebString::fromUTF8(ui::KeycodeConverter::DomKeyToKeyString( |
| 1003 static_cast<ui::DomKey>(dom_key))); | 989 static_cast<ui::DomKey>(dom_key))); |
| 1004 } | 990 } |
| 1005 | 991 |
| 1006 int BlinkPlatformImpl::domKeyEnumFromString(const WebString& key_string) { | 992 int BlinkPlatformImpl::domKeyEnumFromString(const WebString& key_string) { |
| 1007 return static_cast<int>( | 993 return static_cast<int>( |
| 1008 ui::KeycodeConverter::KeyStringToDomKey(key_string.utf8())); | 994 ui::KeycodeConverter::KeyStringToDomKey(key_string.utf8())); |
| 1009 } | 995 } |
| 1010 | 996 |
| 1011 } // namespace content | 997 } // namespace content |
| OLD | NEW |