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

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

Issue 2707243005: Discard compositor frames from unloaded web content (Closed)
Patch Set: Add default value for source ID in frame metadata Created 3 years, 9 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 3589 matching lines...) Expand 10 before | Expand all | Expand 10 after
3600 // If this is a provisional frame associated with a proxy (i.e., a frame 3600 // If this is a provisional frame associated with a proxy (i.e., a frame
3601 // created for a remote-to-local navigation), swap it into the frame tree 3601 // created for a remote-to-local navigation), swap it into the frame tree
3602 // now. 3602 // now.
3603 if (!SwapIn()) 3603 if (!SwapIn())
3604 return; 3604 return;
3605 } 3605 }
3606 3606
3607 // For new page navigations, the browser process needs to be notified of the 3607 // For new page navigations, the browser process needs to be notified of the
3608 // first paint of that page, so it can cancel the timer that waits for it. 3608 // first paint of that page, so it can cancel the timer that waits for it.
3609 if (is_main_frame_ && !navigation_state->WasWithinSamePage()) { 3609 if (is_main_frame_ && !navigation_state->WasWithinSamePage()) {
3610 GetRenderWidget()->IncrementContentSourceId();
3610 render_view_->QueueMessage( 3611 render_view_->QueueMessage(
3611 new ViewHostMsg_DidFirstPaintAfterLoad(render_view_->routing_id_), 3612 new ViewHostMsg_DidFirstPaintAfterLoad(render_view_->routing_id_),
3612 MESSAGE_DELIVERY_POLICY_WITH_VISUAL_STATE); 3613 MESSAGE_DELIVERY_POLICY_WITH_VISUAL_STATE);
3613 } 3614 }
3614 3615
3615 // When we perform a new navigation, we need to update the last committed 3616 // When we perform a new navigation, we need to update the last committed
3616 // session history entry with state for the page we are leaving. Do this 3617 // session history entry with state for the page we are leaving. Do this
3617 // before updating the current history item. 3618 // before updating the current history item.
3618 SendUpdateState(); 3619 SendUpdateState();
3619 3620
(...skipping 1252 matching lines...) Expand 10 before | Expand all | Expand 10 after
4872 4873
4873 params.gesture = render_view_->navigation_gesture_; 4874 params.gesture = render_view_->navigation_gesture_;
4874 render_view_->navigation_gesture_ = NavigationGestureUnknown; 4875 render_view_->navigation_gesture_ = NavigationGestureUnknown;
4875 4876
4876 // Make navigation state a part of the DidCommitProvisionalLoad message so 4877 // Make navigation state a part of the DidCommitProvisionalLoad message so
4877 // that committed entry has it at all times. Send a single HistoryItem for 4878 // that committed entry has it at all times. Send a single HistoryItem for
4878 // this frame, rather than the whole tree. It will be stored in the 4879 // this frame, rather than the whole tree. It will be stored in the
4879 // corresponding FrameNavigationEntry. 4880 // corresponding FrameNavigationEntry.
4880 params.page_state = SingleHistoryItemToPageState(item); 4881 params.page_state = SingleHistoryItemToPageState(item);
4881 4882
4883 params.content_source_id = GetRenderWidget()->GetContentSourceId();
4884
4882 params.method = request.httpMethod().latin1(); 4885 params.method = request.httpMethod().latin1();
4883 if (params.method == "POST") 4886 if (params.method == "POST")
4884 params.post_id = ExtractPostId(item); 4887 params.post_id = ExtractPostId(item);
4885 4888
4886 params.frame_unique_name = item.target().utf8(); 4889 params.frame_unique_name = item.target().utf8();
4887 params.item_sequence_number = item.itemSequenceNumber(); 4890 params.item_sequence_number = item.itemSequenceNumber();
4888 params.document_sequence_number = item.documentSequenceNumber(); 4891 params.document_sequence_number = item.documentSequenceNumber();
4889 4892
4890 // If the page contained a client redirect (meta refresh, document.loc...), 4893 // If the page contained a client redirect (meta refresh, document.loc...),
4891 // set the referrer appropriately. 4894 // set the referrer appropriately.
(...skipping 1957 matching lines...) Expand 10 before | Expand all | Expand 10 after
6849 // event target. Potentially a Pepper plugin will receive the event. 6852 // event target. Potentially a Pepper plugin will receive the event.
6850 // In order to tell whether a plugin gets the last mouse event and which it 6853 // In order to tell whether a plugin gets the last mouse event and which it
6851 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6854 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6852 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6855 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6853 // |pepper_last_mouse_event_target_|. 6856 // |pepper_last_mouse_event_target_|.
6854 pepper_last_mouse_event_target_ = nullptr; 6857 pepper_last_mouse_event_target_ = nullptr;
6855 #endif 6858 #endif
6856 } 6859 }
6857 6860
6858 } // namespace content 6861 } // 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