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

Side by Side Diff: net/test/url_request/url_request_failed_job.h

Issue 2676033002: Give URLRequestJob::GetResponseCode a better default implementation. (Closed)
Patch Set: Add headers Created 3 years, 10 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 | net/test/url_request/url_request_failed_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) 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 NET_TEST_URL_REQUEST_URL_REQUEST_FAILED_JOB_H_ 5 #ifndef NET_TEST_URL_REQUEST_URL_REQUEST_FAILED_JOB_H_
6 #define NET_TEST_URL_REQUEST_URL_REQUEST_FAILED_JOB_H_ 6 #define NET_TEST_URL_REQUEST_URL_REQUEST_FAILED_JOB_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 23 matching lines...) Expand all
34 int net_error); 34 int net_error);
35 35
36 // Same as above, except that the job fails at FailurePhase.START. 36 // Same as above, except that the job fails at FailurePhase.START.
37 URLRequestFailedJob(URLRequest* request, 37 URLRequestFailedJob(URLRequest* request,
38 NetworkDelegate* network_delegate, 38 NetworkDelegate* network_delegate,
39 int net_error); 39 int net_error);
40 40
41 // URLRequestJob implementation: 41 // URLRequestJob implementation:
42 void Start() override; 42 void Start() override;
43 int ReadRawData(IOBuffer* buf, int buf_size) override; 43 int ReadRawData(IOBuffer* buf, int buf_size) override;
44 int GetResponseCode() const override;
45 void GetResponseInfo(HttpResponseInfo* info) override; 44 void GetResponseInfo(HttpResponseInfo* info) override;
46 void PopulateNetErrorDetails(NetErrorDetails* details) const override; 45 void PopulateNetErrorDetails(NetErrorDetails* details) const override;
47 int64_t GetTotalReceivedBytes() const override; 46 int64_t GetTotalReceivedBytes() const override;
48 47
49 // Adds the testing URLs to the URLRequestFilter. 48 // Adds the testing URLs to the URLRequestFilter.
50 static void AddUrlHandler(); 49 static void AddUrlHandler();
51 static void AddUrlHandlerForHostname(const std::string& hostname); 50 static void AddUrlHandlerForHostname(const std::string& hostname);
52 51
53 // Given a net error code, constructs a mock URL that will return that error 52 // Given a net error code, constructs a mock URL that will return that error
54 // asynchronously when started. |net_error| must be a valid net error code 53 // asynchronously when started. |net_error| must be a valid net error code
(...skipping 28 matching lines...) Expand all
83 int64_t total_received_bytes_; 82 int64_t total_received_bytes_;
84 83
85 base::WeakPtrFactory<URLRequestFailedJob> weak_factory_; 84 base::WeakPtrFactory<URLRequestFailedJob> weak_factory_;
86 85
87 DISALLOW_COPY_AND_ASSIGN(URLRequestFailedJob); 86 DISALLOW_COPY_AND_ASSIGN(URLRequestFailedJob);
88 }; 87 };
89 88
90 } // namespace net 89 } // namespace net
91 90
92 #endif // NET_TEST_URL_REQUEST_URL_REQUEST_FAILED_JOB_H_ 91 #endif // NET_TEST_URL_REQUEST_URL_REQUEST_FAILED_JOB_H_
OLDNEW
« no previous file with comments | « no previous file | net/test/url_request/url_request_failed_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698