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

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 2932453002: PlzNavigate: Release StreamHandle. (Closed)
Patch Set: Add real urls in tests ( rebase...) Created 3 years, 6 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
« no previous file with comments | « content/common/frame_messages.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "content/renderer/render_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 5128 matching lines...) Expand 10 before | Expand all | Expand 10 after
5139 std::unique_ptr<StreamOverrideParameters> stream_override( 5139 std::unique_ptr<StreamOverrideParameters> stream_override(
5140 new StreamOverrideParameters()); 5140 new StreamOverrideParameters());
5141 stream_override->stream_url = stream_url; 5141 stream_override->stream_url = stream_url;
5142 stream_override->consumer_handle = 5142 stream_override->consumer_handle =
5143 mojo::ScopedDataPipeConsumerHandle(commit_data.handle); 5143 mojo::ScopedDataPipeConsumerHandle(commit_data.handle);
5144 stream_override->response = response; 5144 stream_override->response = response;
5145 stream_override->redirects = request_params.redirects; 5145 stream_override->redirects = request_params.redirects;
5146 stream_override->redirect_responses = request_params.redirect_response; 5146 stream_override->redirect_responses = request_params.redirect_response;
5147 stream_override->redirect_infos = request_params.redirect_infos; 5147 stream_override->redirect_infos = request_params.redirect_infos;
5148 5148
5149 // Used to notify the browser that it can release its |stream_handle_| when
5150 // the |stream_override| object isn't used anymore.
5151 // TODO(clamy): Remove this when we switch to Mojo streams.
5152 stream_override->on_delete = base::BindOnce(
5153 [](base::WeakPtr<RenderFrameImpl> weak_self, const GURL& url) {
5154 if (RenderFrameImpl* self = weak_self.get()) {
5155 self->Send(
5156 new FrameHostMsg_StreamHandleConsumed(self->routing_id_, url));
5157 }
5158 },
5159 weak_factory_.GetWeakPtr());
5160
5149 if (commit_data.url_loader_factory.is_valid()) { 5161 if (commit_data.url_loader_factory.is_valid()) {
5150 // Chrome doesn't use interface versioning. 5162 // Chrome doesn't use interface versioning.
5151 url_loader_factory_.Bind(mojom::URLLoaderFactoryPtrInfo( 5163 url_loader_factory_.Bind(mojom::URLLoaderFactoryPtrInfo(
5152 mojo::ScopedMessagePipeHandle(commit_data.url_loader_factory), 0u)); 5164 mojo::ScopedMessagePipeHandle(commit_data.url_loader_factory), 0u));
5153 } 5165 }
5154 5166
5155 // If the request was initiated in the context of a user gesture then make 5167 // If the request was initiated in the context of a user gesture then make
5156 // sure that the navigation also executes in the context of a user gesture. 5168 // sure that the navigation also executes in the context of a user gesture.
5157 std::unique_ptr<blink::WebScopedUserGesture> gesture( 5169 std::unique_ptr<blink::WebScopedUserGesture> gesture(
5158 request_params.has_user_gesture ? new blink::WebScopedUserGesture(frame_) 5170 request_params.has_user_gesture ? new blink::WebScopedUserGesture(frame_)
(...skipping 1717 matching lines...) Expand 10 before | Expand all | Expand 10 after
6876 policy(info.default_policy), 6888 policy(info.default_policy),
6877 replaces_current_history_item(info.replaces_current_history_item), 6889 replaces_current_history_item(info.replaces_current_history_item),
6878 history_navigation_in_new_child_frame( 6890 history_navigation_in_new_child_frame(
6879 info.is_history_navigation_in_new_child_frame), 6891 info.is_history_navigation_in_new_child_frame),
6880 client_redirect(info.is_client_redirect), 6892 client_redirect(info.is_client_redirect),
6881 cache_disabled(info.is_cache_disabled), 6893 cache_disabled(info.is_cache_disabled),
6882 form(info.form), 6894 form(info.form),
6883 source_location(info.source_location) {} 6895 source_location(info.source_location) {}
6884 6896
6885 } // namespace content 6897 } // namespace content
OLDNEW
« no previous file with comments | « content/common/frame_messages.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698