Index: content/browser/renderer_host/allow_cancel_resource_handler.h |
diff --git a/content/browser/renderer_host/allow_cancel_resource_handler.h b/content/browser/renderer_host/allow_cancel_resource_handler.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b29bf3cdd9c7b57ac5085409112e1247a9f570d2 |
--- /dev/null |
+++ b/content/browser/renderer_host/allow_cancel_resource_handler.h |
@@ -0,0 +1,49 @@ |
+// Copyright (c) 2011 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 CONTENT_BROWSER_RENDERER_HOST_ALLOW_CANCEL_RESOURCE_HANDLER_H_ |
+#define CONTENT_BROWSER_RENDERER_HOST_ALLOW_CANCEL_RESOURCE_HANDLER_H_ |
+#pragma once |
+ |
+#include "content/browser/renderer_host/resource_handler.h" |
+ |
+// Resource Handler that DCHECKs on all events but canceling and failing of |
+// requests. |
+class AllowCancelResourceHandler : public ResourceHandler { |
Matt Perry
2012/01/05 23:52:44
This is a bit awkwardly named IMO. Something more
battre
2012/01/06 02:18:02
Done.
|
+ public: |
+ AllowCancelResourceHandler(); |
+ |
+ // ResourceHandler implementation: |
+ virtual bool OnUploadProgress(int request_id, |
+ uint64 position, |
+ uint64 size) OVERRIDE; |
+ virtual bool OnRequestRedirected(int request_id, |
+ const GURL& new_url, |
+ content::ResourceResponse* response, |
+ bool* defer) OVERRIDE; |
+ virtual bool OnResponseStarted(int request_id, |
+ content::ResourceResponse* response) OVERRIDE; |
+ virtual bool OnWillStart(int request_id, |
+ const GURL& url, |
+ bool* defer) OVERRIDE; |
+ virtual bool OnWillRead(int request_id, |
+ net::IOBuffer** buf, |
+ int* buf_size, |
+ int min_size) OVERRIDE; |
+ virtual bool OnReadCompleted(int request_id, |
+ int* bytes_read) OVERRIDE; |
+ virtual bool OnResponseCompleted(int request_id, |
+ const net::URLRequestStatus& status, |
+ const std::string& security_info) OVERRIDE; |
+ virtual void OnRequestClosed() OVERRIDE; |
+ virtual void OnDataDownloaded(int request_id, |
+ int bytes_downloaded) OVERRIDE; |
+ |
+ private: |
+ virtual ~AllowCancelResourceHandler(); |
+ |
+ DISALLOW_COPY_AND_ASSIGN(AllowCancelResourceHandler); |
+}; |
+ |
+#endif // CONTENT_BROWSER_RENDERER_HOST_ALLOW_CANCEL_RESOURCE_HANDLER_H_ |