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

Unified Diff: content/browser/renderer_host/allow_cancel_resource_handler.h

Issue 9113028: Substitute ResourceHandlers with dummy ResourceHandler while request is transferred (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 12 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 side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698