| 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 |
| 62 using blink::WebData; | 65 using blink::WebData; |
| 63 using blink::WebFallbackThemeEngine; | 66 using blink::WebFallbackThemeEngine; |
| 64 using blink::WebLocalizedString; | 67 using blink::WebLocalizedString; |
| 65 using blink::WebString; | 68 using blink::WebString; |
| 66 using blink::WebThemeEngine; | 69 using blink::WebThemeEngine; |
| 67 using blink::WebURL; | 70 using blink::WebURL; |
| 68 using blink::WebURLError; | 71 using blink::WebURLError; |
| 69 using blink::WebURLLoader; | 72 using blink::WebURLLoader; |
| 70 using blink::scheduler::WebThreadImplForWorkerScheduler; | 73 using blink::scheduler::WebThreadImplForWorkerScheduler; |
| 71 | 74 |
| 72 namespace content { | 75 namespace content { |
| 73 | 76 |
| 74 namespace { | |
| 75 | |
| 76 | |
| 77 } // namespace | |
| 78 | |
| 79 static int ToMessageID(WebLocalizedString::Name name) { | 77 static int ToMessageID(WebLocalizedString::Name name) { |
| 80 switch (name) { | 78 switch (name) { |
| 81 case WebLocalizedString::AXAMPMFieldText: | 79 case WebLocalizedString::AXAMPMFieldText: |
| 82 return IDS_AX_AM_PM_FIELD_TEXT; | 80 return IDS_AX_AM_PM_FIELD_TEXT; |
| 83 case WebLocalizedString::AXCalendarShowMonthSelector: | 81 case WebLocalizedString::AXCalendarShowMonthSelector: |
| 84 return IDS_AX_CALENDAR_SHOW_MONTH_SELECTOR; | 82 return IDS_AX_CALENDAR_SHOW_MONTH_SELECTOR; |
| 85 case WebLocalizedString::AXCalendarShowNextMonth: | 83 case WebLocalizedString::AXCalendarShowNextMonth: |
| 86 return IDS_AX_CALENDAR_SHOW_NEXT_MONTH; | 84 return IDS_AX_CALENDAR_SHOW_NEXT_MONTH; |
| 87 case WebLocalizedString::AXCalendarShowPreviousMonth: | 85 case WebLocalizedString::AXCalendarShowPreviousMonth: |
| 88 return IDS_AX_CALENDAR_SHOW_PREVIOUS_MONTH; | 86 return IDS_AX_CALENDAR_SHOW_PREVIOUS_MONTH; |
| (...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 779 long long BlinkPlatformImpl::databaseGetSpaceAvailableForOrigin( | 777 long long BlinkPlatformImpl::databaseGetSpaceAvailableForOrigin( |
| 780 const blink::WebSecurityOrigin& origin) { | 778 const blink::WebSecurityOrigin& origin) { |
| 781 return 0; | 779 return 0; |
| 782 } | 780 } |
| 783 | 781 |
| 784 bool BlinkPlatformImpl::databaseSetFileSize( | 782 bool BlinkPlatformImpl::databaseSetFileSize( |
| 785 const blink::WebString& vfs_file_name, long long size) { | 783 const blink::WebString& vfs_file_name, long long size) { |
| 786 return false; | 784 return false; |
| 787 } | 785 } |
| 788 | 786 |
| 787 void BlinkPlatformImpl::bindServiceConnector( |
| 788 mojo::ScopedMessagePipeHandle remote_handle) { |
| 789 if (!ChildThreadImpl::current()) |
| 790 return; |
| 791 |
| 792 service_manager::mojom::ConnectorRequest chromium_request; |
| 793 chromium_request.Bind(std::move(remote_handle)); |
| 794 ChildThreadImpl::current() |
| 795 ->GetServiceManagerConnection() |
| 796 ->GetConnector() |
| 797 ->BindRequest(std::move(chromium_request)); |
| 798 } |
| 799 |
| 789 size_t BlinkPlatformImpl::actualMemoryUsageMB() { | 800 size_t BlinkPlatformImpl::actualMemoryUsageMB() { |
| 790 return GetMemoryUsageKB() >> 10; | 801 return GetMemoryUsageKB() >> 10; |
| 791 } | 802 } |
| 792 | 803 |
| 793 size_t BlinkPlatformImpl::numberOfProcessors() { | 804 size_t BlinkPlatformImpl::numberOfProcessors() { |
| 794 return static_cast<size_t>(base::SysInfo::NumberOfProcessors()); | 805 return static_cast<size_t>(base::SysInfo::NumberOfProcessors()); |
| 795 } | 806 } |
| 796 | 807 |
| 797 size_t BlinkPlatformImpl::maxDecodedImageBytes() { | 808 size_t BlinkPlatformImpl::maxDecodedImageBytes() { |
| 798 #if defined(OS_ANDROID) | 809 #if defined(OS_ANDROID) |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 839 return WebString::fromUTF8(ui::KeycodeConverter::DomKeyToKeyString( | 850 return WebString::fromUTF8(ui::KeycodeConverter::DomKeyToKeyString( |
| 840 static_cast<ui::DomKey>(dom_key))); | 851 static_cast<ui::DomKey>(dom_key))); |
| 841 } | 852 } |
| 842 | 853 |
| 843 int BlinkPlatformImpl::domKeyEnumFromString(const WebString& key_string) { | 854 int BlinkPlatformImpl::domKeyEnumFromString(const WebString& key_string) { |
| 844 return static_cast<int>( | 855 return static_cast<int>( |
| 845 ui::KeycodeConverter::KeyStringToDomKey(key_string.utf8())); | 856 ui::KeycodeConverter::KeyStringToDomKey(key_string.utf8())); |
| 846 } | 857 } |
| 847 | 858 |
| 848 } // namespace content | 859 } // namespace content |
| OLD | NEW |