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 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/rand_util.h" | 10 #include "base/rand_util.h" |
11 #include "base/stl_util.h" | 11 #include "base/stl_util.h" |
12 #include "base/synchronization/waitable_event.h" | 12 #include "base/synchronization/waitable_event.h" |
13 #include "base/thread_task_runner_handle.h" | |
13 #include "base/threading/platform_thread.h" | 14 #include "base/threading/platform_thread.h" |
14 #include "base/time/time.h" | 15 #include "base/time/time.h" |
15 #include "components/html_viewer/blink_resource_constants.h" | 16 #include "components/html_viewer/blink_resource_constants.h" |
16 #include "components/html_viewer/web_clipboard_impl.h" | 17 #include "components/html_viewer/web_clipboard_impl.h" |
17 #include "components/html_viewer/web_cookie_jar_impl.h" | 18 #include "components/html_viewer/web_cookie_jar_impl.h" |
18 #include "components/html_viewer/web_message_port_channel_impl.h" | 19 #include "components/html_viewer/web_message_port_channel_impl.h" |
19 #include "components/html_viewer/web_socket_handle_impl.h" | 20 #include "components/html_viewer/web_socket_handle_impl.h" |
20 #include "components/html_viewer/web_thread_impl.h" | 21 #include "components/html_viewer/web_thread_impl.h" |
21 #include "components/html_viewer/web_url_loader_impl.h" | 22 #include "components/html_viewer/web_url_loader_impl.h" |
22 #include "net/base/data_url.h" | 23 #include "net/base/data_url.h" |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
255 return new WebThreadImpl(name); | 256 return new WebThreadImpl(name); |
256 } | 257 } |
257 | 258 |
258 blink::WebThread* BlinkPlatformImpl::currentThread() { | 259 blink::WebThread* BlinkPlatformImpl::currentThread() { |
259 WebThreadImplForMessageLoop* thread = | 260 WebThreadImplForMessageLoop* thread = |
260 static_cast<WebThreadImplForMessageLoop*>(current_thread_slot_.Get()); | 261 static_cast<WebThreadImplForMessageLoop*>(current_thread_slot_.Get()); |
261 if (thread) | 262 if (thread) |
262 return (thread); | 263 return (thread); |
263 | 264 |
264 scoped_refptr<base::MessageLoopProxy> message_loop = | 265 scoped_refptr<base::MessageLoopProxy> message_loop = |
265 base::MessageLoopProxy::current(); | 266 base::MessageLoopProxy::current(); |
msw
2015/04/28 17:50:11
This file might need an explicit base/message_loop
| |
266 if (!message_loop.get()) | 267 if (!message_loop.get()) |
267 return NULL; | 268 return NULL; |
268 | 269 |
269 thread = new WebThreadImplForMessageLoop(message_loop.get()); | 270 thread = new WebThreadImplForMessageLoop(message_loop.get()); |
270 current_thread_slot_.Set(thread); | 271 current_thread_slot_.Set(thread); |
271 return thread; | 272 return thread; |
272 } | 273 } |
273 | 274 |
274 void BlinkPlatformImpl::yieldCurrentThread() { | 275 void BlinkPlatformImpl::yieldCurrentThread() { |
275 base::PlatformThread::YieldCurrentThread(); | 276 base::PlatformThread::YieldCurrentThread(); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
311 } | 312 } |
312 | 313 |
313 // static | 314 // static |
314 void BlinkPlatformImpl::DestroyCurrentThread(void* thread) { | 315 void BlinkPlatformImpl::DestroyCurrentThread(void* thread) { |
315 WebThreadImplForMessageLoop* impl = | 316 WebThreadImplForMessageLoop* impl = |
316 static_cast<WebThreadImplForMessageLoop*>(thread); | 317 static_cast<WebThreadImplForMessageLoop*>(thread); |
317 delete impl; | 318 delete impl; |
318 } | 319 } |
319 | 320 |
320 } // namespace html_viewer | 321 } // namespace html_viewer |
OLD | NEW |