| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 "content/public/common/service_manager_connection.h" |
| 52 #include "net/base/net_errors.h" | 52 #include "net/base/net_errors.h" |
| 53 #include "third_party/WebKit/public/platform/WebData.h" | 53 #include "third_party/WebKit/public/platform/WebData.h" |
| 54 #include "third_party/WebKit/public/platform/WebFloatPoint.h" | 54 #include "third_party/WebKit/public/platform/WebFloatPoint.h" |
| 55 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" | 55 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" |
| 56 #include "third_party/WebKit/public/platform/WebString.h" | 56 #include "third_party/WebKit/public/platform/WebString.h" |
| 57 #include "third_party/WebKit/public/platform/WebURL.h" | 57 #include "third_party/WebKit/public/platform/WebURL.h" |
| 58 #include "third_party/WebKit/public/platform/scheduler/child/webthread_impl_for_
worker_scheduler.h" | 58 #include "third_party/WebKit/public/platform/scheduler/child/webthread_base.h" |
| 59 #include "third_party/zlib/google/compression_utils.h" | 59 #include "third_party/zlib/google/compression_utils.h" |
| 60 #include "ui/base/layout.h" | 60 #include "ui/base/layout.h" |
| 61 #include "ui/events/gestures/blink/web_gesture_curve_impl.h" | 61 #include "ui/events/gestures/blink/web_gesture_curve_impl.h" |
| 62 #include "ui/events/keycodes/dom/keycode_converter.h" | 62 #include "ui/events/keycodes/dom/keycode_converter.h" |
| 63 | 63 |
| 64 using blink::WebData; | 64 using blink::WebData; |
| 65 using blink::WebFallbackThemeEngine; | 65 using blink::WebFallbackThemeEngine; |
| 66 using blink::WebLocalizedString; | 66 using blink::WebLocalizedString; |
| 67 using blink::WebString; | 67 using blink::WebString; |
| 68 using blink::WebThemeEngine; | 68 using blink::WebThemeEngine; |
| 69 using blink::WebURL; | 69 using blink::WebURL; |
| 70 using blink::WebURLError; | 70 using blink::WebURLError; |
| 71 using blink::WebURLLoader; | 71 using blink::WebURLLoader; |
| 72 using blink::scheduler::WebThreadImplForWorkerScheduler; | |
| 73 | 72 |
| 74 namespace content { | 73 namespace content { |
| 75 | 74 |
| 76 static int ToMessageID(WebLocalizedString::Name name) { | 75 static int ToMessageID(WebLocalizedString::Name name) { |
| 77 switch (name) { | 76 switch (name) { |
| 78 case WebLocalizedString::kAXAMPMFieldText: | 77 case WebLocalizedString::kAXAMPMFieldText: |
| 79 return IDS_AX_AM_PM_FIELD_TEXT; | 78 return IDS_AX_AM_PM_FIELD_TEXT; |
| 80 case WebLocalizedString::kAXCalendarShowMonthSelector: | 79 case WebLocalizedString::kAXCalendarShowMonthSelector: |
| 81 return IDS_AX_CALENDAR_SHOW_MONTH_SELECTOR; | 80 return IDS_AX_CALENDAR_SHOW_MONTH_SELECTOR; |
| 82 case WebLocalizedString::kAXCalendarShowNextMonth: | 81 case WebLocalizedString::kAXCalendarShowNextMonth: |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 WebString BlinkPlatformImpl::UserAgent() { | 392 WebString BlinkPlatformImpl::UserAgent() { |
| 394 return blink::WebString::FromUTF8(GetContentClient()->GetUserAgent()); | 393 return blink::WebString::FromUTF8(GetContentClient()->GetUserAgent()); |
| 395 } | 394 } |
| 396 | 395 |
| 397 WebURLError BlinkPlatformImpl::CancelledError( | 396 WebURLError BlinkPlatformImpl::CancelledError( |
| 398 const WebURL& unreachableURL) const { | 397 const WebURL& unreachableURL) const { |
| 399 return CreateWebURLError(unreachableURL, false, net::ERR_ABORTED); | 398 return CreateWebURLError(unreachableURL, false, net::ERR_ABORTED); |
| 400 } | 399 } |
| 401 | 400 |
| 402 blink::WebThread* BlinkPlatformImpl::CreateThread(const char* name) { | 401 blink::WebThread* BlinkPlatformImpl::CreateThread(const char* name) { |
| 403 std::unique_ptr<WebThreadImplForWorkerScheduler> thread( | 402 std::unique_ptr<blink::scheduler::WebThreadBase> thread = |
| 404 new WebThreadImplForWorkerScheduler(name)); | 403 blink::scheduler::WebThreadBase::CreateWorkerThread( |
| 404 name, base::Thread::Options()); |
| 405 thread->Init(); | 405 thread->Init(); |
| 406 WaitUntilWebThreadTLSUpdate(thread.get()); | 406 WaitUntilWebThreadTLSUpdate(thread.get()); |
| 407 return thread.release(); | 407 return thread.release(); |
| 408 } | 408 } |
| 409 | 409 |
| 410 void BlinkPlatformImpl::SetCompositorThread( | 410 void BlinkPlatformImpl::SetCompositorThread( |
| 411 blink::scheduler::WebThreadBase* compositor_thread) { | 411 blink::scheduler::WebThreadBase* compositor_thread) { |
| 412 compositor_thread_ = compositor_thread; | 412 compositor_thread_ = compositor_thread; |
| 413 if (compositor_thread_) | 413 if (compositor_thread_) |
| 414 WaitUntilWebThreadTLSUpdate(compositor_thread_); | 414 WaitUntilWebThreadTLSUpdate(compositor_thread_); |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 842 blink::WebFeaturePolicy* BlinkPlatformImpl::DuplicateFeaturePolicyWithOrigin( | 842 blink::WebFeaturePolicy* BlinkPlatformImpl::DuplicateFeaturePolicyWithOrigin( |
| 843 const blink::WebFeaturePolicy& policy, | 843 const blink::WebFeaturePolicy& policy, |
| 844 const blink::WebSecurityOrigin& new_origin) { | 844 const blink::WebSecurityOrigin& new_origin) { |
| 845 std::unique_ptr<FeaturePolicy> new_policy = | 845 std::unique_ptr<FeaturePolicy> new_policy = |
| 846 FeaturePolicy::CreateFromPolicyWithOrigin( | 846 FeaturePolicy::CreateFromPolicyWithOrigin( |
| 847 static_cast<const FeaturePolicy&>(policy), url::Origin(new_origin)); | 847 static_cast<const FeaturePolicy&>(policy), url::Origin(new_origin)); |
| 848 return new_policy.release(); | 848 return new_policy.release(); |
| 849 } | 849 } |
| 850 | 850 |
| 851 } // namespace content | 851 } // namespace content |
| OLD | NEW |