Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: components/html_viewer/blink_platform_impl.cc

Issue 1589463002: compositor worker: Use a WebThread for the compositor thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: self.nit Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | components/scheduler/child/compositor_worker_scheduler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | components/scheduler/child/compositor_worker_scheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698