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

Unified Diff: content/browser/loader/null_resource_controller.h

Issue 2526983002: Refactor ResourceHandler API. (Closed)
Patch Set: Response to comments Created 3 years, 11 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/loader/null_resource_controller.h
diff --git a/content/browser/loader/null_resource_controller.h b/content/browser/loader/null_resource_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..b9e6caf4e5181e454a802e1592df6a66afe3b66b
--- /dev/null
+++ b/content/browser/loader/null_resource_controller.h
@@ -0,0 +1,36 @@
+// Copyright 2017 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_LOADER_NULL_RESOURCE_CONTROLLER_H_
+#define CONTENT_BROWSER_LOADER_NULL_RESOURCE_CONTROLLER_H_
+
+#include "base/macros.h"
+#include "content/browser/loader/resource_controller.h"
+
+namespace content {
+
+// A pseudo-ResourceController that just tracks whether it was resumed or not.
+// Only intended when calling into ResourceHandlers that either much resume the
+// request, or when the consumer doesn't care if the request was resumed or not.
+// TODO(mmenke): Modify consumers so they don't need to use this class.
+class NullResourceController : public ResourceController {
+ public:
+ explicit NullResourceController(bool* was_resumed);
+ ~NullResourceController() override;
+
+ // ResourceController implementation:
+ void Cancel() override;
+ void CancelAndIgnore() override;
+ void CancelWithError(int error_code) override;
+ void Resume() override;
+
+ private:
+ bool* was_resumed_;
+
+ DISALLOW_COPY_AND_ASSIGN(NullResourceController);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_LOADER_NULL_RESOURCE_CONTROLLER_H_
« no previous file with comments | « content/browser/loader/navigation_resource_handler.cc ('k') | content/browser/loader/null_resource_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698