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

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

Issue 2515383004: Revert of Send encoded_body_length to renderer when response completed (1/3) (Closed)
Patch Set: Created 4 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) 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 26 matching lines...) Expand all
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; 44 int GetResponseCode() const override;
45 void GetResponseInfo(HttpResponseInfo* info) override; 45 void GetResponseInfo(HttpResponseInfo* info) override;
46 void PopulateNetErrorDetails(NetErrorDetails* details) const override; 46 void PopulateNetErrorDetails(NetErrorDetails* details) const override;
47 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
55 // other than net::OK. Passing net::ERR_IO_PENDING for |net_error| causes the 54 // other than net::OK. Passing net::ERR_IO_PENDING for |net_error| causes the
56 // resulting request to hang. 55 // resulting request to hang.
57 static GURL GetMockHttpUrl(int net_error); 56 static GURL GetMockHttpUrl(int net_error);
(...skipping 15 matching lines...) Expand all
73 const std::string& hostname); 72 const std::string& hostname);
74 73
75 protected: 74 protected:
76 ~URLRequestFailedJob() override; 75 ~URLRequestFailedJob() override;
77 void StartAsync(); 76 void StartAsync();
78 77
79 private: 78 private:
80 HttpResponseInfo response_info_; 79 HttpResponseInfo response_info_;
81 const FailurePhase phase_; 80 const FailurePhase phase_;
82 const int net_error_; 81 const int net_error_;
83 int64_t total_received_bytes_;
84 82
85 base::WeakPtrFactory<URLRequestFailedJob> weak_factory_; 83 base::WeakPtrFactory<URLRequestFailedJob> weak_factory_;
86 84
87 DISALLOW_COPY_AND_ASSIGN(URLRequestFailedJob); 85 DISALLOW_COPY_AND_ASSIGN(URLRequestFailedJob);
88 }; 86 };
89 87
90 } // namespace net 88 } // namespace net
91 89
92 #endif // NET_TEST_URL_REQUEST_URL_REQUEST_FAILED_JOB_H_ 90 #endif // NET_TEST_URL_REQUEST_URL_REQUEST_FAILED_JOB_H_
OLDNEW
« no previous file with comments | « content/common/resource_request_completion_status.h ('k') | net/test/url_request/url_request_failed_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698