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 25 matching lines...) Expand all Loading... |
36 #include "components/mime_util/mime_util.h" | 36 #include "components/mime_util/mime_util.h" |
37 #include "components/scheduler/child/webthread_impl_for_worker_scheduler.h" | 37 #include "components/scheduler/child/webthread_impl_for_worker_scheduler.h" |
38 #include "content/app/resources/grit/content_resources.h" | 38 #include "content/app/resources/grit/content_resources.h" |
39 #include "content/app/strings/grit/content_strings.h" | 39 #include "content/app/strings/grit/content_strings.h" |
40 #include "content/child/background_sync/background_sync_provider.h" | 40 #include "content/child/background_sync/background_sync_provider.h" |
41 #include "content/child/background_sync/background_sync_provider_thread_proxy.h" | 41 #include "content/child/background_sync/background_sync_provider_thread_proxy.h" |
42 #include "content/child/bluetooth/web_bluetooth_impl.h" | 42 #include "content/child/bluetooth/web_bluetooth_impl.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/navigator_connect/navigator_connect_provider.h" | 46 #include "content/child/navigator_connect/service_port_provider.h" |
47 #include "content/child/notifications/notification_dispatcher.h" | 47 #include "content/child/notifications/notification_dispatcher.h" |
48 #include "content/child/notifications/notification_manager.h" | 48 #include "content/child/notifications/notification_manager.h" |
49 #include "content/child/permissions/permission_dispatcher.h" | 49 #include "content/child/permissions/permission_dispatcher.h" |
50 #include "content/child/permissions/permission_dispatcher_thread_proxy.h" | 50 #include "content/child/permissions/permission_dispatcher_thread_proxy.h" |
51 #include "content/child/push_messaging/push_dispatcher.h" | 51 #include "content/child/push_messaging/push_dispatcher.h" |
52 #include "content/child/push_messaging/push_provider.h" | 52 #include "content/child/push_messaging/push_provider.h" |
53 #include "content/child/thread_safe_sender.h" | 53 #include "content/child/thread_safe_sender.h" |
54 #include "content/child/web_discardable_memory_impl.h" | 54 #include "content/child/web_discardable_memory_impl.h" |
55 #include "content/child/web_memory_dump_provider_adapter.h" | 55 #include "content/child/web_memory_dump_provider_adapter.h" |
56 #include "content/child/web_process_memory_dump_impl.h" | 56 #include "content/child/web_process_memory_dump_impl.h" |
(...skipping 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1185 } | 1185 } |
1186 | 1186 |
1187 blink::WebPushProvider* BlinkPlatformImpl::pushProvider() { | 1187 blink::WebPushProvider* BlinkPlatformImpl::pushProvider() { |
1188 if (!thread_safe_sender_.get() || !push_dispatcher_.get()) | 1188 if (!thread_safe_sender_.get() || !push_dispatcher_.get()) |
1189 return nullptr; | 1189 return nullptr; |
1190 | 1190 |
1191 return PushProvider::ThreadSpecificInstance(thread_safe_sender_.get(), | 1191 return PushProvider::ThreadSpecificInstance(thread_safe_sender_.get(), |
1192 push_dispatcher_.get()); | 1192 push_dispatcher_.get()); |
1193 } | 1193 } |
1194 | 1194 |
1195 blink::WebNavigatorConnectProvider* | 1195 blink::WebServicePortProvider* BlinkPlatformImpl::createServicePortProvider( |
1196 BlinkPlatformImpl::navigatorConnectProvider() { | 1196 blink::WebServicePortProviderClient* client) { |
1197 if (!thread_safe_sender_.get()) | 1197 return new ServicePortProvider(client, main_thread_task_runner_); |
1198 return nullptr; | |
1199 | |
1200 return NavigatorConnectProvider::ThreadSpecificInstance( | |
1201 thread_safe_sender_.get(), main_thread_task_runner_); | |
1202 } | 1198 } |
1203 | 1199 |
1204 blink::WebPermissionClient* BlinkPlatformImpl::permissionClient() { | 1200 blink::WebPermissionClient* BlinkPlatformImpl::permissionClient() { |
1205 if (!permission_client_.get()) | 1201 if (!permission_client_.get()) |
1206 return nullptr; | 1202 return nullptr; |
1207 | 1203 |
1208 if (IsMainThread()) | 1204 if (IsMainThread()) |
1209 return permission_client_.get(); | 1205 return permission_client_.get(); |
1210 | 1206 |
1211 return PermissionDispatcherThreadProxy::GetThreadInstance( | 1207 return PermissionDispatcherThreadProxy::GetThreadInstance( |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1378 return WebString::fromUTF8(ui::KeycodeConverter::DomCodeToCodeString( | 1374 return WebString::fromUTF8(ui::KeycodeConverter::DomCodeToCodeString( |
1379 static_cast<ui::DomCode>(dom_code))); | 1375 static_cast<ui::DomCode>(dom_code))); |
1380 } | 1376 } |
1381 | 1377 |
1382 int BlinkPlatformImpl::domEnumFromCodeString(const WebString& code) { | 1378 int BlinkPlatformImpl::domEnumFromCodeString(const WebString& code) { |
1383 return static_cast<int>(ui::KeycodeConverter::CodeStringToDomCode( | 1379 return static_cast<int>(ui::KeycodeConverter::CodeStringToDomCode( |
1384 code.utf8().data())); | 1380 code.utf8().data())); |
1385 } | 1381 } |
1386 | 1382 |
1387 } // namespace content | 1383 } // namespace content |
OLD | NEW |