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

Side by Side Diff: jingle/glue/pseudotcp_adapter.cc

Issue 7812036: Update base/timer.h code to pass through Location from call sites. (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
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/glue/pseudotcp_adapter.h" 5 #include "jingle/glue/pseudotcp_adapter.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/time.h" 8 #include "base/time.h"
9 #include "net/base/address_list.h" 9 #include "net/base/address_list.h"
10 #include "net/base/completion_callback.h" 10 #include "net/base/completion_callback.h"
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 if (result < 0) { 363 if (result < 0) {
364 LOG(WARNING) << "Write failed. Error code: " << result; 364 LOG(WARNING) << "Write failed. Error code: " << result;
365 } 365 }
366 } 366 }
367 367
368 void PseudoTcpAdapter::Core::AdjustClock() { 368 void PseudoTcpAdapter::Core::AdjustClock() {
369 long timeout = 0; 369 long timeout = 0;
370 if (pseudo_tcp_.GetNextClock(PseudoTcp::Now(), timeout)) { 370 if (pseudo_tcp_.GetNextClock(PseudoTcp::Now(), timeout)) {
371 timer_.Stop(); 371 timer_.Stop();
372 timer_.Start(base::TimeDelta::FromMilliseconds(std::max(timeout, 0L)), this, 372 timer_.Start(base::TimeDelta::FromMilliseconds(std::max(timeout, 0L)), this,
373 &PseudoTcpAdapter::Core::HandleTcpClock); 373 &PseudoTcpAdapter::Core::HandleTcpClock, FROM_HERE);
374 } 374 }
375 } 375 }
376 376
377 void PseudoTcpAdapter::Core::HandleTcpClock() { 377 void PseudoTcpAdapter::Core::HandleTcpClock() {
378 // Reference the Core in case a callback deletes the adapter. 378 // Reference the Core in case a callback deletes the adapter.
379 scoped_refptr<Core> core(this); 379 scoped_refptr<Core> core(this);
380 380
381 pseudo_tcp_.NotifyClock(PseudoTcp::Now()); 381 pseudo_tcp_.NotifyClock(PseudoTcp::Now());
382 AdjustClock(); 382 AdjustClock();
383 } 383 }
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 DCHECK(CalledOnValidThread()); 499 DCHECK(CalledOnValidThread());
500 core_->SetAckDelay(delay_ms); 500 core_->SetAckDelay(delay_ms);
501 } 501 }
502 502
503 void PseudoTcpAdapter::SetNoDelay(bool no_delay) { 503 void PseudoTcpAdapter::SetNoDelay(bool no_delay) {
504 DCHECK(CalledOnValidThread()); 504 DCHECK(CalledOnValidThread());
505 core_->SetNoDelay(no_delay); 505 core_->SetNoDelay(no_delay);
506 } 506 }
507 507
508 } // namespace jingle_glue 508 } // namespace jingle_glue
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698