| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 #include "content/child/permissions/permission_dispatcher.h" | 47 #include "content/child/permissions/permission_dispatcher.h" |
| 48 #include "content/child/permissions/permission_dispatcher_thread_proxy.h" | 48 #include "content/child/permissions/permission_dispatcher_thread_proxy.h" |
| 49 #include "content/child/push_messaging/push_dispatcher.h" | 49 #include "content/child/push_messaging/push_dispatcher.h" |
| 50 #include "content/child/push_messaging/push_provider.h" | 50 #include "content/child/push_messaging/push_provider.h" |
| 51 #include "content/child/thread_safe_sender.h" | 51 #include "content/child/thread_safe_sender.h" |
| 52 #include "content/child/web_url_loader_impl.h" | 52 #include "content/child/web_url_loader_impl.h" |
| 53 #include "content/child/web_url_request_util.h" | 53 #include "content/child/web_url_request_util.h" |
| 54 #include "content/child/websocket_bridge.h" | 54 #include "content/child/websocket_bridge.h" |
| 55 #include "content/child/worker_thread_registry.h" | 55 #include "content/child/worker_thread_registry.h" |
| 56 #include "content/public/common/content_client.h" | 56 #include "content/public/common/content_client.h" |
| 57 #include "content/public/common/service_registry.h" |
| 57 #include "net/base/data_url.h" | 58 #include "net/base/data_url.h" |
| 58 #include "net/base/net_errors.h" | 59 #include "net/base/net_errors.h" |
| 59 #include "third_party/WebKit/public/platform/WebData.h" | 60 #include "third_party/WebKit/public/platform/WebData.h" |
| 60 #include "third_party/WebKit/public/platform/WebFloatPoint.h" | 61 #include "third_party/WebKit/public/platform/WebFloatPoint.h" |
| 61 #include "third_party/WebKit/public/platform/WebMemoryDumpProvider.h" | 62 #include "third_party/WebKit/public/platform/WebMemoryDumpProvider.h" |
| 62 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" | 63 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" |
| 63 #include "third_party/WebKit/public/platform/WebString.h" | 64 #include "third_party/WebKit/public/platform/WebString.h" |
| 64 #include "third_party/WebKit/public/platform/WebURL.h" | 65 #include "third_party/WebKit/public/platform/WebURL.h" |
| 65 #include "ui/base/layout.h" | 66 #include "ui/base/layout.h" |
| 66 #include "ui/events/gestures/blink/web_gesture_curve_impl.h" | 67 #include "ui/events/gestures/blink/web_gesture_curve_impl.h" |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 // ChildThread may not exist in some tests. | 385 // ChildThread may not exist in some tests. |
| 385 if (ChildThreadImpl::current()) { | 386 if (ChildThreadImpl::current()) { |
| 386 thread_safe_sender_ = ChildThreadImpl::current()->thread_safe_sender(); | 387 thread_safe_sender_ = ChildThreadImpl::current()->thread_safe_sender(); |
| 387 notification_dispatcher_ = | 388 notification_dispatcher_ = |
| 388 ChildThreadImpl::current()->notification_dispatcher(); | 389 ChildThreadImpl::current()->notification_dispatcher(); |
| 389 push_dispatcher_ = ChildThreadImpl::current()->push_dispatcher(); | 390 push_dispatcher_ = ChildThreadImpl::current()->push_dispatcher(); |
| 390 permission_client_.reset(new PermissionDispatcher( | 391 permission_client_.reset(new PermissionDispatcher( |
| 391 ChildThreadImpl::current()->service_registry())); | 392 ChildThreadImpl::current()->service_registry())); |
| 392 main_thread_sync_provider_.reset( | 393 main_thread_sync_provider_.reset( |
| 393 new BackgroundSyncProvider(main_thread_task_runner_.get())); | 394 new BackgroundSyncProvider(main_thread_task_runner_.get())); |
| 395 |
| 396 ServiceRegistry* registry = ChildThreadImpl::current()->service_registry(); |
| 397 registry->ConnectToRemoteService(mojo::GetProxy(&url_loader_factory_)); |
| 394 } | 398 } |
| 395 } | 399 } |
| 396 | 400 |
| 397 void BlinkPlatformImpl::WaitUntilWebThreadTLSUpdate( | 401 void BlinkPlatformImpl::WaitUntilWebThreadTLSUpdate( |
| 398 scheduler::WebThreadBase* thread) { | 402 scheduler::WebThreadBase* thread) { |
| 399 base::WaitableEvent event(false, false); | 403 base::WaitableEvent event(false, false); |
| 400 thread->GetTaskRunner()->PostTask( | 404 thread->GetTaskRunner()->PostTask( |
| 401 FROM_HERE, | 405 FROM_HERE, |
| 402 base::Bind(&BlinkPlatformImpl::UpdateWebThreadTLS, base::Unretained(this), | 406 base::Bind(&BlinkPlatformImpl::UpdateWebThreadTLS, base::Unretained(this), |
| 403 base::Unretained(thread), base::Unretained(&event))); | 407 base::Unretained(thread), base::Unretained(&event))); |
| (...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 999 return WebString::fromUTF8(ui::KeycodeConverter::DomKeyToKeyString( | 1003 return WebString::fromUTF8(ui::KeycodeConverter::DomKeyToKeyString( |
| 1000 static_cast<ui::DomKey>(dom_key))); | 1004 static_cast<ui::DomKey>(dom_key))); |
| 1001 } | 1005 } |
| 1002 | 1006 |
| 1003 int BlinkPlatformImpl::domKeyEnumFromString(const WebString& key_string) { | 1007 int BlinkPlatformImpl::domKeyEnumFromString(const WebString& key_string) { |
| 1004 return static_cast<int>( | 1008 return static_cast<int>( |
| 1005 ui::KeycodeConverter::KeyStringToDomKey(key_string.utf8())); | 1009 ui::KeycodeConverter::KeyStringToDomKey(key_string.utf8())); |
| 1006 } | 1010 } |
| 1007 | 1011 |
| 1008 } // namespace content | 1012 } // namespace content |
| OLD | NEW |