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

Side by Side Diff: chrome/browser/predictors/resource_prefetcher.h

Issue 11761022: Fixing possible read on URLRequest when there is no more data. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moving error checking statement. Created 7 years, 11 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 | « no previous file | chrome/browser/predictors/resource_prefetcher.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 #ifndef CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCHER_H_ 5 #ifndef CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCHER_H_
6 #define CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCHER_H_ 6 #define CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCHER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <list> 9 #include <list>
10 #include <vector> 10 #include <vector>
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 // out the Start() call to net::URLRequest for unittesting. 111 // out the Start() call to net::URLRequest for unittesting.
112 virtual void StartURLRequest(net::URLRequest* request); 112 virtual void StartURLRequest(net::URLRequest* request);
113 113
114 // Marks the request as finished, with the given status. 114 // Marks the request as finished, with the given status.
115 void FinishRequest(net::URLRequest* request, Request::PrefetchStatus status); 115 void FinishRequest(net::URLRequest* request, Request::PrefetchStatus status);
116 116
117 // Reads the response data from the response - required for the resource to 117 // Reads the response data from the response - required for the resource to
118 // be cached correctly. Stubbed out during testing. 118 // be cached correctly. Stubbed out during testing.
119 virtual void ReadFullResponse(net::URLRequest* request); 119 virtual void ReadFullResponse(net::URLRequest* request);
120 120
121 // Returns true if the request has more data that needs to be read. If it
122 // returns false, the request should not be referenced again.
123 bool ShouldContinueReadingRequest(net::URLRequest* request, int bytes_read);
124
121 // net::URLRequest::Delegate methods. 125 // net::URLRequest::Delegate methods.
122 virtual void OnReceivedRedirect(net::URLRequest* request, 126 virtual void OnReceivedRedirect(net::URLRequest* request,
123 const GURL& new_url, 127 const GURL& new_url,
124 bool* defer_redirect) OVERRIDE; 128 bool* defer_redirect) OVERRIDE;
125 virtual void OnAuthRequired(net::URLRequest* request, 129 virtual void OnAuthRequired(net::URLRequest* request,
126 net::AuthChallengeInfo* auth_info) OVERRIDE; 130 net::AuthChallengeInfo* auth_info) OVERRIDE;
127 virtual void OnCertificateRequested( 131 virtual void OnCertificateRequested(
128 net::URLRequest* request, 132 net::URLRequest* request,
129 net::SSLCertRequestInfo* cert_request_info) OVERRIDE; 133 net::SSLCertRequestInfo* cert_request_info) OVERRIDE;
130 virtual void OnSSLCertificateError(net::URLRequest* request, 134 virtual void OnSSLCertificateError(net::URLRequest* request,
(...skipping 20 matching lines...) Expand all
151 std::map<net::URLRequest*, Request*> inflight_requests_; 155 std::map<net::URLRequest*, Request*> inflight_requests_;
152 std::list<Request*> request_queue_; 156 std::list<Request*> request_queue_;
153 std::map<std::string, int> host_inflight_counts_; 157 std::map<std::string, int> host_inflight_counts_;
154 158
155 DISALLOW_COPY_AND_ASSIGN(ResourcePrefetcher); 159 DISALLOW_COPY_AND_ASSIGN(ResourcePrefetcher);
156 }; 160 };
157 161
158 } // namespace predictors 162 } // namespace predictors
159 163
160 #endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCHER_H_ 164 #endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCHER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/predictors/resource_prefetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698