| 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 <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 #include "base/threading/platform_thread.h" | 28 #include "base/threading/platform_thread.h" |
| 29 #include "base/time/time.h" | 29 #include "base/time/time.h" |
| 30 #include "blink/public/resources/grit/blink_resources.h" | 30 #include "blink/public/resources/grit/blink_resources.h" |
| 31 #include "content/app/resources/grit/content_resources.h" | 31 #include "content/app/resources/grit/content_resources.h" |
| 32 #include "content/app/strings/grit/content_strings.h" | 32 #include "content/app/strings/grit/content_strings.h" |
| 33 #include "content/child/child_thread.h" | 33 #include "content/child/child_thread.h" |
| 34 #include "content/child/content_child_helpers.h" | 34 #include "content/child/content_child_helpers.h" |
| 35 #include "content/child/geofencing/web_geofencing_provider_impl.h" | 35 #include "content/child/geofencing/web_geofencing_provider_impl.h" |
| 36 #include "content/child/web_discardable_memory_impl.h" | 36 #include "content/child/web_discardable_memory_impl.h" |
| 37 #include "content/child/web_gesture_curve_impl.h" | 37 #include "content/child/web_gesture_curve_impl.h" |
| 38 #include "content/child/web_socket_stream_handle_impl.h" | |
| 39 #include "content/child/web_url_loader_impl.h" | 38 #include "content/child/web_url_loader_impl.h" |
| 40 #include "content/child/websocket_bridge.h" | 39 #include "content/child/websocket_bridge.h" |
| 41 #include "content/child/webthread_impl.h" | 40 #include "content/child/webthread_impl.h" |
| 42 #include "content/child/worker_task_runner.h" | 41 #include "content/child/worker_task_runner.h" |
| 43 #include "content/public/common/content_client.h" | 42 #include "content/public/common/content_client.h" |
| 44 #include "net/base/data_url.h" | 43 #include "net/base/data_url.h" |
| 45 #include "net/base/mime_util.h" | 44 #include "net/base/mime_util.h" |
| 46 #include "net/base/net_errors.h" | 45 #include "net/base/net_errors.h" |
| 47 #include "net/base/net_util.h" | 46 #include "net/base/net_util.h" |
| 48 #include "third_party/WebKit/public/platform/WebConvertableToTraceFormat.h" | 47 #include "third_party/WebKit/public/platform/WebConvertableToTraceFormat.h" |
| 49 #include "third_party/WebKit/public/platform/WebData.h" | 48 #include "third_party/WebKit/public/platform/WebData.h" |
| 50 #include "third_party/WebKit/public/platform/WebFloatPoint.h" | 49 #include "third_party/WebKit/public/platform/WebFloatPoint.h" |
| 51 #include "third_party/WebKit/public/platform/WebString.h" | 50 #include "third_party/WebKit/public/platform/WebString.h" |
| 52 #include "third_party/WebKit/public/platform/WebURL.h" | 51 #include "third_party/WebKit/public/platform/WebURL.h" |
| 53 #include "third_party/WebKit/public/platform/WebWaitableEvent.h" | 52 #include "third_party/WebKit/public/platform/WebWaitableEvent.h" |
| 54 #include "third_party/WebKit/public/web/WebSecurityOrigin.h" | 53 #include "third_party/WebKit/public/web/WebSecurityOrigin.h" |
| 55 #include "ui/base/layout.h" | 54 #include "ui/base/layout.h" |
| 56 | 55 |
| 57 #if !defined(NO_TCMALLOC) && defined(USE_TCMALLOC) && !defined(OS_WIN) | 56 #if !defined(NO_TCMALLOC) && defined(USE_TCMALLOC) && !defined(OS_WIN) |
| 58 #include "third_party/tcmalloc/chromium/src/gperftools/heap-profiler.h" | 57 #include "third_party/tcmalloc/chromium/src/gperftools/heap-profiler.h" |
| 59 #endif | 58 #endif |
| 60 | 59 |
| 61 using blink::WebData; | 60 using blink::WebData; |
| 62 using blink::WebFallbackThemeEngine; | 61 using blink::WebFallbackThemeEngine; |
| 63 using blink::WebLocalizedString; | 62 using blink::WebLocalizedString; |
| 64 using blink::WebString; | 63 using blink::WebString; |
| 65 using blink::WebSocketStreamHandle; | |
| 66 using blink::WebThemeEngine; | 64 using blink::WebThemeEngine; |
| 67 using blink::WebURL; | 65 using blink::WebURL; |
| 68 using blink::WebURLError; | 66 using blink::WebURLError; |
| 69 using blink::WebURLLoader; | 67 using blink::WebURLLoader; |
| 70 | 68 |
| 71 namespace content { | 69 namespace content { |
| 72 | 70 |
| 73 namespace { | 71 namespace { |
| 74 | 72 |
| 75 class WebWaitableEventImpl : public blink::WebWaitableEvent { | 73 class WebWaitableEventImpl : public blink::WebWaitableEvent { |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 } | 432 } |
| 435 | 433 |
| 436 WebURLLoader* BlinkPlatformImpl::createURLLoader() { | 434 WebURLLoader* BlinkPlatformImpl::createURLLoader() { |
| 437 ChildThread* child_thread = ChildThread::current(); | 435 ChildThread* child_thread = ChildThread::current(); |
| 438 // There may be no child thread in RenderViewTests. These tests can still use | 436 // There may be no child thread in RenderViewTests. These tests can still use |
| 439 // data URLs to bypass the ResourceDispatcher. | 437 // data URLs to bypass the ResourceDispatcher. |
| 440 return new WebURLLoaderImpl( | 438 return new WebURLLoaderImpl( |
| 441 child_thread ? child_thread->resource_dispatcher() : NULL); | 439 child_thread ? child_thread->resource_dispatcher() : NULL); |
| 442 } | 440 } |
| 443 | 441 |
| 444 WebSocketStreamHandle* BlinkPlatformImpl::createSocketStreamHandle() { | |
| 445 return new WebSocketStreamHandleImpl; | |
| 446 } | |
| 447 | |
| 448 blink::WebSocketHandle* BlinkPlatformImpl::createWebSocketHandle() { | 442 blink::WebSocketHandle* BlinkPlatformImpl::createWebSocketHandle() { |
| 449 return new WebSocketBridge; | 443 return new WebSocketBridge; |
| 450 } | 444 } |
| 451 | 445 |
| 452 WebString BlinkPlatformImpl::userAgent() { | 446 WebString BlinkPlatformImpl::userAgent() { |
| 453 return WebString::fromUTF8(GetContentClient()->GetUserAgent()); | 447 return WebString::fromUTF8(GetContentClient()->GetUserAgent()); |
| 454 } | 448 } |
| 455 | 449 |
| 456 WebData BlinkPlatformImpl::parseDataURL(const WebURL& url, | 450 WebData BlinkPlatformImpl::parseDataURL(const WebURL& url, |
| 457 WebString& mimetype_out, | 451 WebString& mimetype_out, |
| (...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1204 } | 1198 } |
| 1205 | 1199 |
| 1206 // static | 1200 // static |
| 1207 void BlinkPlatformImpl::DestroyCurrentThread(void* thread) { | 1201 void BlinkPlatformImpl::DestroyCurrentThread(void* thread) { |
| 1208 WebThreadImplForMessageLoop* impl = | 1202 WebThreadImplForMessageLoop* impl = |
| 1209 static_cast<WebThreadImplForMessageLoop*>(thread); | 1203 static_cast<WebThreadImplForMessageLoop*>(thread); |
| 1210 delete impl; | 1204 delete impl; |
| 1211 } | 1205 } |
| 1212 | 1206 |
| 1213 } // namespace content | 1207 } // namespace content |
| OLD | NEW |