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

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

Issue 2897063002: Network service: Implement URLLoader chaining for interceptors (Closed)
Patch Set: . Created 3 years, 7 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/url_loader_request_handler.h
diff --git a/content/browser/loader/url_loader_request_handler.h b/content/browser/loader/url_loader_request_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..d0cf737021ce97a74a59485de0db519090ce2542
--- /dev/null
+++ b/content/browser/loader/url_loader_request_handler.h
@@ -0,0 +1,44 @@
+// 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_URL_LOADER_REQUEST_HANDLER_H_
+#define CONTENT_BROWSER_LOADER_URL_LOADER_REQUEST_HANDLER_H_
+
+#include "base/macros.h"
+#include "content/common/url_loader.mojom.h"
+
+namespace content {
+
+class ResourceContext;
+struct ResourceRequest;
+
+// An instance of this class is a per-request object and kept around during
+// the lifetime of a request (including multiple redirect legs).
scottmg 2017/05/25 15:12:24 Mention that this is IO thread.
kinuko 2017/05/26 14:30:05 Done.
+class URLLoaderRequestHandler {
michaeln 2017/05/26 01:28:31 This is looking good, I'm going to focus on this i
kinuko 2017/05/26 02:34:20 Sure. To clarify when you say 'Loader' do you mea
kinuko 2017/05/26 14:30:05 Changed this to MaybeCreateLoaderFactory(base::Cal
michaeln 2017/05/26 21:36:25 I'm just noticing the handoff to the renderer does
+ public:
+ class Controller {
+ public:
+ // Forward the request to the next handler. Could be called when the
+ // calling request handler can't handle the given request.
+ virtual void Forward(mojom::URLLoaderAssociatedRequest request,
+ mojom::URLLoaderClientPtr client_ptr) = 0;
+ };
+
+ URLLoaderRequestHandler() = default;
+ virtual ~URLLoaderRequestHandler() = default;
+
+ // Controller should outlive the request handler object.
+ virtual void Start(const ResourceRequest& resource_request,
michaeln 2017/05/26 01:43:21 Also, the hand wavvy MaybeCreateLoader(request, co
+ Controller* controller,
+ ResourceContext* resource_context,
+ mojom::URLLoaderAssociatedRequest loader_request,
+ mojom::URLLoaderClientPtr loader_client_ptr) = 0;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(URLLoaderRequestHandler);
jam 2017/05/25 16:06:37 nit: not needed on non-copyable interfaces
kinuko 2017/05/26 14:30:05 Removed.
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_LOADER_URL_LOADER_REQUEST_HANDLER_H_

Powered by Google App Engine
This is Rietveld 408576698