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_ |