Index: chrome/browser/renderer_host/dummy_resource_dispatcher_host_delegate.h |
diff --git a/chrome/browser/renderer_host/dummy_resource_dispatcher_host_delegate.h b/chrome/browser/renderer_host/dummy_resource_dispatcher_host_delegate.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..16a3d9156a1bc540e76d2aea20410b339b0687be |
--- /dev/null |
+++ b/chrome/browser/renderer_host/dummy_resource_dispatcher_host_delegate.h |
@@ -0,0 +1,88 @@ |
+// Copyright (c) 2012 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. |
+ |
+#ifndef CHROME_BROWSER_RENDERER_HOST_DUMMY_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ |
+#define CHROME_BROWSER_RENDERER_HOST_DUMMY_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ |
+ |
+#include <string> |
+ |
+#include "base/compiler_specific.h" |
+#include "content/public/browser/resource_dispatcher_host_delegate.h" |
+ |
+// Dummy implementation of ResourceDispatcherHostDelegate for test use. |
+// All invocation will be redirected to underlying delegate. |
+class DummyResourceDispatcherHostDelegate |
+ : public content::ResourceDispatcherHostDelegate { |
+ public: |
+ virtual bool ShouldBeginRequest( |
+ int child_id, |
+ int route_id, |
+ const std::string& method, |
+ const GURL& url, |
+ ResourceType::Type resource_type, |
+ const content::ResourceContext& resource_context, |
+ const content::Referrer& referrer) OVERRIDE; |
+ |
+ virtual ResourceHandler* RequestBeginning( |
+ ResourceHandler* handler, |
+ net::URLRequest* request, |
+ const content::ResourceContext& resource_context, |
+ bool is_subresource, |
+ int child_id, |
+ int route_id, |
+ bool is_continuation_of_transferred_request) OVERRIDE; |
+ |
+ virtual ResourceHandler* DownloadStarting( |
+ ResourceHandler* handler, |
+ const content::ResourceContext& resource_context, |
+ net::URLRequest* request, |
+ int child_id, |
+ int route_id, |
+ int request_id, |
+ bool is_new_request) OVERRIDE; |
+ |
+ virtual bool ShouldDeferStart( |
+ net::URLRequest* request, |
+ const content::ResourceContext& resource_context) OVERRIDE; |
+ |
+ virtual bool AcceptSSLClientCertificateRequest( |
+ net::URLRequest* request, |
+ net::SSLCertRequestInfo* cert_request_info) OVERRIDE; |
+ |
+ virtual bool AcceptAuthRequest(net::URLRequest* request, |
+ net::AuthChallengeInfo* auth_info) OVERRIDE; |
+ |
+ virtual content::ResourceDispatcherHostLoginDelegate* CreateLoginDelegate( |
+ net::AuthChallengeInfo* auth_info, net::URLRequest* request) OVERRIDE; |
+ |
+ virtual void HandleExternalProtocol(const GURL& url, |
+ int child_id, |
+ int route_id) OVERRIDE; |
+ |
+ virtual bool ShouldForceDownloadResource( |
+ const GURL& url, const std::string& mime_type) OVERRIDE; |
+ |
+ virtual void OnResponseStarted( |
+ net::URLRequest* request, |
+ content::ResourceResponse* response, |
+ ResourceMessageFilter* filter) OVERRIDE; |
+ |
+ virtual void OnRequestRedirected( |
+ net::URLRequest* request, |
+ content::ResourceResponse* response, |
+ ResourceMessageFilter* filter) OVERRIDE; |
+ |
+ protected: |
+ explicit DummyResourceDispatcherHostDelegate( |
+ content::ResourceDispatcherHostDelegate* underlying); |
+ virtual ~DummyResourceDispatcherHostDelegate(); |
+ content::ResourceDispatcherHostDelegate* underlying(); |
+ |
+ private: |
+ content::ResourceDispatcherHostDelegate* underlying_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(DummyResourceDispatcherHostDelegate); |
+}; |
+ |
+#endif // CHROME_BROWSER_RENDERER_HOST_DUMMY_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ |