| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 #include "content/child/background_sync/background_sync_provider.h" | 42 #include "content/child/background_sync/background_sync_provider.h" |
| 43 #include "content/child/child_thread_impl.h" | 43 #include "content/child/child_thread_impl.h" |
| 44 #include "content/child/content_child_helpers.h" | 44 #include "content/child/content_child_helpers.h" |
| 45 #include "content/child/notifications/notification_dispatcher.h" | 45 #include "content/child/notifications/notification_dispatcher.h" |
| 46 #include "content/child/notifications/notification_manager.h" | 46 #include "content/child/notifications/notification_manager.h" |
| 47 #include "content/child/push_messaging/push_dispatcher.h" | 47 #include "content/child/push_messaging/push_dispatcher.h" |
| 48 #include "content/child/push_messaging/push_provider.h" | 48 #include "content/child/push_messaging/push_provider.h" |
| 49 #include "content/child/thread_safe_sender.h" | 49 #include "content/child/thread_safe_sender.h" |
| 50 #include "content/child/web_url_loader_impl.h" | 50 #include "content/child/web_url_loader_impl.h" |
| 51 #include "content/child/web_url_request_util.h" | 51 #include "content/child/web_url_request_util.h" |
| 52 #include "content/child/websocket_bridge.h" |
| 52 #include "content/child/worker_thread_registry.h" | 53 #include "content/child/worker_thread_registry.h" |
| 53 #include "content/public/common/content_client.h" | 54 #include "content/public/common/content_client.h" |
| 54 #include "net/base/data_url.h" | 55 #include "net/base/data_url.h" |
| 55 #include "net/base/net_errors.h" | 56 #include "net/base/net_errors.h" |
| 56 #include "third_party/WebKit/public/platform/WebData.h" | 57 #include "third_party/WebKit/public/platform/WebData.h" |
| 57 #include "third_party/WebKit/public/platform/WebFloatPoint.h" | 58 #include "third_party/WebKit/public/platform/WebFloatPoint.h" |
| 58 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" | 59 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" |
| 59 #include "third_party/WebKit/public/platform/WebString.h" | 60 #include "third_party/WebKit/public/platform/WebString.h" |
| 60 #include "third_party/WebKit/public/platform/WebURL.h" | 61 #include "third_party/WebKit/public/platform/WebURL.h" |
| 61 #include "ui/base/layout.h" | 62 #include "ui/base/layout.h" |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 void BlinkPlatformImpl::UpdateWebThreadTLS(blink::WebThread* thread, | 403 void BlinkPlatformImpl::UpdateWebThreadTLS(blink::WebThread* thread, |
| 403 base::WaitableEvent* event) { | 404 base::WaitableEvent* event) { |
| 404 DCHECK(!current_thread_slot_.Get()); | 405 DCHECK(!current_thread_slot_.Get()); |
| 405 current_thread_slot_.Set(thread); | 406 current_thread_slot_.Set(thread); |
| 406 event->Signal(); | 407 event->Signal(); |
| 407 } | 408 } |
| 408 | 409 |
| 409 BlinkPlatformImpl::~BlinkPlatformImpl() { | 410 BlinkPlatformImpl::~BlinkPlatformImpl() { |
| 410 } | 411 } |
| 411 | 412 |
| 413 blink::WebSocketHandle* BlinkPlatformImpl::createWebSocketHandle() { |
| 414 return new WebSocketBridge; |
| 415 } |
| 416 |
| 412 WebString BlinkPlatformImpl::userAgent() { | 417 WebString BlinkPlatformImpl::userAgent() { |
| 413 return blink::WebString::fromUTF8(GetContentClient()->GetUserAgent()); | 418 return blink::WebString::fromUTF8(GetContentClient()->GetUserAgent()); |
| 414 } | 419 } |
| 415 | 420 |
| 416 WebData BlinkPlatformImpl::parseDataURL(const WebURL& url, | 421 WebData BlinkPlatformImpl::parseDataURL(const WebURL& url, |
| 417 WebString& mimetype_out, | 422 WebString& mimetype_out, |
| 418 WebString& charset_out) { | 423 WebString& charset_out) { |
| 419 std::string mime_type, char_set, data; | 424 std::string mime_type, char_set, data; |
| 420 if (net::DataURL::Parse(url, &mime_type, &char_set, &data) && | 425 if (net::DataURL::Parse(url, &mime_type, &char_set, &data) && |
| 421 mime_util::IsSupportedMimeType(mime_type)) { | 426 mime_util::IsSupportedMimeType(mime_type)) { |
| (...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 983 return WebString::fromUTF8(ui::KeycodeConverter::DomKeyToKeyString( | 988 return WebString::fromUTF8(ui::KeycodeConverter::DomKeyToKeyString( |
| 984 static_cast<ui::DomKey>(dom_key))); | 989 static_cast<ui::DomKey>(dom_key))); |
| 985 } | 990 } |
| 986 | 991 |
| 987 int BlinkPlatformImpl::domKeyEnumFromString(const WebString& key_string) { | 992 int BlinkPlatformImpl::domKeyEnumFromString(const WebString& key_string) { |
| 988 return static_cast<int>( | 993 return static_cast<int>( |
| 989 ui::KeycodeConverter::KeyStringToDomKey(key_string.utf8())); | 994 ui::KeycodeConverter::KeyStringToDomKey(key_string.utf8())); |
| 990 } | 995 } |
| 991 | 996 |
| 992 } // namespace content | 997 } // namespace content |
| OLD | NEW |