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

Side by Side Diff: jingle/notifier/communicator/login.cc

Issue 7825026: Revert "Currently, base/timer.cc calls PostTask with FROM_HERE as the Location, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « jingle/glue/pseudotcp_adapter.cc ('k') | media/audio/audio_input_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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "jingle/notifier/communicator/login.h" 5 #include "jingle/notifier/communicator/login.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/rand_util.h" 10 #include "base/rand_util.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 reconnect_timer_.Stop(); 110 reconnect_timer_.Stop();
111 } 111 }
112 112
113 void Login::TryReconnect() { 113 void Login::TryReconnect() {
114 DCHECK_GT(reconnect_interval_.InSeconds(), 0); 114 DCHECK_GT(reconnect_interval_.InSeconds(), 0);
115 single_attempt_.reset(); 115 single_attempt_.reset();
116 reconnect_timer_.Stop(); 116 reconnect_timer_.Stop();
117 VLOG(1) << "Reconnecting in " 117 VLOG(1) << "Reconnecting in "
118 << reconnect_interval_.InSeconds() << " seconds"; 118 << reconnect_interval_.InSeconds() << " seconds";
119 reconnect_timer_.Start( 119 reconnect_timer_.Start(
120 FROM_HERE, reconnect_interval_, this, &Login::DoReconnect); 120 reconnect_interval_, this, &Login::DoReconnect);
121 delegate_->OnDisconnect(); 121 delegate_->OnDisconnect();
122 } 122 }
123 123
124 void Login::DoReconnect() { 124 void Login::DoReconnect() {
125 // Double reconnect time up to 30 minutes. 125 // Double reconnect time up to 30 minutes.
126 const base::TimeDelta kMaxReconnectInterval = 126 const base::TimeDelta kMaxReconnectInterval =
127 base::TimeDelta::FromMinutes(30); 127 base::TimeDelta::FromMinutes(30);
128 reconnect_interval_ *= 2; 128 reconnect_interval_ *= 2;
129 if (reconnect_interval_ > kMaxReconnectInterval) 129 if (reconnect_interval_ > kMaxReconnectInterval)
130 reconnect_interval_ = kMaxReconnectInterval; 130 reconnect_interval_ = kMaxReconnectInterval;
131 VLOG(1) << "Reconnecting..."; 131 VLOG(1) << "Reconnecting...";
132 StartConnection(); 132 StartConnection();
133 } 133 }
134 134
135 } // namespace notifier 135 } // namespace notifier
OLDNEW
« no previous file with comments | « jingle/glue/pseudotcp_adapter.cc ('k') | media/audio/audio_input_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698