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

Unified Diff: net/base/wrapping_network_delegate.cc

Issue 734263003: Move data reduction proxy logic out of chrome and android webview network delegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: net/base/wrapping_network_delegate.cc
diff --git a/net/base/wrapping_network_delegate.cc b/net/base/wrapping_network_delegate.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a74f5b2763602f75dd76315787e419ef76493451
--- /dev/null
+++ b/net/base/wrapping_network_delegate.cc
@@ -0,0 +1,291 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "net/base/wrapping_network_delegate.h"
+
+#include "net/base/net_errors.h"
+
+namespace net {
+
+WrappingNetworkDelegate::WrappingNetworkDelegate(
+ scoped_ptr<NetworkDelegate> network_delegate)
+ : wrapped_network_delegate_(network_delegate.Pass()) {}
+
+WrappingNetworkDelegate::~WrappingNetworkDelegate() {}
+
+int WrappingNetworkDelegate::OnBeforeURLRequest(
+ URLRequest* request,
+ const CompletionCallback& callback,
+ GURL* new_url) {
+ OnBeforeURLRequestInternal(request, callback, new_url);
+ return wrapped_network_delegate_->OnBeforeURLRequest(
+ request, callback, new_url);
+}
+
+void WrappingNetworkDelegate::OnBeforeURLRequestInternal(
+ URLRequest* request,
+ const CompletionCallback& callback,
+ GURL* new_url) {
+}
+
+void WrappingNetworkDelegate::OnResolveProxy(
+ const GURL& url,
+ int load_flags,
+ const ProxyService& proxy_service,
+ ProxyInfo* result) {
+ OnResolveProxyInternal(url, load_flags, proxy_service, result);
+ wrapped_network_delegate_->OnResolveProxy(
+ url, load_flags, proxy_service, result);
+}
+
+void WrappingNetworkDelegate::OnResolveProxyInternal(
+ const GURL& url,
+ int load_flags,
+ const ProxyService& proxy_service,
+ ProxyInfo* result) {
+}
+
+void WrappingNetworkDelegate::OnProxyFallback(const ProxyServer& bad_proxy,
+ int net_error) {
+ OnProxyFallbackInternal(bad_proxy, net_error);
+ wrapped_network_delegate_->OnProxyFallback(bad_proxy, net_error);
+}
+
+void WrappingNetworkDelegate::OnProxyFallbackInternal(
+ const ProxyServer& bad_proxy,
+ int net_error) {
+}
+
+int WrappingNetworkDelegate::OnBeforeSendHeaders(
+ URLRequest* request,
+ const CompletionCallback& callback,
+ HttpRequestHeaders* headers) {
+ OnBeforeSendHeadersInternal(request, callback, headers);
+ return wrapped_network_delegate_->OnBeforeSendHeaders(
+ request, callback, headers);
+}
+
+void WrappingNetworkDelegate::OnBeforeSendHeadersInternal(
+ URLRequest* request,
+ const CompletionCallback& callback,
+ HttpRequestHeaders* headers) {
+}
+
+void WrappingNetworkDelegate::OnBeforeSendProxyHeaders(
+ URLRequest* request,
+ const ProxyInfo& proxy_info,
+ HttpRequestHeaders* headers) {
+ OnBeforeSendProxyHeadersInternal(request, proxy_info, headers);
+ wrapped_network_delegate_->OnBeforeSendProxyHeaders(
+ request, proxy_info, headers);
+}
+
+void WrappingNetworkDelegate::OnBeforeSendProxyHeadersInternal(
+ URLRequest* request,
+ const ProxyInfo& proxy_info,
+ HttpRequestHeaders* headers) {
+}
+
+void WrappingNetworkDelegate::OnSendHeaders(URLRequest* request,
+ const HttpRequestHeaders& headers) {
+ OnSendHeadersInternal(request, headers);
+ wrapped_network_delegate_->OnSendHeaders(request, headers);
+}
+
+void WrappingNetworkDelegate::OnSendHeadersInternal(
+ URLRequest* request,
+ const HttpRequestHeaders& headers) {
+}
+
+int WrappingNetworkDelegate::OnHeadersReceived(
+ URLRequest* request,
+ const CompletionCallback& callback,
+ const HttpResponseHeaders* original_response_headers,
+ scoped_refptr<HttpResponseHeaders>* override_response_headers,
+ GURL* allowed_unsafe_redirect_url) {
+ OnHeadersReceivedInternal(
+ request, callback, original_response_headers,
+ override_response_headers, allowed_unsafe_redirect_url);
+ return wrapped_network_delegate_->OnHeadersReceived(
+ request, callback, original_response_headers,
+ override_response_headers, allowed_unsafe_redirect_url);
+}
+
+void WrappingNetworkDelegate::OnHeadersReceivedInternal(
+ URLRequest* request,
+ const CompletionCallback& callback,
+ const HttpResponseHeaders* original_response_headers,
+ scoped_refptr<HttpResponseHeaders>* override_response_headers,
+ GURL* allowed_unsafe_redirect_url) {
+}
+
+void WrappingNetworkDelegate::OnBeforeRedirect(URLRequest* request,
+ const GURL& new_location) {
+ OnBeforeRedirectInternal(request, new_location);
+ wrapped_network_delegate_->OnBeforeRedirect(request, new_location);
+}
+
+void WrappingNetworkDelegate::OnBeforeRedirectInternal(
+ URLRequest* request,
+ const GURL& new_location) {
+}
+
+void WrappingNetworkDelegate::OnResponseStarted(URLRequest* request) {
+ OnResponseStartedInternal(request);
+ wrapped_network_delegate_->OnResponseStarted(request);
+}
+
+void WrappingNetworkDelegate::OnResponseStartedInternal(URLRequest* request) {
+}
+
+void WrappingNetworkDelegate::OnRawBytesRead(const URLRequest& request,
+ int bytes_read) {
+ OnRawBytesReadInternal(request, bytes_read);
+ wrapped_network_delegate_->OnRawBytesRead(request, bytes_read);
+}
+
+void WrappingNetworkDelegate::OnRawBytesReadInternal(const URLRequest& request,
+ int bytes_read) {
+}
+
+void WrappingNetworkDelegate::OnCompleted(URLRequest* request, bool started) {
+ OnCompletedInternal(request, started);
+ wrapped_network_delegate_->OnCompleted(request, started);
+}
+
+void WrappingNetworkDelegate::OnCompletedInternal(
+ URLRequest* request,
+ bool started) {
+}
+
+void WrappingNetworkDelegate::OnURLRequestDestroyed(URLRequest* request) {
+ OnURLRequestDestroyedInternal(request);
+ wrapped_network_delegate_->OnURLRequestDestroyed(request);
+}
+
+void WrappingNetworkDelegate::OnURLRequestDestroyedInternal(
+ URLRequest* request) {
+}
+
+void WrappingNetworkDelegate::OnPACScriptError(int line_number,
+ const base::string16& error) {
+ OnPACScriptErrorInternal(line_number, error);
+ wrapped_network_delegate_->OnPACScriptError(line_number, error);
+}
+
+void WrappingNetworkDelegate::OnPACScriptErrorInternal(
+ int line_number,
+ const base::string16& error) {
+}
+
+NetworkDelegate::AuthRequiredResponse WrappingNetworkDelegate::OnAuthRequired(
+ URLRequest* request,
+ const AuthChallengeInfo& auth_info,
+ const AuthCallback& callback,
+ AuthCredentials* credentials) {
+ OnAuthRequiredInternal(request, auth_info, callback, credentials);
+ return wrapped_network_delegate_->OnAuthRequired(
+ request, auth_info, callback, credentials);
+}
+
+void WrappingNetworkDelegate::OnAuthRequiredInternal(
+ URLRequest* request,
+ const AuthChallengeInfo& auth_info,
+ const AuthCallback& callback,
+ AuthCredentials* credentials) {
+}
+
+bool WrappingNetworkDelegate::OnCanGetCookies(const URLRequest& request,
+ const CookieList& cookie_list) {
+ OnCanGetCookiesInternal(request, cookie_list);
+ return wrapped_network_delegate_->OnCanGetCookies(request, cookie_list);
+}
+
+void WrappingNetworkDelegate::OnCanGetCookiesInternal(
+ const URLRequest& request,
+ const CookieList& cookie_list) {
+}
+
+bool WrappingNetworkDelegate::OnCanSetCookie(const URLRequest& request,
+ const std::string& cookie_line,
+ CookieOptions* options) {
+ OnCanSetCookieInternal(request, cookie_line, options);
+ return wrapped_network_delegate_->OnCanSetCookie(
+ request, cookie_line, options);
+}
+
+void WrappingNetworkDelegate::OnCanSetCookieInternal(
+ const URLRequest& request,
+ const std::string& cookie_line,
+ CookieOptions* options) {
+}
+
+bool WrappingNetworkDelegate::OnCanAccessFile(
+ const URLRequest& request,
+ const base::FilePath& path) const {
+ OnCanAccessFileInternal(request, path);
+ return wrapped_network_delegate_->OnCanAccessFile(request, path);
+}
+
+void WrappingNetworkDelegate::OnCanAccessFileInternal(
+ const URLRequest& request,
+ const base::FilePath& path) const {
+}
+
+bool WrappingNetworkDelegate::OnCanThrottleRequest(
+ const URLRequest& request) const {
+ OnCanThrottleRequestInternal(request);
+ return wrapped_network_delegate_->OnCanThrottleRequest(request);
+}
+
+void WrappingNetworkDelegate::OnCanThrottleRequestInternal(
+ const URLRequest& request) const {
+}
+
+bool WrappingNetworkDelegate::OnCanEnablePrivacyMode(
+ const GURL& url,
+ const GURL& first_party_for_cookies) const {
+ OnCanEnablePrivacyModeInternal(url, first_party_for_cookies);
+ return wrapped_network_delegate_->OnCanEnablePrivacyMode(
+ url, first_party_for_cookies);
+}
+
+void WrappingNetworkDelegate::OnCanEnablePrivacyModeInternal(
+ const GURL& url,
+ const GURL& first_party_for_cookies) const {
+}
+
+int WrappingNetworkDelegate::OnBeforeSocketStreamConnect(
+ SocketStream* socket,
+ const CompletionCallback& callback) {
+ OnBeforeSocketStreamConnectInternal(socket, callback);
+ return wrapped_network_delegate_->OnBeforeSocketStreamConnect(
+ socket, callback);
+}
+
+void WrappingNetworkDelegate::OnBeforeSocketStreamConnectInternal(
+ SocketStream* socket,
+ const CompletionCallback& callback) {
+}
+
+bool
+WrappingNetworkDelegate::OnCancelURLRequestWithPolicyViolatingReferrerHeader(
+ const URLRequest& request,
+ const GURL& target_url,
+ const GURL& referrer_url) const {
+ OnCancelURLRequestWithPolicyViolatingReferrerHeaderInternal(
+ request, target_url, referrer_url);
+ return wrapped_network_delegate_->
+ OnCancelURLRequestWithPolicyViolatingReferrerHeader(
+ request, target_url, referrer_url);
+}
+
+void WrappingNetworkDelegate::
+OnCancelURLRequestWithPolicyViolatingReferrerHeaderInternal(
+ const URLRequest& request,
+ const GURL& target_url,
+ const GURL& referrer_url) const {
+}
+
+} // namespace net

Powered by Google App Engine
This is Rietveld 408576698