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 <memory> | 9 #include <memory> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 41 #include "content/child/content_child_helpers.h" | 41 #include "content/child/content_child_helpers.h" |
| 42 #include "content/child/notifications/notification_dispatcher.h" | 42 #include "content/child/notifications/notification_dispatcher.h" |
| 43 #include "content/child/notifications/notification_manager.h" | 43 #include "content/child/notifications/notification_manager.h" |
| 44 #include "content/child/push_messaging/push_dispatcher.h" | 44 #include "content/child/push_messaging/push_dispatcher.h" |
| 45 #include "content/child/push_messaging/push_provider.h" | 45 #include "content/child/push_messaging/push_provider.h" |
| 46 #include "content/child/thread_safe_sender.h" | 46 #include "content/child/thread_safe_sender.h" |
| 47 #include "content/child/web_url_loader_impl.h" | 47 #include "content/child/web_url_loader_impl.h" |
| 48 #include "content/child/web_url_request_util.h" | 48 #include "content/child/web_url_request_util.h" |
| 49 #include "content/child/worker_thread_registry.h" | 49 #include "content/child/worker_thread_registry.h" |
| 50 #include "content/public/common/content_client.h" | 50 #include "content/public/common/content_client.h" |
| 51 #include "content/public/common/service_manager_connection.h" | |
| 51 #include "net/base/net_errors.h" | 52 #include "net/base/net_errors.h" |
| 53 #include "services/service_manager/public/cpp/connector.h" | |
| 54 #include "services/service_manager/public/interfaces/connector.mojom.h" | |
| 52 #include "third_party/WebKit/public/platform/WebData.h" | 55 #include "third_party/WebKit/public/platform/WebData.h" |
| 53 #include "third_party/WebKit/public/platform/WebFloatPoint.h" | 56 #include "third_party/WebKit/public/platform/WebFloatPoint.h" |
| 54 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" | 57 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" |
| 55 #include "third_party/WebKit/public/platform/WebString.h" | 58 #include "third_party/WebKit/public/platform/WebString.h" |
| 56 #include "third_party/WebKit/public/platform/WebURL.h" | 59 #include "third_party/WebKit/public/platform/WebURL.h" |
| 57 #include "third_party/WebKit/public/platform/scheduler/child/webthread_impl_for_ worker_scheduler.h" | 60 #include "third_party/WebKit/public/platform/scheduler/child/webthread_impl_for_ worker_scheduler.h" |
| 58 #include "ui/base/layout.h" | 61 #include "ui/base/layout.h" |
| 59 #include "ui/events/gestures/blink/web_gesture_curve_impl.h" | 62 #include "ui/events/gestures/blink/web_gesture_curve_impl.h" |
| 60 #include "ui/events/keycodes/dom/keycode_converter.h" | 63 #include "ui/events/keycodes/dom/keycode_converter.h" |
| 61 | 64 |
| (...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 806 long long BlinkPlatformImpl::databaseGetSpaceAvailableForOrigin( | 809 long long BlinkPlatformImpl::databaseGetSpaceAvailableForOrigin( |
| 807 const blink::WebSecurityOrigin& origin) { | 810 const blink::WebSecurityOrigin& origin) { |
| 808 return 0; | 811 return 0; |
| 809 } | 812 } |
| 810 | 813 |
| 811 bool BlinkPlatformImpl::databaseSetFileSize( | 814 bool BlinkPlatformImpl::databaseSetFileSize( |
| 812 const blink::WebString& vfs_file_name, long long size) { | 815 const blink::WebString& vfs_file_name, long long size) { |
| 813 return false; | 816 return false; |
| 814 } | 817 } |
| 815 | 818 |
| 819 service_manager::mojom::blink::ConnectorPtr | |
| 820 BlinkPlatformImpl::serviceConnector() { | |
|
yzshen1
2016/12/01 21:28:26
If such changes are from another CL Foo. You could
xianglu
2016/12/02 18:11:24
Thanks for the instruction!
| |
| 821 service_manager::mojom::blink::ConnectorPtr blink_ptr; | |
| 822 if (!ChildThreadImpl::current()) | |
| 823 return blink_ptr; | |
| 824 | |
| 825 service_manager::mojom::ConnectorPtr chromium_ptr; | |
| 826 ChildThreadImpl::current() | |
| 827 ->GetServiceManagerConnection() | |
| 828 ->GetConnector() | |
| 829 ->BindRequest(mojo::GetProxy(&chromium_ptr)); | |
| 830 | |
| 831 // Pass the pipe from |chromium_ptr| to |blink_ptr|. | |
| 832 service_manager::mojom::ConnectorPtrInfo chromium_ptr_info = | |
| 833 chromium_ptr.PassInterface(); | |
| 834 DCHECK(chromium_ptr_info.is_valid()); | |
| 835 blink_ptr.Bind(service_manager::mojom::blink::ConnectorPtrInfo( | |
| 836 chromium_ptr_info.PassHandle(), chromium_ptr_info.version())); | |
| 837 DCHECK(blink_ptr.is_bound()); | |
| 838 | |
| 839 return blink_ptr; | |
| 840 } | |
| 841 | |
| 816 blink::WebString BlinkPlatformImpl::signedPublicKeyAndChallengeString( | 842 blink::WebString BlinkPlatformImpl::signedPublicKeyAndChallengeString( |
| 817 unsigned key_size_index, | 843 unsigned key_size_index, |
| 818 const blink::WebString& challenge, | 844 const blink::WebString& challenge, |
| 819 const blink::WebURL& url, | 845 const blink::WebURL& url, |
| 820 const blink::WebURL& top_origin) { | 846 const blink::WebURL& top_origin) { |
| 821 return blink::WebString(""); | 847 return blink::WebString(""); |
| 822 } | 848 } |
| 823 | 849 |
| 824 size_t BlinkPlatformImpl::actualMemoryUsageMB() { | 850 size_t BlinkPlatformImpl::actualMemoryUsageMB() { |
| 825 return GetMemoryUsageKB() >> 10; | 851 return GetMemoryUsageKB() >> 10; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 874 return WebString::fromUTF8(ui::KeycodeConverter::DomKeyToKeyString( | 900 return WebString::fromUTF8(ui::KeycodeConverter::DomKeyToKeyString( |
| 875 static_cast<ui::DomKey>(dom_key))); | 901 static_cast<ui::DomKey>(dom_key))); |
| 876 } | 902 } |
| 877 | 903 |
| 878 int BlinkPlatformImpl::domKeyEnumFromString(const WebString& key_string) { | 904 int BlinkPlatformImpl::domKeyEnumFromString(const WebString& key_string) { |
| 879 return static_cast<int>( | 905 return static_cast<int>( |
| 880 ui::KeycodeConverter::KeyStringToDomKey(key_string.utf8())); | 906 ui::KeycodeConverter::KeyStringToDomKey(key_string.utf8())); |
| 881 } | 907 } |
| 882 | 908 |
| 883 } // namespace content | 909 } // namespace content |
| OLD | NEW |