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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 const blink::WebString& host) const { | 248 const blink::WebString& host) const { |
249 net::IPAddressNumber address; | 249 net::IPAddressNumber address; |
250 if (!net::ParseURLHostnameToNumber(host.utf8(), &address)) | 250 if (!net::ParseURLHostnameToNumber(host.utf8(), &address)) |
251 return false; | 251 return false; |
252 return net::IsIPAddressReserved(address); | 252 return net::IsIPAddressReserved(address); |
253 } | 253 } |
254 | 254 |
255 blink::WebThread* BlinkPlatformImpl::createThread(const char* name) { | 255 blink::WebThread* BlinkPlatformImpl::createThread(const char* name) { |
256 scheduler::WebThreadImplForWorkerScheduler* thread = | 256 scheduler::WebThreadImplForWorkerScheduler* thread = |
257 new scheduler::WebThreadImplForWorkerScheduler(name); | 257 new scheduler::WebThreadImplForWorkerScheduler(name); |
| 258 thread->Init(); |
258 thread->TaskRunner()->PostTask( | 259 thread->TaskRunner()->PostTask( |
259 FROM_HERE, base::Bind(&BlinkPlatformImpl::UpdateWebThreadTLS, | 260 FROM_HERE, base::Bind(&BlinkPlatformImpl::UpdateWebThreadTLS, |
260 base::Unretained(this), thread)); | 261 base::Unretained(this), thread)); |
261 return thread; | 262 return thread; |
262 } | 263 } |
263 | 264 |
264 blink::WebThread* BlinkPlatformImpl::currentThread() { | 265 blink::WebThread* BlinkPlatformImpl::currentThread() { |
265 if (main_thread_->isCurrentThread()) | 266 if (main_thread_->isCurrentThread()) |
266 return main_thread_.get(); | 267 return main_thread_.get(); |
267 return static_cast<blink::WebThread*>(current_thread_slot_.Get()); | 268 return static_cast<blink::WebThread*>(current_thread_slot_.Get()); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 BlinkPlatformImpl::notificationManager() { | 307 BlinkPlatformImpl::notificationManager() { |
307 return &web_notification_manager_; | 308 return &web_notification_manager_; |
308 } | 309 } |
309 | 310 |
310 void BlinkPlatformImpl::UpdateWebThreadTLS(blink::WebThread* thread) { | 311 void BlinkPlatformImpl::UpdateWebThreadTLS(blink::WebThread* thread) { |
311 DCHECK(!current_thread_slot_.Get()); | 312 DCHECK(!current_thread_slot_.Get()); |
312 current_thread_slot_.Set(thread); | 313 current_thread_slot_.Set(thread); |
313 } | 314 } |
314 | 315 |
315 } // namespace html_viewer | 316 } // namespace html_viewer |
OLD | NEW |