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

Side by Side Diff: content/browser/renderer_host/render_view_host.cc

Issue 9447084: Refactor Pickle Read methods to use higher performance PickleIterator. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: jar feedback Created 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/browser/renderer_host/render_view_host.h" 5 #include "content/browser/renderer_host/render_view_host.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after
917 // notification containing parameters identifying the navigation. 917 // notification containing parameters identifying the navigation.
918 // 918 //
919 // Subframes are identified by the page transition type. For subframes loaded 919 // Subframes are identified by the page transition type. For subframes loaded
920 // as part of a wider page load, the page_id will be the same as for the top 920 // as part of a wider page load, the page_id will be the same as for the top
921 // level frame. If the user explicitly requests a subframe navigation, we will 921 // level frame. If the user explicitly requests a subframe navigation, we will
922 // get a new page_id because we need to create a new navigation entry for that 922 // get a new page_id because we need to create a new navigation entry for that
923 // action. 923 // action.
924 void RenderViewHost::OnMsgNavigate(const IPC::Message& msg) { 924 void RenderViewHost::OnMsgNavigate(const IPC::Message& msg) {
925 // Read the parameters out of the IPC message directly to avoid making another 925 // Read the parameters out of the IPC message directly to avoid making another
926 // copy when we filter the URLs. 926 // copy when we filter the URLs.
927 void* iter = NULL; 927 PickleReader iter(msg);
928 ViewHostMsg_FrameNavigate_Params validated_params; 928 ViewHostMsg_FrameNavigate_Params validated_params;
929 if (!IPC::ParamTraits<ViewHostMsg_FrameNavigate_Params>:: 929 if (!IPC::ParamTraits<ViewHostMsg_FrameNavigate_Params>::
930 Read(&msg, &iter, &validated_params)) 930 Read(&msg, &iter, &validated_params))
931 return; 931 return;
932 932
933 // If we're waiting for a cross-site beforeunload ack from this renderer and 933 // If we're waiting for a cross-site beforeunload ack from this renderer and
934 // we receive a Navigate message from the main frame, then the renderer was 934 // we receive a Navigate message from the main frame, then the renderer was
935 // navigating already and sent it before hearing the ViewMsg_Stop message. 935 // navigating already and sent it before hearing the ViewMsg_Stop message.
936 // We do not want to cancel the pending navigation in this case, since the 936 // We do not want to cancel the pending navigation in this case, since the
937 // old page will soon be stopped. Instead, treat this as a beforeunload ack 937 // old page will soon be stopped. Instead, treat this as a beforeunload ack
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after
1601 // Whenever we change swap out state, we should not be waiting for 1601 // Whenever we change swap out state, we should not be waiting for
1602 // beforeunload or unload acks. We clear them here to be safe, since they 1602 // beforeunload or unload acks. We clear them here to be safe, since they
1603 // can cause navigations to be ignored in OnMsgNavigate. 1603 // can cause navigations to be ignored in OnMsgNavigate.
1604 is_waiting_for_beforeunload_ack_ = false; 1604 is_waiting_for_beforeunload_ack_ = false;
1605 is_waiting_for_unload_ack_ = false; 1605 is_waiting_for_unload_ack_ = false;
1606 } 1606 }
1607 1607
1608 void RenderViewHost::ClearPowerSaveBlockers() { 1608 void RenderViewHost::ClearPowerSaveBlockers() {
1609 STLDeleteValues(&power_save_blockers_); 1609 STLDeleteValues(&power_save_blockers_);
1610 } 1610 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698