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

Side by Side Diff: jingle/glue/pseudotcp_adapter.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 | « content/renderer/render_view.cc ('k') | jingle/notifier/communicator/login.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/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 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 socket_write_pending_ = false; 362 socket_write_pending_ = false;
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(FROM_HERE, 372 timer_.Start(base::TimeDelta::FromMilliseconds(std::max(timeout, 0L)), this,
373 base::TimeDelta::FromMilliseconds(std::max(timeout, 0L)), this,
374 &PseudoTcpAdapter::Core::HandleTcpClock); 373 &PseudoTcpAdapter::Core::HandleTcpClock);
375 } 374 }
376 } 375 }
377 376
378 void PseudoTcpAdapter::Core::HandleTcpClock() { 377 void PseudoTcpAdapter::Core::HandleTcpClock() {
379 // Reference the Core in case a callback deletes the adapter. 378 // Reference the Core in case a callback deletes the adapter.
380 scoped_refptr<Core> core(this); 379 scoped_refptr<Core> core(this);
381 380
382 pseudo_tcp_.NotifyClock(PseudoTcp::Now()); 381 pseudo_tcp_.NotifyClock(PseudoTcp::Now());
383 AdjustClock(); 382 AdjustClock();
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 DCHECK(CalledOnValidThread()); 499 DCHECK(CalledOnValidThread());
501 core_->SetAckDelay(delay_ms); 500 core_->SetAckDelay(delay_ms);
502 } 501 }
503 502
504 void PseudoTcpAdapter::SetNoDelay(bool no_delay) { 503 void PseudoTcpAdapter::SetNoDelay(bool no_delay) {
505 DCHECK(CalledOnValidThread()); 504 DCHECK(CalledOnValidThread());
506 core_->SetNoDelay(no_delay); 505 core_->SetNoDelay(no_delay);
507 } 506 }
508 507
509 } // namespace jingle_glue 508 } // namespace jingle_glue
OLDNEW
« no previous file with comments | « content/renderer/render_view.cc ('k') | jingle/notifier/communicator/login.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698