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

Side by Side Diff: chrome_frame/test/test_server.cc

Issue 10019015: Update uses of TimeDelta in chrome_frame/*. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Another rebase onto master. Created 8 years, 8 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 | « chrome_frame/test/perf/chrome_frame_perftest.cc ('k') | chrome_frame/test/test_server_test.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 <windows.h> 5 #include <windows.h>
6 #include <objbase.h> 6 #include <objbase.h>
7 #include <urlmon.h> 7 #include <urlmon.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 int bytes_to_send = std::min(options_.chunk_size_, size - cur_pos_); 331 int bytes_to_send = std::min(options_.chunk_size_, size - cur_pos_);
332 332
333 socket_->Send(chunk_ptr, bytes_to_send); 333 socket_->Send(chunk_ptr, bytes_to_send);
334 VLOG(1) << "Sent(" << cur_pos_ << "," << bytes_to_send << "): " 334 VLOG(1) << "Sent(" << cur_pos_ << "," << bytes_to_send << "): "
335 << base::StringPiece(chunk_ptr, bytes_to_send); 335 << base::StringPiece(chunk_ptr, bytes_to_send);
336 336
337 cur_pos_ += bytes_to_send; 337 cur_pos_ += bytes_to_send;
338 if (cur_pos_ < size) { 338 if (cur_pos_ < size) {
339 MessageLoop::current()->PostDelayedTask( 339 MessageLoop::current()->PostDelayedTask(
340 FROM_HERE, base::Bind(&ConfigurableConnection::SendChunk, this), 340 FROM_HERE, base::Bind(&ConfigurableConnection::SendChunk, this),
341 options_.timeout_); 341 base::TimeDelta::FromMilliseconds(options_.timeout_));
342 } else { 342 } else {
343 socket_ = 0; // close the connection. 343 socket_ = 0; // close the connection.
344 } 344 }
345 } 345 }
346 346
347 void ConfigurableConnection::Close() { 347 void ConfigurableConnection::Close() {
348 socket_ = NULL; 348 socket_ = NULL;
349 } 349 }
350 350
351 void ConfigurableConnection::Send(const std::string& headers, 351 void ConfigurableConnection::Send(const std::string& headers,
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 } 387 }
388 388
389 if (options_.speed_ == SendOptions::DELAYED) { 389 if (options_.speed_ == SendOptions::DELAYED) {
390 data_ = headers; 390 data_ = headers;
391 data_.append(content_length_header); 391 data_.append(content_length_header);
392 data_.append("\r\n"); 392 data_.append("\r\n");
393 } 393 }
394 394
395 MessageLoop::current()->PostDelayedTask( 395 MessageLoop::current()->PostDelayedTask(
396 FROM_HERE, base::Bind(&ConfigurableConnection::SendChunk, this), 396 FROM_HERE, base::Bind(&ConfigurableConnection::SendChunk, this),
397 options.timeout_); 397 base::TimeDelta::FromMilliseconds(options.timeout_));
398 } 398 }
399 399
400 } // namespace test_server 400 } // namespace test_server
OLDNEW
« no previous file with comments | « chrome_frame/test/perf/chrome_frame_perftest.cc ('k') | chrome_frame/test/test_server_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698