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

Side by Side Diff: src/platform/update_engine/mock_http_fetcher.cc

Issue 466036: AU: Beginnings of delta support (Closed)
Patch Set: Created 11 years 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
OLDNEW
1 // Copyright (c) 2009 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium OS 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 "base/logging.h"
6 #include "update_engine/mock_http_fetcher.h" 5 #include "update_engine/mock_http_fetcher.h"
6 #include <algorithm>
7 #include "chromeos/obsolete_logging.h"
7 8
8 // This is a mac implementation of HttpFetcher which is useful for testing. 9 // This is a mac implementation of HttpFetcher which is useful for testing.
9 10
11 using std::min;
12
10 namespace chromeos_update_engine { 13 namespace chromeos_update_engine {
11 14
12 MockHttpFetcher::~MockHttpFetcher() { 15 MockHttpFetcher::~MockHttpFetcher() {
13 CHECK(!timeout_source_) << "Call TerminateTransfer() before dtor."; 16 CHECK(!timeout_source_) << "Call TerminateTransfer() before dtor.";
14 } 17 }
15 18
16 void MockHttpFetcher::BeginTransfer(const std::string& url) { 19 void MockHttpFetcher::BeginTransfer(const std::string& url) {
17 if (sent_size_ < data_.size()) 20 if (sent_size_ < data_.size())
18 SendData(true); 21 SendData(true);
19 } 22 }
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 93
91 void MockHttpFetcher::Unpause() { 94 void MockHttpFetcher::Unpause() {
92 CHECK(paused_) << "You must pause before unpause."; 95 CHECK(paused_) << "You must pause before unpause.";
93 paused_ = false; 96 paused_ = false;
94 if (sent_size_ < data_.size()) { 97 if (sent_size_ < data_.size()) {
95 SendData(false); 98 SendData(false);
96 } 99 }
97 } 100 }
98 101
99 } // namespace chromeos_update_engine 102 } // namespace chromeos_update_engine
OLDNEW
« no previous file with comments | « src/platform/update_engine/mock_http_fetcher.h ('k') | src/platform/update_engine/omaha_hash_calculator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698