OLD | NEW |
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_URL_REQUEST_URL_REQUEST_HTTP_JOB_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_HTTP_JOB_H_ |
6 #define NET_URL_REQUEST_URL_REQUEST_HTTP_JOB_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_HTTP_JOB_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 27 matching lines...) Expand all Loading... |
38 public: | 38 public: |
39 static URLRequestJob* Factory(URLRequest* request, | 39 static URLRequestJob* Factory(URLRequest* request, |
40 NetworkDelegate* network_delegate, | 40 NetworkDelegate* network_delegate, |
41 const std::string& scheme); | 41 const std::string& scheme); |
42 | 42 |
43 protected: | 43 protected: |
44 URLRequestHttpJob(URLRequest* request, | 44 URLRequestHttpJob(URLRequest* request, |
45 NetworkDelegate* network_delegate, | 45 NetworkDelegate* network_delegate, |
46 const HttpUserAgentSettings* http_user_agent_settings); | 46 const HttpUserAgentSettings* http_user_agent_settings); |
47 | 47 |
48 virtual ~URLRequestHttpJob(); | 48 ~URLRequestHttpJob() override; |
49 | 49 |
50 // Overridden from URLRequestJob: | 50 // Overridden from URLRequestJob: |
51 virtual void SetPriority(RequestPriority priority) override; | 51 void SetPriority(RequestPriority priority) override; |
52 virtual void Start() override; | 52 void Start() override; |
53 virtual void Kill() override; | 53 void Kill() override; |
54 | 54 |
55 RequestPriority priority() const { | 55 RequestPriority priority() const { |
56 return priority_; | 56 return priority_; |
57 } | 57 } |
58 | 58 |
59 private: | 59 private: |
60 enum CompletionCause { | 60 enum CompletionCause { |
61 ABORTED, | 61 ABORTED, |
62 FINISHED | 62 FINISHED |
63 }; | 63 }; |
(...skipping 28 matching lines...) Expand all Loading... |
92 void OnStartCompleted(int result); | 92 void OnStartCompleted(int result); |
93 void OnReadCompleted(int result); | 93 void OnReadCompleted(int result); |
94 void NotifyBeforeSendHeadersCallback(int result); | 94 void NotifyBeforeSendHeadersCallback(int result); |
95 void NotifyBeforeSendProxyHeadersCallback( | 95 void NotifyBeforeSendProxyHeadersCallback( |
96 const ProxyInfo& proxy_info, | 96 const ProxyInfo& proxy_info, |
97 HttpRequestHeaders* request_headers); | 97 HttpRequestHeaders* request_headers); |
98 | 98 |
99 void RestartTransactionWithAuth(const AuthCredentials& credentials); | 99 void RestartTransactionWithAuth(const AuthCredentials& credentials); |
100 | 100 |
101 // Overridden from URLRequestJob: | 101 // Overridden from URLRequestJob: |
102 virtual void SetUpload(UploadDataStream* upload) override; | 102 void SetUpload(UploadDataStream* upload) override; |
103 virtual void SetExtraRequestHeaders( | 103 void SetExtraRequestHeaders(const HttpRequestHeaders& headers) override; |
104 const HttpRequestHeaders& headers) override; | 104 LoadState GetLoadState() const override; |
105 virtual LoadState GetLoadState() const override; | 105 UploadProgress GetUploadProgress() const override; |
106 virtual UploadProgress GetUploadProgress() const override; | 106 bool GetMimeType(std::string* mime_type) const override; |
107 virtual bool GetMimeType(std::string* mime_type) const override; | 107 bool GetCharset(std::string* charset) override; |
108 virtual bool GetCharset(std::string* charset) override; | 108 void GetResponseInfo(HttpResponseInfo* info) override; |
109 virtual void GetResponseInfo(HttpResponseInfo* info) override; | 109 void GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const override; |
110 virtual void GetLoadTimingInfo( | 110 bool GetResponseCookies(std::vector<std::string>* cookies) override; |
111 LoadTimingInfo* load_timing_info) const override; | 111 int GetResponseCode() const override; |
112 virtual bool GetResponseCookies(std::vector<std::string>* cookies) override; | 112 Filter* SetupFilter() const override; |
113 virtual int GetResponseCode() const override; | 113 bool CopyFragmentOnRedirect(const GURL& location) const override; |
114 virtual Filter* SetupFilter() const override; | 114 bool IsSafeRedirect(const GURL& location) override; |
115 virtual bool CopyFragmentOnRedirect(const GURL& location) const override; | 115 bool NeedsAuth() override; |
116 virtual bool IsSafeRedirect(const GURL& location) override; | 116 void GetAuthChallengeInfo(scoped_refptr<AuthChallengeInfo>*) override; |
117 virtual bool NeedsAuth() override; | 117 void SetAuth(const AuthCredentials& credentials) override; |
118 virtual void GetAuthChallengeInfo(scoped_refptr<AuthChallengeInfo>*) override; | 118 void CancelAuth() override; |
119 virtual void SetAuth(const AuthCredentials& credentials) override; | 119 void ContinueWithCertificate(X509Certificate* client_cert) override; |
120 virtual void CancelAuth() override; | 120 void ContinueDespiteLastError() override; |
121 virtual void ContinueWithCertificate(X509Certificate* client_cert) override; | 121 void ResumeNetworkStart() override; |
122 virtual void ContinueDespiteLastError() override; | 122 bool ReadRawData(IOBuffer* buf, int buf_size, int* bytes_read) override; |
123 virtual void ResumeNetworkStart() override; | 123 void StopCaching() override; |
124 virtual bool ReadRawData(IOBuffer* buf, int buf_size, | 124 bool GetFullRequestHeaders(HttpRequestHeaders* headers) const override; |
125 int* bytes_read) override; | 125 int64 GetTotalReceivedBytes() const override; |
126 virtual void StopCaching() override; | 126 void DoneReading() override; |
127 virtual bool GetFullRequestHeaders( | 127 void DoneReadingRedirectResponse() override; |
128 HttpRequestHeaders* headers) const override; | |
129 virtual int64 GetTotalReceivedBytes() const override; | |
130 virtual void DoneReading() override; | |
131 virtual void DoneReadingRedirectResponse() override; | |
132 | 128 |
133 virtual HostPortPair GetSocketAddress() const override; | 129 HostPortPair GetSocketAddress() const override; |
134 virtual void NotifyURLRequestDestroyed() override; | 130 void NotifyURLRequestDestroyed() override; |
135 | 131 |
136 void RecordTimer(); | 132 void RecordTimer(); |
137 void ResetTimer(); | 133 void ResetTimer(); |
138 | 134 |
139 virtual void UpdatePacketReadTimes() override; | 135 void UpdatePacketReadTimes() override; |
140 void RecordPacketStats(FilterContext::StatisticSelector statistic) const; | 136 void RecordPacketStats(FilterContext::StatisticSelector statistic) const; |
141 | 137 |
142 void RecordCompressionHistograms(); | 138 void RecordCompressionHistograms(); |
143 bool IsCompressibleContent() const; | 139 bool IsCompressibleContent() const; |
144 | 140 |
145 // Starts the transaction if extensions using the webrequest API do not | 141 // Starts the transaction if extensions using the webrequest API do not |
146 // object. | 142 // object. |
147 void StartTransaction(); | 143 void StartTransaction(); |
148 // If |result| is net::OK, calls StartTransactionInternal. Otherwise notifies | 144 // If |result| is net::OK, calls StartTransactionInternal. Otherwise notifies |
149 // cancellation. | 145 // cancellation. |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 const HttpUserAgentSettings* http_user_agent_settings_; | 269 const HttpUserAgentSettings* http_user_agent_settings_; |
274 | 270 |
275 base::WeakPtrFactory<URLRequestHttpJob> weak_factory_; | 271 base::WeakPtrFactory<URLRequestHttpJob> weak_factory_; |
276 | 272 |
277 DISALLOW_COPY_AND_ASSIGN(URLRequestHttpJob); | 273 DISALLOW_COPY_AND_ASSIGN(URLRequestHttpJob); |
278 }; | 274 }; |
279 | 275 |
280 } // namespace net | 276 } // namespace net |
281 | 277 |
282 #endif // NET_URL_REQUEST_URL_REQUEST_HTTP_JOB_H_ | 278 #endif // NET_URL_REQUEST_URL_REQUEST_HTTP_JOB_H_ |
OLD | NEW |