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

Side by Side Diff: content/child/web_url_loader_impl.h

Issue 2813243002: network service: pass PlzNavigate resulting data via mojo data pipe (Closed)
Patch Set: . Created 3 years, 8 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 unified diff | Download patch
OLDNEW
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 // TODO(clamy): The browser should be made aware on destruction of this struct
28 // that it can release its associated stream handle. 29 // that it can release its associated stream handle.
29 GURL stream_url; 30 GURL stream_url;
31 mojo::ScopedDataPipeConsumerHandle consumer_handle;
30 ResourceResponseHead response; 32 ResourceResponseHead response;
31 std::vector<GURL> redirects; 33 std::vector<GURL> redirects;
32 std::vector<ResourceResponseInfo> redirect_responses; 34 std::vector<ResourceResponseInfo> redirect_responses;
33 std::vector<net::RedirectInfo> redirect_infos; 35 std::vector<net::RedirectInfo> redirect_infos;
34 36
35 // The delta between the actual transfer size and the one reported by the 37 // The delta between the actual transfer size and the one reported by the
36 // AsyncResourceLoader due to not having the ResourceResponse. 38 // AsyncResourceLoader due to not having the ResourceResponse.
37 int total_transfer_size_delta; 39 int total_transfer_size_delta;
40
41 int total_transferred = 0;
38 }; 42 };
39 43
40 class CONTENT_EXPORT WebURLLoaderImpl 44 class CONTENT_EXPORT WebURLLoaderImpl
41 : public NON_EXPORTED_BASE(blink::WebURLLoader) { 45 : public NON_EXPORTED_BASE(blink::WebURLLoader) {
42 public: 46 public:
43 47
44 // Takes ownership of |web_task_runner|. 48 // Takes ownership of |web_task_runner|.
45 WebURLLoaderImpl(ResourceDispatcher* resource_dispatcher, 49 WebURLLoaderImpl(ResourceDispatcher* resource_dispatcher,
46 mojom::URLLoaderFactory* url_loader_factory); 50 mojom::URLLoaderFactory* url_loader_factory);
47 ~WebURLLoaderImpl() override; 51 ~WebURLLoaderImpl() override;
(...skipping 27 matching lines...) Expand all
75 class Context; 79 class Context;
76 class RequestPeerImpl; 80 class RequestPeerImpl;
77 scoped_refptr<Context> context_; 81 scoped_refptr<Context> context_;
78 82
79 DISALLOW_COPY_AND_ASSIGN(WebURLLoaderImpl); 83 DISALLOW_COPY_AND_ASSIGN(WebURLLoaderImpl);
80 }; 84 };
81 85
82 } // namespace content 86 } // namespace content
83 87
84 #endif // CONTENT_CHILD_WEB_URL_LOADER_IMPL_H_ 88 #endif // CONTENT_CHILD_WEB_URL_LOADER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698