Convert uses of int ms to TimeDelta in jingle and remoting.
R=sergeyu@chromium.org BUG=108171 Review URL: http://codereview.chromium.org/9572038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@124915 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
jingle/glue
remoting
client
plugin
host
policy_hack
jingle_glue
protocol
@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
@ -141,7 +141,7 @@ class FakeSocket : public net::Socket {
|
|||||||
base::Bind(&FakeSocket::AppendInputPacket,
|
base::Bind(&FakeSocket::AppendInputPacket,
|
||||||
base::Unretained(peer_socket_),
|
base::Unretained(peer_socket_),
|
||||||
std::vector<char>(buf->data(), buf->data() + buf_len)),
|
std::vector<char>(buf->data(), buf->data() + buf_len)),
|
||||||
latency_ms_);
|
base::TimeDelta::FromMilliseconds(latency_ms_));
|
||||||
}
|
}
|
||||||
|
|
||||||
return buf_len;
|
return buf_len;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
@ -147,8 +147,9 @@ TEST_F(ThreadWrapperTest, PostDelayed) {
|
|||||||
MatchMessage(&handler2_, kTestMessage1, data4)))
|
MatchMessage(&handler2_, kTestMessage1, data4)))
|
||||||
.WillOnce(DeleteMessageData());
|
.WillOnce(DeleteMessageData());
|
||||||
|
|
||||||
message_loop_.PostDelayedTask(FROM_HERE, MessageLoop::QuitClosure(),
|
message_loop_.PostDelayedTask(
|
||||||
kMaxTestDelay);
|
FROM_HERE, MessageLoop::QuitClosure(),
|
||||||
|
base::TimeDelta::FromMilliseconds(kMaxTestDelay));
|
||||||
message_loop_.Run();
|
message_loop_.Run();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -197,8 +198,9 @@ TEST_F(ThreadWrapperTest, ClearDelayed) {
|
|||||||
MatchMessage(&handler2_, kTestMessage1, null_data)))
|
MatchMessage(&handler2_, kTestMessage1, null_data)))
|
||||||
.WillOnce(DeleteMessageData());
|
.WillOnce(DeleteMessageData());
|
||||||
|
|
||||||
message_loop_.PostDelayedTask(FROM_HERE, MessageLoop::QuitClosure(),
|
message_loop_.PostDelayedTask(
|
||||||
kMaxTestDelay);
|
FROM_HERE, MessageLoop::QuitClosure(),
|
||||||
|
base::TimeDelta::FromMilliseconds(kMaxTestDelay));
|
||||||
message_loop_.Run();
|
message_loop_.Run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -361,7 +361,7 @@ void ChromotingInstance::Connect(const ClientConfig& config) {
|
|||||||
// Start timer that periodically sends perf stats.
|
// Start timer that periodically sends perf stats.
|
||||||
plugin_message_loop_->PostDelayedTask(
|
plugin_message_loop_->PostDelayedTask(
|
||||||
FROM_HERE, base::Bind(&ChromotingInstance::SendPerfStats, AsWeakPtr()),
|
FROM_HERE, base::Bind(&ChromotingInstance::SendPerfStats, AsWeakPtr()),
|
||||||
kPerfStatsIntervalMs);
|
base::TimeDelta::FromMilliseconds(kPerfStatsIntervalMs));
|
||||||
|
|
||||||
VLOG(1) << "Connection status: Initializing";
|
VLOG(1) << "Connection status: Initializing";
|
||||||
SetConnectionState(STATE_INITIALIZING, ERROR_NONE);
|
SetConnectionState(STATE_INITIALIZING, ERROR_NONE);
|
||||||
@ -431,7 +431,7 @@ void ChromotingInstance::SendPerfStats() {
|
|||||||
|
|
||||||
plugin_message_loop_->PostDelayedTask(
|
plugin_message_loop_->PostDelayedTask(
|
||||||
FROM_HERE, base::Bind(&ChromotingInstance::SendPerfStats, AsWeakPtr()),
|
FROM_HERE, base::Bind(&ChromotingInstance::SendPerfStats, AsWeakPtr()),
|
||||||
kPerfStatsIntervalMs);
|
base::TimeDelta::FromMilliseconds(kPerfStatsIntervalMs));
|
||||||
|
|
||||||
scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue());
|
scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue());
|
||||||
ChromotingStats* stats = client_->GetStats();
|
ChromotingStats* stats = client_->GetStats();
|
||||||
|
@ -77,7 +77,7 @@ void NatPolicy::ScheduleReloadTask(const base::TimeDelta& delay) {
|
|||||||
message_loop_proxy_->PostDelayedTask(
|
message_loop_proxy_->PostDelayedTask(
|
||||||
FROM_HERE,
|
FROM_HERE,
|
||||||
base::Bind(&NatPolicy::Reload, weak_factory_.GetWeakPtr()),
|
base::Bind(&NatPolicy::Reload, weak_factory_.GetWeakPtr()),
|
||||||
delay.InMilliseconds());
|
delay);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NatPolicy::OnPolicyThread() const {
|
bool NatPolicy::OnPolicyThread() const {
|
||||||
|
@ -146,7 +146,7 @@ IqRequest::~IqRequest() {
|
|||||||
void IqRequest::SetTimeout(base::TimeDelta timeout) {
|
void IqRequest::SetTimeout(base::TimeDelta timeout) {
|
||||||
base::MessageLoopProxy::current()->PostDelayedTask(
|
base::MessageLoopProxy::current()->PostDelayedTask(
|
||||||
FROM_HERE, base::Bind(&IqRequest::OnTimeout, AsWeakPtr()),
|
FROM_HERE, base::Bind(&IqRequest::OnTimeout, AsWeakPtr()),
|
||||||
timeout.InMilliseconds());
|
timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IqRequest::CallCallback(const buzz::XmlElement* stanza) {
|
void IqRequest::CallCallback(const buzz::XmlElement* stanza) {
|
||||||
|
@ -63,7 +63,7 @@ TEST(JingleThreadTest, PostDelayedTask) {
|
|||||||
base::Time start = base::Time::Now();
|
base::Time start = base::Time::Now();
|
||||||
thread.message_loop()->PostDelayedTask(
|
thread.message_loop()->PostDelayedTask(
|
||||||
FROM_HERE, base::Bind(&MockCallback::Run, base::Unretained(&task)),
|
FROM_HERE, base::Bind(&MockCallback::Run, base::Unretained(&task)),
|
||||||
kDelayMs);
|
base::TimeDelta::FromMilliseconds(kDelayMs));
|
||||||
event.TimedWait(base::TimeDelta::FromMilliseconds(kDelayTimeoutMs));
|
event.TimedWait(base::TimeDelta::FromMilliseconds(kDelayTimeoutMs));
|
||||||
base::Time end = base::Time::Now();
|
base::Time end = base::Time::Now();
|
||||||
thread.Stop();
|
thread.Stop();
|
||||||
@ -81,7 +81,7 @@ TEST(JingleThreadTest, PostNonNestableDelayedTask) {
|
|||||||
base::Time start = base::Time::Now();
|
base::Time start = base::Time::Now();
|
||||||
thread.message_loop()->PostNonNestableDelayedTask(
|
thread.message_loop()->PostNonNestableDelayedTask(
|
||||||
FROM_HERE, base::Bind(&MockCallback::Run, base::Unretained(&task)),
|
FROM_HERE, base::Bind(&MockCallback::Run, base::Unretained(&task)),
|
||||||
kDelayMs);
|
base::TimeDelta::FromMilliseconds(kDelayMs));
|
||||||
event.TimedWait(base::TimeDelta::FromMilliseconds(kDelayTimeoutMs));
|
event.TimedWait(base::TimeDelta::FromMilliseconds(kDelayTimeoutMs));
|
||||||
base::Time end = base::Time::Now();
|
base::Time end = base::Time::Now();
|
||||||
thread.Stop();
|
thread.Stop();
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
@ -203,8 +203,10 @@ void DatagramConnectionTester::HandleWriteResult(int result) {
|
|||||||
} else if (result > 0) {
|
} else if (result > 0) {
|
||||||
EXPECT_EQ(message_size_, result);
|
EXPECT_EQ(message_size_, result);
|
||||||
packets_sent_++;
|
packets_sent_++;
|
||||||
message_loop_->PostDelayedTask(FROM_HERE, base::Bind(
|
message_loop_->PostDelayedTask(
|
||||||
&DatagramConnectionTester::DoWrite, base::Unretained(this)), delay_ms_);
|
FROM_HERE,
|
||||||
|
base::Bind(&DatagramConnectionTester::DoWrite, base::Unretained(this)),
|
||||||
|
base::TimeDelta::FromMilliseconds(delay_ms_));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user