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

Side by Side Diff: remoting/host/policy_hack/nat_policy.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 | « remoting/client/plugin/chromoting_instance.cc ('k') | remoting/jingle_glue/iq_sender.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 // Most of this code is copied from: 5 // Most of this code is copied from:
6 // src/chrome/browser/policy/asynchronous_policy_loader.{h,cc} 6 // src/chrome/browser/policy/asynchronous_policy_loader.{h,cc}
7 7
8 #include "remoting/host/policy_hack/nat_policy.h" 8 #include "remoting/host/policy_hack/nat_policy.h"
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 DCHECK(OnPolicyThread()); 70 DCHECK(OnPolicyThread());
71 ScheduleReloadTask( 71 ScheduleReloadTask(
72 base::TimeDelta::FromMinutes(kFallbackReloadDelayMinutes)); 72 base::TimeDelta::FromMinutes(kFallbackReloadDelayMinutes));
73 } 73 }
74 74
75 void NatPolicy::ScheduleReloadTask(const base::TimeDelta& delay) { 75 void NatPolicy::ScheduleReloadTask(const base::TimeDelta& delay) {
76 DCHECK(OnPolicyThread()); 76 DCHECK(OnPolicyThread());
77 message_loop_proxy_->PostDelayedTask( 77 message_loop_proxy_->PostDelayedTask(
78 FROM_HERE, 78 FROM_HERE,
79 base::Bind(&NatPolicy::Reload, weak_factory_.GetWeakPtr()), 79 base::Bind(&NatPolicy::Reload, weak_factory_.GetWeakPtr()),
80 delay.InMilliseconds()); 80 delay);
81 } 81 }
82 82
83 bool NatPolicy::OnPolicyThread() const { 83 bool NatPolicy::OnPolicyThread() const {
84 return message_loop_proxy_->BelongsToCurrentThread(); 84 return message_loop_proxy_->BelongsToCurrentThread();
85 } 85 }
86 86
87 void NatPolicy::UpdateNatPolicy(base::DictionaryValue* new_policy) { 87 void NatPolicy::UpdateNatPolicy(base::DictionaryValue* new_policy) {
88 DCHECK(OnPolicyThread()); 88 DCHECK(OnPolicyThread());
89 bool new_nat_enabled_state = false; 89 bool new_nat_enabled_state = false;
90 if (!new_policy->HasKey(kNatPolicyName)) { 90 if (!new_policy->HasKey(kNatPolicyName)) {
(...skipping 12 matching lines...) Expand all
103 if (!first_state_published_ || 103 if (!first_state_published_ ||
104 (new_nat_enabled_state != current_nat_enabled_state_)) { 104 (new_nat_enabled_state != current_nat_enabled_state_)) {
105 first_state_published_ = true; 105 first_state_published_ = true;
106 current_nat_enabled_state_ = new_nat_enabled_state; 106 current_nat_enabled_state_ = new_nat_enabled_state;
107 nat_enabled_cb_.Run(current_nat_enabled_state_); 107 nat_enabled_cb_.Run(current_nat_enabled_state_);
108 } 108 }
109 } 109 }
110 110
111 } // namespace policy_hack 111 } // namespace policy_hack
112 } // namespace remoting 112 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/client/plugin/chromoting_instance.cc ('k') | remoting/jingle_glue/iq_sender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698