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

Unified Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 2932453002: PlzNavigate: Release StreamHandle. (Closed)
Patch Set: Experiment: Use a RenderFrameObserver. 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/frame_host/render_frame_host_impl.cc
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index 61a6a6ecddbd225faaef6ba1a4bdc820cea21c6a..0317a12a2773189e1dea2e115d6aaf244973cc56 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -883,6 +883,8 @@ bool RenderFrameHostImpl::OnMessageReceived(const IPC::Message &msg) {
IPC_MESSAGE_HANDLER(FrameHostMsg_RequestOverlayRoutingToken,
OnRequestOverlayRoutingToken)
IPC_MESSAGE_HANDLER(FrameHostMsg_ShowCreatedWindow, OnShowCreatedWindow)
+ IPC_MESSAGE_HANDLER(FrameHostMsg_StreamHandleConsumed,
+ OnStreamHandleConsumed)
IPC_END_MESSAGE_MAP()
// No further actions here, since we may have been deleted.
@@ -3183,8 +3185,7 @@ void RenderFrameHostImpl::CommitNavigation(
last_navigation_previews_state_ = common_params.previews_state;
}
- // TODO(clamy): Release the stream handle once the renderer has finished
- // reading it.
+ // Released in OnStreamHandleConsumed().
stream_handle_ = std::move(body);
// When navigating to a debug url, no commit is expected from the
@@ -4053,6 +4054,12 @@ void RenderFrameHostImpl::SetLastCommittedSiteUrl(const GURL& url) {
}
}
+void RenderFrameHostImpl::OnStreamHandleConsumed(const GURL& stream_url) {
+ if (stream_handle_ && stream_handle_->GetURL() == stream_url) {
+ stream_handle_.reset();
+ }
+}
+
#if defined(OS_ANDROID)
class RenderFrameHostImpl::JavaInterfaceProvider

Powered by Google App Engine
This is Rietveld 408576698