| 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 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 push_dispatcher_ = ChildThreadImpl::current()->push_dispatcher(); | 388 push_dispatcher_ = ChildThreadImpl::current()->push_dispatcher(); |
| 389 permission_client_.reset(new PermissionDispatcher( | 389 permission_client_.reset(new PermissionDispatcher( |
| 390 ChildThreadImpl::current()->service_registry())); | 390 ChildThreadImpl::current()->service_registry())); |
| 391 main_thread_sync_provider_.reset( | 391 main_thread_sync_provider_.reset( |
| 392 new BackgroundSyncProvider(main_thread_task_runner_.get())); | 392 new BackgroundSyncProvider(main_thread_task_runner_.get())); |
| 393 } | 393 } |
| 394 } | 394 } |
| 395 | 395 |
| 396 void BlinkPlatformImpl::WaitUntilWebThreadTLSUpdate( | 396 void BlinkPlatformImpl::WaitUntilWebThreadTLSUpdate( |
| 397 scheduler::WebThreadBase* thread) { | 397 scheduler::WebThreadBase* thread) { |
| 398 base::WaitableEvent event(false, false); | 398 base::WaitableEvent event(base::WaitableEvent::ResetPolicy::AUTOMATIC, |
| 399 base::WaitableEvent::InitialState::NOT_SIGNALED); |
| 399 thread->GetTaskRunner()->PostTask( | 400 thread->GetTaskRunner()->PostTask( |
| 400 FROM_HERE, | 401 FROM_HERE, |
| 401 base::Bind(&BlinkPlatformImpl::UpdateWebThreadTLS, base::Unretained(this), | 402 base::Bind(&BlinkPlatformImpl::UpdateWebThreadTLS, base::Unretained(this), |
| 402 base::Unretained(thread), base::Unretained(&event))); | 403 base::Unretained(thread), base::Unretained(&event))); |
| 403 event.Wait(); | 404 event.Wait(); |
| 404 } | 405 } |
| 405 | 406 |
| 406 void BlinkPlatformImpl::UpdateWebThreadTLS(blink::WebThread* thread, | 407 void BlinkPlatformImpl::UpdateWebThreadTLS(blink::WebThread* thread, |
| 407 base::WaitableEvent* event) { | 408 base::WaitableEvent* event) { |
| 408 DCHECK(!current_thread_slot_.Get()); | 409 DCHECK(!current_thread_slot_.Get()); |
| (...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 999 return WebString::fromUTF8(ui::KeycodeConverter::DomKeyToKeyString( | 1000 return WebString::fromUTF8(ui::KeycodeConverter::DomKeyToKeyString( |
| 1000 static_cast<ui::DomKey>(dom_key))); | 1001 static_cast<ui::DomKey>(dom_key))); |
| 1001 } | 1002 } |
| 1002 | 1003 |
| 1003 int BlinkPlatformImpl::domKeyEnumFromString(const WebString& key_string) { | 1004 int BlinkPlatformImpl::domKeyEnumFromString(const WebString& key_string) { |
| 1004 return static_cast<int>( | 1005 return static_cast<int>( |
| 1005 ui::KeycodeConverter::KeyStringToDomKey(key_string.utf8())); | 1006 ui::KeycodeConverter::KeyStringToDomKey(key_string.utf8())); |
| 1006 } | 1007 } |
| 1007 | 1008 |
| 1008 } // namespace content | 1009 } // namespace content |
| OLD | NEW |