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

Unified Diff: chrome/renderer/content_settings_observer.cc

Issue 8404018: chrome.loadTimes() shouldn't be affected by in-document navigation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync and merge Created 9 years, 1 month 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
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/renderer/loadtimes_extension_bindings.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/content_settings_observer.cc
diff --git a/chrome/renderer/content_settings_observer.cc b/chrome/renderer/content_settings_observer.cc
index 0f77276baa352a5ab0fec84b1cdccc961f5d1dd5..d6a912c3131aa231c77a37336a960331035de560 100644
--- a/chrome/renderer/content_settings_observer.cc
+++ b/chrome/renderer/content_settings_observer.cc
@@ -6,6 +6,7 @@
#include "chrome/common/render_messages.h"
#include "chrome/common/url_constants.h"
+#include "content/public/renderer/document_state.h"
#include "content/public/renderer/navigation_state.h"
#include "content/public/renderer/render_view.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebDataSource.h"
@@ -23,6 +24,7 @@ using WebKit::WebSecurityOrigin;
using WebKit::WebString;
using WebKit::WebURL;
using WebKit::WebView;
+using content::DocumentState;
using content::NavigationState;
namespace {
@@ -135,8 +137,10 @@ void ContentSettingsObserver::DidCommitProvisionalLoad(
if (frame->parent())
return; // Not a top-level navigation.
- NavigationState* state = NavigationState::FromDataSource(frame->dataSource());
- if (!state->was_within_same_page()) {
+ DocumentState* document_state = DocumentState::FromDataSource(
+ frame->dataSource());
+ NavigationState* navigation_state = document_state->navigation_state();
+ if (!navigation_state->was_within_same_page()) {
// Clear "block" flags for the new page. This needs to happen before any of
// |AllowScript()|, |AllowScriptFromSource()|, |AllowImage()|, or
// |AllowPlugins()| is called for the new page so that these functions can
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/renderer/loadtimes_extension_bindings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698