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

Side by Side Diff: mock_http_fetcher.h

Issue 4131005: AU: Push seeks in http fetching to the progress percentage. (Closed) Base URL: http://git.chromium.org/git/update_engine.git
Patch Set: fix for review Created 10 years, 1 month 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 | « http_fetcher.h ('k') | multi_http_fetcher.h » ('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) 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 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_MOCK_HTTP_FETCHER_H__ 5 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_MOCK_HTTP_FETCHER_H__
6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_MOCK_HTTP_FETCHER_H__ 6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_MOCK_HTTP_FETCHER_H__
7 7
8 #include <vector> 8 #include <vector>
9 #include <glib.h> 9 #include <glib.h>
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 17 matching lines...) Expand all
28 // the transfer begins. 28 // the transfer begins.
29 MockHttpFetcher(const char* data, size_t size) 29 MockHttpFetcher(const char* data, size_t size)
30 : sent_size_(0), timeout_source_(NULL), timout_tag_(0), paused_(false) { 30 : sent_size_(0), timeout_source_(NULL), timout_tag_(0), paused_(false) {
31 data_.insert(data_.end(), data, data + size); 31 data_.insert(data_.end(), data, data + size);
32 } 32 }
33 33
34 // Cleans up all internal state. Does not notify delegate 34 // Cleans up all internal state. Does not notify delegate
35 ~MockHttpFetcher(); 35 ~MockHttpFetcher();
36 36
37 // Ignores this. 37 // Ignores this.
38 virtual void SetOffset(off_t offset) {} 38 virtual void SetOffset(off_t offset) {
39 sent_size_ = offset;
40 if (delegate_)
41 delegate_->SeekToOffset(offset);
42 }
39 43
40 // Begins the transfer if it hasn't already begun. 44 // Begins the transfer if it hasn't already begun.
41 virtual void BeginTransfer(const std::string& url); 45 virtual void BeginTransfer(const std::string& url);
42 46
43 // If the transfer is in progress, aborts the transfer early. 47 // If the transfer is in progress, aborts the transfer early.
44 // The transfer cannot be resumed. 48 // The transfer cannot be resumed.
45 virtual void TerminateTransfer(); 49 virtual void TerminateTransfer();
46 50
47 // Suspend the mock transfer. 51 // Suspend the mock transfer.
48 virtual void Pause(); 52 virtual void Pause();
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 91
88 // True iff the fetcher is paused. 92 // True iff the fetcher is paused.
89 bool paused_; 93 bool paused_;
90 94
91 DISALLOW_COPY_AND_ASSIGN(MockHttpFetcher); 95 DISALLOW_COPY_AND_ASSIGN(MockHttpFetcher);
92 }; 96 };
93 97
94 } // namespace chromeos_update_engine 98 } // namespace chromeos_update_engine
95 99
96 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_MOCK_HTTP_FETCHER_H__ 100 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_MOCK_HTTP_FETCHER_H__
OLDNEW
« no previous file with comments | « http_fetcher.h ('k') | multi_http_fetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698