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 "components/html_viewer/blink_platform_impl.h" | 5 #include "components/html_viewer/blink_platform_impl.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "components/scheduler/child/webthread_impl_for_worker_scheduler.h" | 27 #include "components/scheduler/child/webthread_impl_for_worker_scheduler.h" |
28 #include "components/scheduler/renderer/renderer_scheduler.h" | 28 #include "components/scheduler/renderer/renderer_scheduler.h" |
29 #include "components/scheduler/renderer/webthread_impl_for_renderer_scheduler.h" | 29 #include "components/scheduler/renderer/webthread_impl_for_renderer_scheduler.h" |
30 #include "mojo/common/user_agent.h" | 30 #include "mojo/common/user_agent.h" |
31 #include "mojo/shell/public/cpp/application_impl.h" | 31 #include "mojo/shell/public/cpp/application_impl.h" |
32 #include "mojo/shell/public/cpp/connect.h" | 32 #include "mojo/shell/public/cpp/connect.h" |
33 #include "net/base/data_url.h" | 33 #include "net/base/data_url.h" |
34 #include "net/base/ip_address_number.h" | 34 #include "net/base/ip_address_number.h" |
35 #include "net/base/net_errors.h" | 35 #include "net/base/net_errors.h" |
36 #include "net/base/net_util.h" | 36 #include "net/base/net_util.h" |
| 37 #include "third_party/WebKit/public/platform/URLConversion.h" |
37 #include "third_party/WebKit/public/platform/WebWaitableEvent.h" | 38 #include "third_party/WebKit/public/platform/WebWaitableEvent.h" |
38 #include "ui/base/resource/resource_bundle.h" | 39 #include "ui/base/resource/resource_bundle.h" |
39 #include "ui/events/gestures/blink/web_gesture_curve_impl.h" | 40 #include "ui/events/gestures/blink/web_gesture_curve_impl.h" |
40 #include "url/gurl.h" | 41 #include "url/gurl.h" |
41 | 42 |
42 namespace html_viewer { | 43 namespace html_viewer { |
43 namespace { | 44 namespace { |
44 | 45 |
45 // Allows overriding user agent scring. | 46 // Allows overriding user agent scring. |
46 const char kUserAgentSwitch[] = "user-agent"; | 47 const char kUserAgentSwitch[] = "user-agent"; |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 return createOffscreenGraphicsContext3D(attributes, share_context, &gl_info); | 162 return createOffscreenGraphicsContext3D(attributes, share_context, &gl_info); |
162 } | 163 } |
163 | 164 |
164 blink::WebGraphicsContext3D* | 165 blink::WebGraphicsContext3D* |
165 BlinkPlatformImpl::createOffscreenGraphicsContext3D( | 166 BlinkPlatformImpl::createOffscreenGraphicsContext3D( |
166 const blink::WebGraphicsContext3D::Attributes& attributes, | 167 const blink::WebGraphicsContext3D::Attributes& attributes, |
167 blink::WebGraphicsContext3D* share_context, | 168 blink::WebGraphicsContext3D* share_context, |
168 blink::WebGraphicsContext3D::WebGraphicsInfo* gl_info) { | 169 blink::WebGraphicsContext3D::WebGraphicsInfo* gl_info) { |
169 // TODO(penghuang): Use the app from the right HTMLDocument. | 170 // TODO(penghuang): Use the app from the right HTMLDocument. |
170 return WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( | 171 return WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( |
171 global_state_, app_, GURL(attributes.topDocumentURL), attributes, | 172 global_state_, app_, blink::WebStringToGURL(attributes.topDocumentURL), |
172 share_context, gl_info); | 173 attributes, share_context, gl_info); |
173 } | 174 } |
174 | 175 |
175 blink::WebGraphicsContext3D* | 176 blink::WebGraphicsContext3D* |
176 BlinkPlatformImpl::createOffscreenGraphicsContext3D( | 177 BlinkPlatformImpl::createOffscreenGraphicsContext3D( |
177 const blink::WebGraphicsContext3D::Attributes& attributes) { | 178 const blink::WebGraphicsContext3D::Attributes& attributes) { |
178 return createOffscreenGraphicsContext3D(attributes, nullptr, nullptr); | 179 return createOffscreenGraphicsContext3D(attributes, nullptr, nullptr); |
179 } | 180 } |
180 | 181 |
181 blink::WebGraphicsContext3DProvider* | 182 blink::WebGraphicsContext3DProvider* |
182 BlinkPlatformImpl::createSharedOffscreenGraphicsContext3DProvider() { | 183 BlinkPlatformImpl::createSharedOffscreenGraphicsContext3DProvider() { |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 BlinkPlatformImpl::notificationManager() { | 302 BlinkPlatformImpl::notificationManager() { |
302 return &web_notification_manager_; | 303 return &web_notification_manager_; |
303 } | 304 } |
304 | 305 |
305 void BlinkPlatformImpl::UpdateWebThreadTLS(blink::WebThread* thread) { | 306 void BlinkPlatformImpl::UpdateWebThreadTLS(blink::WebThread* thread) { |
306 DCHECK(!current_thread_slot_.Get()); | 307 DCHECK(!current_thread_slot_.Get()); |
307 current_thread_slot_.Set(thread); | 308 current_thread_slot_.Set(thread); |
308 } | 309 } |
309 | 310 |
310 } // namespace html_viewer | 311 } // namespace html_viewer |
OLD | NEW |