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

Side by Side Diff: Source/core/frame/History.cpp

Issue 799923006: Make canNavigate() OOPI-friendly (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 11 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 | « Source/core/frame/FrameView.cpp ('k') | Source/core/frame/LocalDOMWindow.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 void History::go(ExecutionContext* context, int distance) 99 void History::go(ExecutionContext* context, int distance)
100 { 100 {
101 if (!m_frame || !m_frame->loader().client()) 101 if (!m_frame || !m_frame->loader().client())
102 return; 102 return;
103 103
104 ASSERT(isMainThread()); 104 ASSERT(isMainThread());
105 Document* activeDocument = toDocument(context); 105 Document* activeDocument = toDocument(context);
106 if (!activeDocument) 106 if (!activeDocument)
107 return; 107 return;
108 108
109 if (!activeDocument->canNavigate(*m_frame)) 109 if (!activeDocument->frame()->canNavigate(*m_frame))
dcheng 2015/01/08 23:17:26 Does this need a similar null check for frame()/
Nate Chapin 2015/01/09 00:12:46 Done.
110 return; 110 return;
111 111
112 if (distance) 112 if (distance)
113 m_frame->loader().client()->navigateBackForward(distance); 113 m_frame->loader().client()->navigateBackForward(distance);
114 else 114 else
115 m_frame->reload(NormalReload, ClientRedirect); 115 m_frame->reload(NormalReload, ClientRedirect);
116 } 116 }
117 117
118 KURL History::urlForState(const String& urlString) 118 KURL History::urlForState(const String& urlString)
119 { 119 {
(...skipping 15 matching lines...) Expand all
135 KURL fullURL = urlForState(urlString); 135 KURL fullURL = urlForState(urlString);
136 if (!fullURL.isValid() || !m_frame->document()->securityOrigin()->canRequest (fullURL)) { 136 if (!fullURL.isValid() || !m_frame->document()->securityOrigin()->canRequest (fullURL)) {
137 // We can safely expose the URL to JavaScript, as a) no redirection take s place: JavaScript already had this URL, b) JavaScript can only access a same-o rigin History object. 137 // We can safely expose the URL to JavaScript, as a) no redirection take s place: JavaScript already had this URL, b) JavaScript can only access a same-o rigin History object.
138 exceptionState.throwSecurityError("A history state object with URL '" + fullURL.elidedString() + "' cannot be created in a document with origin '" + m_f rame->document()->securityOrigin()->toString() + "'."); 138 exceptionState.throwSecurityError("A history state object with URL '" + fullURL.elidedString() + "' cannot be created in a document with origin '" + m_f rame->document()->securityOrigin()->toString() + "'.");
139 return; 139 return;
140 } 140 }
141 m_frame->loader().updateForSameDocumentNavigation(fullURL, SameDocumentNavig ationHistoryApi, data, type); 141 m_frame->loader().updateForSameDocumentNavigation(fullURL, SameDocumentNavig ationHistoryApi, data, type);
142 } 142 }
143 143
144 } // namespace blink 144 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/FrameView.cpp ('k') | Source/core/frame/LocalDOMWindow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698