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

Side by Side Diff: content/browser/web_contents/navigation_controller_impl.cc

Issue 12086109: Prevent bindings escalation on an existing NavigationEntry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Catch another case where pending WebUI was set. Created 7 years, 10 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
« no previous file with comments | « no previous file | content/browser/web_contents/navigation_controller_impl_unittest.cc » ('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 (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/web_contents/navigation_controller_impl.h" 5 #include "content/browser/web_contents/navigation_controller_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after
919 // No longer needed since content state will hold the post data if any. 919 // No longer needed since content state will hold the post data if any.
920 active_entry->SetBrowserInitiatedPostData(NULL); 920 active_entry->SetBrowserInitiatedPostData(NULL);
921 921
922 // Once committed, we do not need to track if the entry was initiated by 922 // Once committed, we do not need to track if the entry was initiated by
923 // the renderer. 923 // the renderer.
924 active_entry->set_is_renderer_initiated(false); 924 active_entry->set_is_renderer_initiated(false);
925 925
926 // The active entry's SiteInstance should match our SiteInstance. 926 // The active entry's SiteInstance should match our SiteInstance.
927 DCHECK(active_entry->site_instance() == web_contents_->GetSiteInstance()); 927 DCHECK(active_entry->site_instance() == web_contents_->GetSiteInstance());
928 928
929 // Remember the bindings the renderer process has at this point, so that
930 // we do not grant this entry additional bindings if we come back to it.
931 active_entry->SetBindings(
932 web_contents_->GetRenderViewHost()->GetEnabledBindings());
933
929 // Now prep the rest of the details for the notification and broadcast. 934 // Now prep the rest of the details for the notification and broadcast.
930 details->entry = active_entry; 935 details->entry = active_entry;
931 details->is_main_frame = 936 details->is_main_frame =
932 PageTransitionIsMainFrame(params.transition); 937 PageTransitionIsMainFrame(params.transition);
933 details->serialized_security_info = params.security_info; 938 details->serialized_security_info = params.security_info;
934 details->http_status_code = params.http_status_code; 939 details->http_status_code = params.http_status_code;
935 NotifyNavigationEntryCommitted(details); 940 NotifyNavigationEntryCommitted(details);
936 941
937 return true; 942 return true;
938 } 943 }
(...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after
1769 const base::Callback<base::Time()>& get_timestamp_callback) { 1774 const base::Callback<base::Time()>& get_timestamp_callback) {
1770 get_timestamp_callback_ = get_timestamp_callback; 1775 get_timestamp_callback_ = get_timestamp_callback;
1771 } 1776 }
1772 1777
1773 void NavigationControllerImpl::SetTakeScreenshotCallbackForTest( 1778 void NavigationControllerImpl::SetTakeScreenshotCallbackForTest(
1774 const base::Callback<void(RenderViewHost*)>& take_screenshot_callback) { 1779 const base::Callback<void(RenderViewHost*)>& take_screenshot_callback) {
1775 take_screenshot_callback_ = take_screenshot_callback; 1780 take_screenshot_callback_ = take_screenshot_callback;
1776 } 1781 }
1777 1782
1778 } // namespace content 1783 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/web_contents/navigation_controller_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698