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 "mojo/public/cpp/system/data_pipe.h" |
13 #include "net/url_request/redirect_info.h" | 14 #include "net/url_request/redirect_info.h" |
14 #include "third_party/WebKit/public/platform/WebURLLoader.h" | 15 #include "third_party/WebKit/public/platform/WebURLLoader.h" |
15 #include "url/gurl.h" | 16 #include "url/gurl.h" |
16 | 17 |
17 namespace content { | 18 namespace content { |
18 | 19 |
19 class ResourceDispatcher; | 20 class ResourceDispatcher; |
20 struct ResourceResponseInfo; | 21 struct ResourceResponseInfo; |
21 | 22 |
22 // PlzNavigate: Used to override parameters of the navigation request. | 23 // PlzNavigate: Used to override parameters of the navigation request. |
23 struct CONTENT_EXPORT StreamOverrideParameters { | 24 struct CONTENT_EXPORT StreamOverrideParameters { |
24 public: | 25 public: |
25 StreamOverrideParameters(); | 26 StreamOverrideParameters(); |
26 ~StreamOverrideParameters(); | 27 ~StreamOverrideParameters(); |
27 // TODO(clamy): The browser should be made aware on destruction of this struct | 28 mojo::ScopedDataPipeConsumerHandle consumer_handle; |
28 // that it can release its associated stream handle. | |
29 GURL stream_url; | |
30 ResourceResponseHead response; | 29 ResourceResponseHead response; |
31 std::vector<GURL> redirects; | 30 std::vector<GURL> redirects; |
32 std::vector<ResourceResponseInfo> redirect_responses; | 31 std::vector<ResourceResponseInfo> redirect_responses; |
33 std::vector<net::RedirectInfo> redirect_infos; | 32 std::vector<net::RedirectInfo> redirect_infos; |
34 | 33 |
35 // The delta between the actual transfer size and the one reported by the | 34 // The delta between the actual transfer size and the one reported by the |
36 // AsyncResourceLoader due to not having the ResourceResponse. | 35 // AsyncResourceLoader due to not having the ResourceResponse. |
37 int total_transfer_size_delta; | 36 int total_transfer_size_delta; |
| 37 |
| 38 int total_transferred = 0; |
38 }; | 39 }; |
39 | 40 |
40 class CONTENT_EXPORT WebURLLoaderImpl | 41 class CONTENT_EXPORT WebURLLoaderImpl |
41 : public NON_EXPORTED_BASE(blink::WebURLLoader) { | 42 : public NON_EXPORTED_BASE(blink::WebURLLoader) { |
42 public: | 43 public: |
43 | 44 |
44 // Takes ownership of |web_task_runner|. | 45 // Takes ownership of |web_task_runner|. |
45 WebURLLoaderImpl(ResourceDispatcher* resource_dispatcher, | 46 WebURLLoaderImpl(ResourceDispatcher* resource_dispatcher, |
46 mojom::URLLoaderFactory* url_loader_factory); | 47 mojom::URLLoaderFactory* url_loader_factory); |
47 ~WebURLLoaderImpl() override; | 48 ~WebURLLoaderImpl() override; |
(...skipping 28 matching lines...) Expand all Loading... |
76 class Context; | 77 class Context; |
77 class RequestPeerImpl; | 78 class RequestPeerImpl; |
78 scoped_refptr<Context> context_; | 79 scoped_refptr<Context> context_; |
79 | 80 |
80 DISALLOW_COPY_AND_ASSIGN(WebURLLoaderImpl); | 81 DISALLOW_COPY_AND_ASSIGN(WebURLLoaderImpl); |
81 }; | 82 }; |
82 | 83 |
83 } // namespace content | 84 } // namespace content |
84 | 85 |
85 #endif // CONTENT_CHILD_WEB_URL_LOADER_IMPL_H_ | 86 #endif // CONTENT_CHILD_WEB_URL_LOADER_IMPL_H_ |
OLD | NEW |