| 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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 void BlinkPlatformImpl::UpdateWebThreadTLS(blink::WebThread* thread, | 411 void BlinkPlatformImpl::UpdateWebThreadTLS(blink::WebThread* thread, |
| 412 base::WaitableEvent* event) { | 412 base::WaitableEvent* event) { |
| 413 DCHECK(!current_thread_slot_.Get()); | 413 DCHECK(!current_thread_slot_.Get()); |
| 414 current_thread_slot_.Set(thread); | 414 current_thread_slot_.Set(thread); |
| 415 event->Signal(); | 415 event->Signal(); |
| 416 } | 416 } |
| 417 | 417 |
| 418 BlinkPlatformImpl::~BlinkPlatformImpl() { | 418 BlinkPlatformImpl::~BlinkPlatformImpl() { |
| 419 } | 419 } |
| 420 | 420 |
| 421 WebURLLoader* BlinkPlatformImpl::createURLLoader() { | |
| 422 ChildThreadImpl* child_thread = ChildThreadImpl::current(); | |
| 423 // There may be no child thread in RenderViewTests. These tests can still use | |
| 424 // data URLs to bypass the ResourceDispatcher. | |
| 425 return new WebURLLoaderImpl( | |
| 426 child_thread ? child_thread->resource_dispatcher() : NULL, | |
| 427 base::WrapUnique(currentThread()->getWebTaskRunner()->clone())); | |
| 428 } | |
| 429 | |
| 430 blink::WebSocketHandle* BlinkPlatformImpl::createWebSocketHandle() { | 421 blink::WebSocketHandle* BlinkPlatformImpl::createWebSocketHandle() { |
| 431 return new WebSocketBridge; | 422 return new WebSocketBridge; |
| 432 } | 423 } |
| 433 | 424 |
| 434 WebString BlinkPlatformImpl::userAgent() { | 425 WebString BlinkPlatformImpl::userAgent() { |
| 435 return blink::WebString::fromUTF8(GetContentClient()->GetUserAgent()); | 426 return blink::WebString::fromUTF8(GetContentClient()->GetUserAgent()); |
| 436 } | 427 } |
| 437 | 428 |
| 438 WebData BlinkPlatformImpl::parseDataURL(const WebURL& url, | 429 WebData BlinkPlatformImpl::parseDataURL(const WebURL& url, |
| 439 WebString& mimetype_out, | 430 WebString& mimetype_out, |
| (...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1024 return WebString::fromUTF8(ui::KeycodeConverter::DomKeyToKeyString( | 1015 return WebString::fromUTF8(ui::KeycodeConverter::DomKeyToKeyString( |
| 1025 static_cast<ui::DomKey>(dom_key))); | 1016 static_cast<ui::DomKey>(dom_key))); |
| 1026 } | 1017 } |
| 1027 | 1018 |
| 1028 int BlinkPlatformImpl::domKeyEnumFromString(const WebString& key_string) { | 1019 int BlinkPlatformImpl::domKeyEnumFromString(const WebString& key_string) { |
| 1029 return static_cast<int>( | 1020 return static_cast<int>( |
| 1030 ui::KeycodeConverter::KeyStringToDomKey(key_string.utf8())); | 1021 ui::KeycodeConverter::KeyStringToDomKey(key_string.utf8())); |
| 1031 } | 1022 } |
| 1032 | 1023 |
| 1033 } // namespace content | 1024 } // namespace content |
| OLD | NEW |