| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_CHILD_WEB_URL_LOADER_IMPL_H_ | 5 #ifndef CONTENT_CHILD_WEB_URL_LOADER_IMPL_H_ |
| 6 #define CONTENT_CHILD_WEB_URL_LOADER_IMPL_H_ | 6 #define CONTENT_CHILD_WEB_URL_LOADER_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
| 11 #include "content/common/url_loader_factory.mojom.h" | 11 #include "content/common/url_loader_factory.mojom.h" |
| 12 #include "content/public/common/resource_response.h" | 12 #include "content/public/common/resource_response.h" |
| 13 #include "net/url_request/redirect_info.h" | 13 #include "net/url_request/redirect_info.h" |
| 14 #include "third_party/WebKit/public/platform/WebURLLoader.h" | 14 #include "third_party/WebKit/public/platform/WebURLLoader.h" |
| 15 #include "url/gurl.h" | 15 #include "url/gurl.h" |
| 16 | 16 |
| 17 namespace mojo { |
| 18 class AssociatedGroup; |
| 19 } // namespace mojo |
| 20 |
| 17 namespace content { | 21 namespace content { |
| 18 | 22 |
| 19 class ResourceDispatcher; | 23 class ResourceDispatcher; |
| 20 struct ResourceResponseInfo; | 24 struct ResourceResponseInfo; |
| 21 | 25 |
| 22 // PlzNavigate: Used to override parameters of the navigation request. | 26 // PlzNavigate: Used to override parameters of the navigation request. |
| 23 struct CONTENT_EXPORT StreamOverrideParameters { | 27 struct CONTENT_EXPORT StreamOverrideParameters { |
| 24 public: | 28 public: |
| 25 StreamOverrideParameters(); | 29 StreamOverrideParameters(); |
| 26 ~StreamOverrideParameters(); | 30 ~StreamOverrideParameters(); |
| 27 // TODO(clamy): The browser should be made aware on destruction of this struct | 31 // TODO(clamy): The browser should be made aware on destruction of this struct |
| 28 // that it can release its associated stream handle. | 32 // that it can release its associated stream handle. |
| 29 GURL stream_url; | 33 GURL stream_url; |
| 30 ResourceResponseHead response; | 34 ResourceResponseHead response; |
| 31 std::vector<GURL> redirects; | 35 std::vector<GURL> redirects; |
| 32 std::vector<ResourceResponseInfo> redirect_responses; | 36 std::vector<ResourceResponseInfo> redirect_responses; |
| 33 }; | 37 }; |
| 34 | 38 |
| 35 class CONTENT_EXPORT WebURLLoaderImpl | 39 class CONTENT_EXPORT WebURLLoaderImpl |
| 36 : public NON_EXPORTED_BASE(blink::WebURLLoader) { | 40 : public NON_EXPORTED_BASE(blink::WebURLLoader) { |
| 37 public: | 41 public: |
| 38 | 42 |
| 39 // Takes ownership of |web_task_runner|. | 43 // Takes ownership of |web_task_runner|. |
| 40 WebURLLoaderImpl(ResourceDispatcher* resource_dispatcher, | 44 WebURLLoaderImpl(ResourceDispatcher* resource_dispatcher, |
| 41 mojom::URLLoaderFactory* url_loader_factory); | 45 mojom::URLLoaderFactory* url_loader_factory, |
| 46 mojo::AssociatedGroup* associated_group); |
| 42 ~WebURLLoaderImpl() override; | 47 ~WebURLLoaderImpl() override; |
| 43 | 48 |
| 44 static void PopulateURLResponse(const GURL& url, | 49 static void PopulateURLResponse(const GURL& url, |
| 45 const ResourceResponseInfo& info, | 50 const ResourceResponseInfo& info, |
| 46 blink::WebURLResponse* response, | 51 blink::WebURLResponse* response, |
| 47 bool report_security_info); | 52 bool report_security_info); |
| 48 static void PopulateURLRequestForRedirect( | 53 static void PopulateURLRequestForRedirect( |
| 49 const blink::WebURLRequest& request, | 54 const blink::WebURLRequest& request, |
| 50 const net::RedirectInfo& redirect_info, | 55 const net::RedirectInfo& redirect_info, |
| 51 blink::WebURLRequest::SkipServiceWorker skip_service_worker, | 56 blink::WebURLRequest::SkipServiceWorker skip_service_worker, |
| (...skipping 19 matching lines...) Expand all Loading... |
| 71 class Context; | 76 class Context; |
| 72 class RequestPeerImpl; | 77 class RequestPeerImpl; |
| 73 scoped_refptr<Context> context_; | 78 scoped_refptr<Context> context_; |
| 74 | 79 |
| 75 DISALLOW_COPY_AND_ASSIGN(WebURLLoaderImpl); | 80 DISALLOW_COPY_AND_ASSIGN(WebURLLoaderImpl); |
| 76 }; | 81 }; |
| 77 | 82 |
| 78 } // namespace content | 83 } // namespace content |
| 79 | 84 |
| 80 #endif // CONTENT_CHILD_WEB_URL_LOADER_IMPL_H_ | 85 #endif // CONTENT_CHILD_WEB_URL_LOADER_IMPL_H_ |
| OLD | NEW |