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

Side by Side Diff: webkit/glue/webthread_impl.cc

Issue 9582043: Convert uses of int ms to TimeDelta in webkit/glue and webkit/tools. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 9 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 | webkit/tools/test_shell/layout_test_controller.cc » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // An implementation of WebThread in terms of base::MessageLoop and 5 // An implementation of WebThread in terms of base::MessageLoop and
6 // base::Thread 6 // base::Thread
7 7
8 #include "webkit/glue/webthread_impl.h" 8 #include "webkit/glue/webthread_impl.h"
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 void WebThreadImplForMessageLoop::postTask(Task* task) { 98 void WebThreadImplForMessageLoop::postTask(Task* task) {
99 message_loop_->PostTask( 99 message_loop_->PostTask(
100 FROM_HERE, base::Bind(&WebKit::WebThread::Task::run, base::Owned(task))); 100 FROM_HERE, base::Bind(&WebKit::WebThread::Task::run, base::Owned(task)));
101 } 101 }
102 102
103 void WebThreadImplForMessageLoop::postDelayedTask( 103 void WebThreadImplForMessageLoop::postDelayedTask(
104 Task* task, long long delay_ms) { 104 Task* task, long long delay_ms) {
105 message_loop_->PostDelayedTask( 105 message_loop_->PostDelayedTask(
106 FROM_HERE, 106 FROM_HERE,
107 base::Bind(&WebKit::WebThread::Task::run, base::Owned(task)), 107 base::Bind(&WebKit::WebThread::Task::run, base::Owned(task)),
108 delay_ms); 108 base::TimeDelta::FromMilliseconds(delay_ms));
109 } 109 }
110 110
111 void WebThreadImplForMessageLoop::enterRunLoop() { 111 void WebThreadImplForMessageLoop::enterRunLoop() {
112 CHECK(IsCurrentThread()); 112 CHECK(IsCurrentThread());
113 CHECK(!MessageLoop::current()->is_running()); // We don't support nesting. 113 CHECK(!MessageLoop::current()->is_running()); // We don't support nesting.
114 MessageLoop::current()->Run(); 114 MessageLoop::current()->Run();
115 } 115 }
116 116
117 void WebThreadImplForMessageLoop::exitRunLoop() { 117 void WebThreadImplForMessageLoop::exitRunLoop() {
118 CHECK(IsCurrentThread()); 118 CHECK(IsCurrentThread());
119 CHECK(MessageLoop::current()->is_running()); 119 CHECK(MessageLoop::current()->is_running());
120 MessageLoop::current()->Quit(); 120 MessageLoop::current()->Quit();
121 } 121 }
122 122
123 bool WebThreadImplForMessageLoop::IsCurrentThread() const { 123 bool WebThreadImplForMessageLoop::IsCurrentThread() const {
124 return message_loop_->BelongsToCurrentThread(); 124 return message_loop_->BelongsToCurrentThread();
125 } 125 }
126 126
127 WebThreadImplForMessageLoop::~WebThreadImplForMessageLoop() { 127 WebThreadImplForMessageLoop::~WebThreadImplForMessageLoop() {
128 } 128 }
129 129
130 } 130 }
OLDNEW
« no previous file with comments | « no previous file | webkit/tools/test_shell/layout_test_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698