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

Side by Side Diff: net/proxy/proxy_service.h

Issue 1684123004: Bypass the DataReductionProxy for all POST requests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resubmitting with upstream branch set to branch from issue 1680893002 Created 4 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
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_PROXY_PROXY_SERVICE_H_ 5 #ifndef NET_PROXY_PROXY_SERVICE_H_
6 #define NET_PROXY_PROXY_SERVICE_H_ 6 #define NET_PROXY_PROXY_SERVICE_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <set> 10 #include <set>
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 // 2. PAC URL 125 // 2. PAC URL
126 // 3. named proxy 126 // 3. named proxy
127 // 127 //
128 // Profiling information for the request is saved to |net_log| if non-NULL. 128 // Profiling information for the request is saved to |net_log| if non-NULL.
129 int ResolveProxy(const GURL& url, 129 int ResolveProxy(const GURL& url,
130 int load_flags, 130 int load_flags,
131 ProxyInfo* results, 131 ProxyInfo* results,
132 const CompletionCallback& callback, 132 const CompletionCallback& callback,
133 PacRequest** pac_request, 133 PacRequest** pac_request,
134 ProxyDelegate* proxy_delegate, 134 ProxyDelegate* proxy_delegate,
135 const std::string& method,
bengr 2016/02/16 20:00:14 Move the method to just after the url.
RyanSturm 2016/02/17 21:46:12 Done.
135 const BoundNetLog& net_log); 136 const BoundNetLog& net_log);
136 137
137 // Returns true if the proxy information could be determined without spawning 138 // Returns true if the proxy information could be determined without spawning
138 // an asynchronous task. Otherwise, |result| is unmodified. 139 // an asynchronous task. Otherwise, |result| is unmodified.
139 bool TryResolveProxySynchronously(const GURL& raw_url, 140 bool TryResolveProxySynchronously(const GURL& raw_url,
140 int load_flags, 141 int load_flags,
141 ProxyInfo* result, 142 ProxyInfo* result,
142 ProxyDelegate* proxy_delegate, 143 ProxyDelegate* proxy_delegate,
144 const std::string& method,
bengr 2016/02/16 20:00:14 Move the method to just after the url.
143 const BoundNetLog& net_log); 145 const BoundNetLog& net_log);
144 146
145 // This method is called after a failure to connect or resolve a host name. 147 // This method is called after a failure to connect or resolve a host name.
146 // It gives the proxy service an opportunity to reconsider the proxy to use. 148 // It gives the proxy service an opportunity to reconsider the proxy to use.
147 // The |results| parameter contains the results returned by an earlier call 149 // The |results| parameter contains the results returned by an earlier call
148 // to ResolveProxy. The |net_error| parameter contains the network error 150 // to ResolveProxy. The |net_error| parameter contains the network error
149 // code associated with the failure. See "net/base/net_error_list.h" for a 151 // code associated with the failure. See "net/base/net_error_list.h" for a
150 // list of possible values. The semantics of this call are otherwise 152 // list of possible values. The semantics of this call are otherwise
151 // similar to ResolveProxy. 153 // similar to ResolveProxy.
152 // 154 //
153 // NULL can be passed for |pac_request| if the caller will not need to 155 // NULL can be passed for |pac_request| if the caller will not need to
154 // cancel the request. 156 // cancel the request.
155 // 157 //
156 // Returns ERR_FAILED if there is not another proxy config to try. 158 // Returns ERR_FAILED if there is not another proxy config to try.
157 // 159 //
158 // Profiling information for the request is saved to |net_log| if non-NULL. 160 // Profiling information for the request is saved to |net_log| if non-NULL.
159 int ReconsiderProxyAfterError(const GURL& url, 161 int ReconsiderProxyAfterError(const GURL& url,
160 int load_flags, 162 int load_flags,
161 int net_error, 163 int net_error,
162 ProxyInfo* results, 164 ProxyInfo* results,
163 const CompletionCallback& callback, 165 const CompletionCallback& callback,
164 PacRequest** pac_request, 166 PacRequest** pac_request,
165 ProxyDelegate* proxy_delegate, 167 ProxyDelegate* proxy_delegate,
bengr 2016/02/16 20:00:14 Move the method to just after the url.
RyanSturm 2016/02/17 21:46:12 Done.
168 const std::string& method,
166 const BoundNetLog& net_log); 169 const BoundNetLog& net_log);
167 170
168 // Explicitly trigger proxy fallback for the given |results| by updating our 171 // Explicitly trigger proxy fallback for the given |results| by updating our
169 // list of bad proxies to include the first entry of |results|, and, 172 // list of bad proxies to include the first entry of |results|, and,
170 // additional bad proxies (can be none). Will retry after |retry_delay| if 173 // additional bad proxies (can be none). Will retry after |retry_delay| if
171 // positive, and will use the default proxy retry duration otherwise. Proxies 174 // positive, and will use the default proxy retry duration otherwise. Proxies
172 // marked as bad will not be retried until |retry_delay| has passed. Returns 175 // marked as bad will not be retried until |retry_delay| has passed. Returns
173 // true if there will be at least one proxy remaining in the list after 176 // true if there will be at least one proxy remaining in the list after
174 // fallback and false otherwise. This method should be used to add proxies to 177 // fallback and false otherwise. This method should be used to add proxies to
175 // the bad proxy list only for reasons other than a network error. If a proxy 178 // the bad proxy list only for reasons other than a network error. If a proxy
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 334
332 // Identical to ResolveProxy, except that |callback| is permitted to be null. 335 // Identical to ResolveProxy, except that |callback| is permitted to be null.
333 // if |callback.is_null()|, this function becomes a thin wrapper around 336 // if |callback.is_null()|, this function becomes a thin wrapper around
334 // |TryToCompleteSynchronously|. 337 // |TryToCompleteSynchronously|.
335 int ResolveProxyHelper(const GURL& url, 338 int ResolveProxyHelper(const GURL& url,
336 int load_flags, 339 int load_flags,
337 ProxyInfo* results, 340 ProxyInfo* results,
338 const CompletionCallback& callback, 341 const CompletionCallback& callback,
339 PacRequest** pac_request, 342 PacRequest** pac_request,
340 ProxyDelegate* proxy_delegate, 343 ProxyDelegate* proxy_delegate,
344 const std::string& method,
bengr 2016/02/16 20:00:14 Move the method to just after the url.
RyanSturm 2016/02/17 21:46:12 Done.
341 const BoundNetLog& net_log); 345 const BoundNetLog& net_log);
342 346
343 // Cancels all of the requests sent to the ProxyResolver. These will be 347 // Cancels all of the requests sent to the ProxyResolver. These will be
344 // restarted when calling SetReady(). 348 // restarted when calling SetReady().
345 void SuspendAllPendingRequests(); 349 void SuspendAllPendingRequests();
346 350
347 // Advances the current state to |STATE_READY|, and resumes any pending 351 // Advances the current state to |STATE_READY|, and resumes any pending
348 // requests which had been stalled waiting for initialization to complete. 352 // requests which had been stalled waiting for initialization to complete.
349 void SetReady(); 353 void SetReady();
350 354
351 // Returns true if |pending_requests_| contains |req|. 355 // Returns true if |pending_requests_| contains |req|.
352 bool ContainsPendingRequest(PacRequest* req); 356 bool ContainsPendingRequest(PacRequest* req);
353 357
354 // Removes |req| from the list of pending requests. 358 // Removes |req| from the list of pending requests.
355 void RemovePendingRequest(PacRequest* req); 359 void RemovePendingRequest(PacRequest* req);
356 360
357 // Called when proxy resolution has completed (either synchronously or 361 // Called when proxy resolution has completed (either synchronously or
358 // asynchronously). Handles logging the result, and cleaning out 362 // asynchronously). Handles logging the result, and cleaning out
359 // bad entries from the results list. 363 // bad entries from the results list.
360 int DidFinishResolvingProxy(const GURL& url, 364 int DidFinishResolvingProxy(const GURL& url,
361 int load_flags, 365 int load_flags,
362 ProxyDelegate* proxy_delegate, 366 ProxyDelegate* proxy_delegate,
367 const std::string& method,
bengr 2016/02/16 20:00:14 Move the method to just after the url.
RyanSturm 2016/02/17 21:46:12 Done.
363 ProxyInfo* result, 368 ProxyInfo* result,
364 int result_code, 369 int result_code,
365 const BoundNetLog& net_log, 370 const BoundNetLog& net_log,
366 base::TimeTicks start_time, 371 base::TimeTicks start_time,
367 bool script_executed); 372 bool script_executed);
368 373
369 // Start initialization using |fetched_config_|. 374 // Start initialization using |fetched_config_|.
370 void InitializeUsingLastFetchedConfig(); 375 void InitializeUsingLastFetchedConfig();
371 376
372 // Start the initialization skipping past the "decision" phase. 377 // Start the initialization skipping past the "decision" phase.
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 455
451 // Whether child ProxyScriptDeciders should use QuickCheck 456 // Whether child ProxyScriptDeciders should use QuickCheck
452 bool quick_check_enabled_; 457 bool quick_check_enabled_;
453 458
454 DISALLOW_COPY_AND_ASSIGN(ProxyService); 459 DISALLOW_COPY_AND_ASSIGN(ProxyService);
455 }; 460 };
456 461
457 } // namespace net 462 } // namespace net
458 463
459 #endif // NET_PROXY_PROXY_SERVICE_H_ 464 #endif // NET_PROXY_PROXY_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698