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

Side by Side Diff: remoting/client/plugin/chromoting_instance.cc

Issue 9572038: Convert uses of int ms to TimeDelta in jingle and remoting. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix nits. 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 | « jingle/glue/thread_wrapper_unittest.cc ('k') | remoting/host/policy_hack/nat_policy.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 #include "remoting/client/plugin/chromoting_instance.h" 5 #include "remoting/client/plugin/chromoting_instance.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 base::Bind(&ChromotingInstance::SendOutgoingIq, AsWeakPtr()), 354 base::Bind(&ChromotingInstance::SendOutgoingIq, AsWeakPtr()),
355 plugin_message_loop_, 355 plugin_message_loop_,
356 context_.network_message_loop()); 356 context_.network_message_loop());
357 357
358 // Kick off the connection. 358 // Kick off the connection.
359 client_->Start(xmpp_proxy_); 359 client_->Start(xmpp_proxy_);
360 360
361 // Start timer that periodically sends perf stats. 361 // Start timer that periodically sends perf stats.
362 plugin_message_loop_->PostDelayedTask( 362 plugin_message_loop_->PostDelayedTask(
363 FROM_HERE, base::Bind(&ChromotingInstance::SendPerfStats, AsWeakPtr()), 363 FROM_HERE, base::Bind(&ChromotingInstance::SendPerfStats, AsWeakPtr()),
364 kPerfStatsIntervalMs); 364 base::TimeDelta::FromMilliseconds(kPerfStatsIntervalMs));
365 365
366 VLOG(1) << "Connection status: Initializing"; 366 VLOG(1) << "Connection status: Initializing";
367 SetConnectionState(STATE_INITIALIZING, ERROR_NONE); 367 SetConnectionState(STATE_INITIALIZING, ERROR_NONE);
368 } 368 }
369 369
370 void ChromotingInstance::Disconnect() { 370 void ChromotingInstance::Disconnect() {
371 DCHECK(plugin_message_loop_->BelongsToCurrentThread()); 371 DCHECK(plugin_message_loop_->BelongsToCurrentThread());
372 372
373 LOG(INFO) << "Disconnecting from host."; 373 LOG(INFO) << "Disconnecting from host.";
374 if (client_.get()) { 374 if (client_.get()) {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 GetScriptableObject()->SendIq(iq); 424 GetScriptableObject()->SendIq(iq);
425 } 425 }
426 426
427 void ChromotingInstance::SendPerfStats() { 427 void ChromotingInstance::SendPerfStats() {
428 if (!client_.get()) { 428 if (!client_.get()) {
429 return; 429 return;
430 } 430 }
431 431
432 plugin_message_loop_->PostDelayedTask( 432 plugin_message_loop_->PostDelayedTask(
433 FROM_HERE, base::Bind(&ChromotingInstance::SendPerfStats, AsWeakPtr()), 433 FROM_HERE, base::Bind(&ChromotingInstance::SendPerfStats, AsWeakPtr()),
434 kPerfStatsIntervalMs); 434 base::TimeDelta::FromMilliseconds(kPerfStatsIntervalMs));
435 435
436 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); 436 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue());
437 ChromotingStats* stats = client_->GetStats(); 437 ChromotingStats* stats = client_->GetStats();
438 data->SetDouble("videoBandwidth", stats->video_bandwidth()->Rate()); 438 data->SetDouble("videoBandwidth", stats->video_bandwidth()->Rate());
439 data->SetDouble("videoFrameRate", stats->video_frame_rate()->Rate()); 439 data->SetDouble("videoFrameRate", stats->video_frame_rate()->Rate());
440 data->SetDouble("captureLatency", stats->video_capture_ms()->Average()); 440 data->SetDouble("captureLatency", stats->video_capture_ms()->Average());
441 data->SetDouble("encodeLatency", stats->video_encode_ms()->Average()); 441 data->SetDouble("encodeLatency", stats->video_encode_ms()->Average());
442 data->SetDouble("decodeLatency", stats->video_decode_ms()->Average()); 442 data->SetDouble("decodeLatency", stats->video_decode_ms()->Average());
443 data->SetDouble("renderLatency", stats->video_paint_ms()->Average()); 443 data->SetDouble("renderLatency", stats->video_paint_ms()->Average());
444 data->SetDouble("roundtripLatency", stats->round_trip_ms()->Average()); 444 data->SetDouble("roundtripLatency", stats->round_trip_ms()->Average());
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); 539 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue());
540 data->SetString("message", message); 540 data->SetString("message", message);
541 PostChromotingMessage("logDebugMessage", data.Pass()); 541 PostChromotingMessage("logDebugMessage", data.Pass());
542 542
543 scriptable_object->LogDebugInfo(message); 543 scriptable_object->LogDebugInfo(message);
544 } 544 }
545 g_logging_to_plugin = false; 545 g_logging_to_plugin = false;
546 } 546 }
547 547
548 } // namespace remoting 548 } // namespace remoting
OLDNEW
« no previous file with comments | « jingle/glue/thread_wrapper_unittest.cc ('k') | remoting/host/policy_hack/nat_policy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698