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

Side by Side Diff: net/url_request/url_request_test_job.h

Issue 10392111: Use ByteStream in downloads system to decouple source and sink. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync'd to LKGR. Created 8 years, 6 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 | « net/base/net_log_event_type_list.h ('k') | net/url_request/url_request_test_job.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 #ifndef NET_URL_REQUEST_URL_REQUEST_TEST_JOB_H_ 5 #ifndef NET_URL_REQUEST_URL_REQUEST_TEST_JOB_H_
6 #define NET_URL_REQUEST_URL_REQUEST_TEST_JOB_H_ 6 #define NET_URL_REQUEST_URL_REQUEST_TEST_JOB_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 int buf_size, 97 int buf_size,
98 int *bytes_read) OVERRIDE; 98 int *bytes_read) OVERRIDE;
99 virtual void Kill() OVERRIDE; 99 virtual void Kill() OVERRIDE;
100 virtual bool GetMimeType(std::string* mime_type) const OVERRIDE; 100 virtual bool GetMimeType(std::string* mime_type) const OVERRIDE;
101 virtual void GetResponseInfo(HttpResponseInfo* info) OVERRIDE; 101 virtual void GetResponseInfo(HttpResponseInfo* info) OVERRIDE;
102 virtual int GetResponseCode() const OVERRIDE; 102 virtual int GetResponseCode() const OVERRIDE;
103 virtual bool IsRedirectResponse(GURL* location, 103 virtual bool IsRedirectResponse(GURL* location,
104 int* http_status_code) OVERRIDE; 104 int* http_status_code) OVERRIDE;
105 105
106 protected: 106 protected:
107 // Override to specify whether the next read done from this job will
108 // return IO pending. This controls whether or not the WAITING state will
109 // transition back to WAITING or to DATA_AVAILABLE after an asynchronous
110 // read is processed.
111 virtual bool NextReadAsync();
112
107 // This is what operation we are going to do next when this job is handled. 113 // This is what operation we are going to do next when this job is handled.
108 // When the stage is DONE, this job will not be put on the queue. 114 // When the stage is DONE, this job will not be put on the queue.
109 enum Stage { WAITING, DATA_AVAILABLE, ALL_DATA, DONE }; 115 enum Stage { WAITING, DATA_AVAILABLE, ALL_DATA, DONE };
110 116
111 virtual ~URLRequestTestJob(); 117 virtual ~URLRequestTestJob();
112 118
113 // Call to process the next opeation, usually sending a notification, and 119 // Call to process the next opeation, usually sending a notification, and
114 // advancing the stage if necessary. THIS MAY DELETE THE OBJECT. 120 // advancing the stage if necessary. THIS MAY DELETE THE OBJECT.
115 void ProcessNextOperation(); 121 void ProcessNextOperation();
116 122
(...skipping 21 matching lines...) Expand all
138 // Holds the buffer for an asynchronous ReadRawData call 144 // Holds the buffer for an asynchronous ReadRawData call
139 IOBuffer* async_buf_; 145 IOBuffer* async_buf_;
140 int async_buf_size_; 146 int async_buf_size_;
141 147
142 base::WeakPtrFactory<URLRequestTestJob> weak_factory_; 148 base::WeakPtrFactory<URLRequestTestJob> weak_factory_;
143 }; 149 };
144 150
145 } // namespace net 151 } // namespace net
146 152
147 #endif // NET_URL_REQUEST_URL_REQUEST_TEST_JOB_H_ 153 #endif // NET_URL_REQUEST_URL_REQUEST_TEST_JOB_H_
OLDNEW
« no previous file with comments | « net/base/net_log_event_type_list.h ('k') | net/url_request/url_request_test_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698