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

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

Issue 2793013002: (Reland) Discard compositor frames from unloaded web content (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
« no previous file with comments | « content/renderer/gpu/render_widget_compositor.cc ('k') | content/renderer/render_widget.h » ('j') | 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 3604 matching lines...) Expand 10 before | Expand all | Expand 10 after
3615 // If this is a provisional frame associated with a proxy (i.e., a frame 3615 // If this is a provisional frame associated with a proxy (i.e., a frame
3616 // created for a remote-to-local navigation), swap it into the frame tree 3616 // created for a remote-to-local navigation), swap it into the frame tree
3617 // now. 3617 // now.
3618 if (!SwapIn()) 3618 if (!SwapIn())
3619 return; 3619 return;
3620 } 3620 }
3621 3621
3622 // For new page navigations, the browser process needs to be notified of the 3622 // For new page navigations, the browser process needs to be notified of the
3623 // first paint of that page, so it can cancel the timer that waits for it. 3623 // first paint of that page, so it can cancel the timer that waits for it.
3624 if (is_main_frame_ && !navigation_state->WasWithinSamePage()) { 3624 if (is_main_frame_ && !navigation_state->WasWithinSamePage()) {
3625 GetRenderWidget()->IncrementContentSourceId();
3625 render_view_->QueueMessage( 3626 render_view_->QueueMessage(
3626 new ViewHostMsg_DidFirstPaintAfterLoad(render_view_->routing_id_), 3627 new ViewHostMsg_DidFirstPaintAfterLoad(render_view_->routing_id_),
3627 MESSAGE_DELIVERY_POLICY_WITH_VISUAL_STATE); 3628 MESSAGE_DELIVERY_POLICY_WITH_VISUAL_STATE);
3628 } 3629 }
3629 3630
3630 // When we perform a new navigation, we need to update the last committed 3631 // When we perform a new navigation, we need to update the last committed
3631 // session history entry with state for the page we are leaving. Do this 3632 // session history entry with state for the page we are leaving. Do this
3632 // before updating the current history item. 3633 // before updating the current history item.
3633 SendUpdateState(); 3634 SendUpdateState();
3634 3635
(...skipping 1252 matching lines...) Expand 10 before | Expand all | Expand 10 after
4887 4888
4888 params.gesture = render_view_->navigation_gesture_; 4889 params.gesture = render_view_->navigation_gesture_;
4889 render_view_->navigation_gesture_ = NavigationGestureUnknown; 4890 render_view_->navigation_gesture_ = NavigationGestureUnknown;
4890 4891
4891 // Make navigation state a part of the DidCommitProvisionalLoad message so 4892 // Make navigation state a part of the DidCommitProvisionalLoad message so
4892 // that committed entry has it at all times. Send a single HistoryItem for 4893 // that committed entry has it at all times. Send a single HistoryItem for
4893 // this frame, rather than the whole tree. It will be stored in the 4894 // this frame, rather than the whole tree. It will be stored in the
4894 // corresponding FrameNavigationEntry. 4895 // corresponding FrameNavigationEntry.
4895 params.page_state = SingleHistoryItemToPageState(item); 4896 params.page_state = SingleHistoryItemToPageState(item);
4896 4897
4898 params.content_source_id = GetRenderWidget()->GetContentSourceId();
4899
4897 params.method = request.httpMethod().latin1(); 4900 params.method = request.httpMethod().latin1();
4898 if (params.method == "POST") 4901 if (params.method == "POST")
4899 params.post_id = ExtractPostId(item); 4902 params.post_id = ExtractPostId(item);
4900 4903
4901 params.frame_unique_name = item.target().utf8(); 4904 params.frame_unique_name = item.target().utf8();
4902 params.item_sequence_number = item.itemSequenceNumber(); 4905 params.item_sequence_number = item.itemSequenceNumber();
4903 params.document_sequence_number = item.documentSequenceNumber(); 4906 params.document_sequence_number = item.documentSequenceNumber();
4904 4907
4905 // If the page contained a client redirect (meta refresh, document.loc...), 4908 // If the page contained a client redirect (meta refresh, document.loc...),
4906 // set the referrer appropriately. 4909 // set the referrer appropriately.
(...skipping 1957 matching lines...) Expand 10 before | Expand all | Expand 10 after
6864 // event target. Potentially a Pepper plugin will receive the event. 6867 // event target. Potentially a Pepper plugin will receive the event.
6865 // In order to tell whether a plugin gets the last mouse event and which it 6868 // In order to tell whether a plugin gets the last mouse event and which it
6866 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6869 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6867 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6870 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6868 // |pepper_last_mouse_event_target_|. 6871 // |pepper_last_mouse_event_target_|.
6869 pepper_last_mouse_event_target_ = nullptr; 6872 pepper_last_mouse_event_target_ = nullptr;
6870 #endif 6873 #endif
6871 } 6874 }
6872 6875
6873 } // namespace content 6876 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/gpu/render_widget_compositor.cc ('k') | content/renderer/render_widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698