| 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 "mojo/services/html_viewer/blink_platform_impl.h" | 5 #include "mojo/services/html_viewer/blink_platform_impl.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/rand_util.h" | 9 #include "base/rand_util.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| 11 #include "base/synchronization/waitable_event.h" | 11 #include "base/synchronization/waitable_event.h" |
| 12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 13 #include "mojo/public/cpp/application/application_impl.h" | 13 #include "mojo/public/cpp/application/application_impl.h" |
| 14 #include "mojo/services/html_viewer/webcookiejar_impl.h" | 14 #include "mojo/services/html_viewer/webcookiejar_impl.h" |
| 15 #include "mojo/services/html_viewer/websockethandle_impl.h" |
| 15 #include "mojo/services/html_viewer/webthread_impl.h" | 16 #include "mojo/services/html_viewer/webthread_impl.h" |
| 16 #include "mojo/services/html_viewer/weburlloader_impl.h" | 17 #include "mojo/services/html_viewer/weburlloader_impl.h" |
| 17 #include "net/base/data_url.h" | 18 #include "net/base/data_url.h" |
| 18 #include "net/base/mime_util.h" | 19 #include "net/base/mime_util.h" |
| 19 #include "net/base/net_errors.h" | 20 #include "net/base/net_errors.h" |
| 20 #include "third_party/WebKit/public/platform/WebWaitableEvent.h" | 21 #include "third_party/WebKit/public/platform/WebWaitableEvent.h" |
| 21 | 22 |
| 22 namespace mojo { | 23 namespace mojo { |
| 23 namespace { | 24 namespace { |
| 24 | 25 |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 const unsigned char* BlinkPlatformImpl::getTraceCategoryEnabledFlag( | 144 const unsigned char* BlinkPlatformImpl::getTraceCategoryEnabledFlag( |
| 144 const char* category_name) { | 145 const char* category_name) { |
| 145 static const unsigned char buf[] = "*"; | 146 static const unsigned char buf[] = "*"; |
| 146 return buf; | 147 return buf; |
| 147 } | 148 } |
| 148 | 149 |
| 149 blink::WebURLLoader* BlinkPlatformImpl::createURLLoader() { | 150 blink::WebURLLoader* BlinkPlatformImpl::createURLLoader() { |
| 150 return new WebURLLoaderImpl(network_service_.get()); | 151 return new WebURLLoaderImpl(network_service_.get()); |
| 151 } | 152 } |
| 152 | 153 |
| 154 blink::WebSocketHandle* BlinkPlatformImpl::createWebSocketHandle() { |
| 155 return new WebSocketHandleImpl(network_service_.get()); |
| 156 } |
| 157 |
| 153 blink::WebString BlinkPlatformImpl::userAgent() { | 158 blink::WebString BlinkPlatformImpl::userAgent() { |
| 154 return blink::WebString::fromUTF8(kUserAgentString); | 159 return blink::WebString::fromUTF8(kUserAgentString); |
| 155 } | 160 } |
| 156 | 161 |
| 157 blink::WebData BlinkPlatformImpl::parseDataURL( | 162 blink::WebData BlinkPlatformImpl::parseDataURL( |
| 158 const blink::WebURL& url, | 163 const blink::WebURL& url, |
| 159 blink::WebString& mimetype_out, | 164 blink::WebString& mimetype_out, |
| 160 blink::WebString& charset_out) { | 165 blink::WebString& charset_out) { |
| 161 std::string mimetype, charset, data; | 166 std::string mimetype, charset, data; |
| 162 if (net::DataURL::Parse(url, &mimetype, &charset, &data) | 167 if (net::DataURL::Parse(url, &mimetype, &charset, &data) |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 } | 220 } |
| 216 | 221 |
| 217 // static | 222 // static |
| 218 void BlinkPlatformImpl::DestroyCurrentThread(void* thread) { | 223 void BlinkPlatformImpl::DestroyCurrentThread(void* thread) { |
| 219 WebThreadImplForMessageLoop* impl = | 224 WebThreadImplForMessageLoop* impl = |
| 220 static_cast<WebThreadImplForMessageLoop*>(thread); | 225 static_cast<WebThreadImplForMessageLoop*>(thread); |
| 221 delete impl; | 226 delete impl; |
| 222 } | 227 } |
| 223 | 228 |
| 224 } // namespace mojo | 229 } // namespace mojo |
| OLD | NEW |