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

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

Issue 263903006: Reland "Make same-document history navigations commit with the proper type." (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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/History.h ('k') | Source/core/loader/FrameLoader.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 /* 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 Document* document = m_frame->document(); 116 Document* document = m_frame->document();
117 117
118 if (urlString.isNull()) 118 if (urlString.isNull())
119 return document->url(); 119 return document->url();
120 if (urlString.isEmpty()) 120 if (urlString.isEmpty())
121 return document->baseURL(); 121 return document->baseURL();
122 122
123 return KURL(document->baseURL(), urlString); 123 return KURL(document->baseURL(), urlString);
124 } 124 }
125 125
126 void History::stateObjectAdded(PassRefPtr<SerializedScriptValue> data, const Str ing& /* title */, const String& urlString, UpdateBackForwardListPolicy updateBac kForwardListPolicy, ExceptionState& exceptionState) 126 void History::stateObjectAdded(PassRefPtr<SerializedScriptValue> data, const Str ing& /* title */, const String& urlString, FrameLoadType type, ExceptionState& e xceptionState)
127 { 127 {
128 if (!m_frame || !m_frame->page() || !m_frame->loader().documentLoader()) 128 if (!m_frame || !m_frame->page() || !m_frame->loader().documentLoader())
129 return; 129 return;
130 130
131 KURL fullURL = urlForState(urlString); 131 KURL fullURL = urlForState(urlString);
132 if (!fullURL.isValid() || !m_frame->document()->securityOrigin()->canRequest (fullURL)) { 132 if (!fullURL.isValid() || !m_frame->document()->securityOrigin()->canRequest (fullURL)) {
133 // 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. 133 // 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.
134 exceptionState.throwSecurityError("A history state object with URL '" + fullURL.elidedString() + "' cannot be created in a document with origin '" + m_f rame->document()->securityOrigin()->toString() + "'."); 134 exceptionState.throwSecurityError("A history state object with URL '" + fullURL.elidedString() + "' cannot be created in a document with origin '" + m_f rame->document()->securityOrigin()->toString() + "'.");
135 return; 135 return;
136 } 136 }
137 m_frame->loader().updateForSameDocumentNavigation(fullURL, SameDocumentNavig ationHistoryApi, data, updateBackForwardListPolicy); 137 m_frame->loader().updateForSameDocumentNavigation(fullURL, SameDocumentNavig ationHistoryApi, data, type);
138 } 138 }
139 139
140 } // namespace WebCore 140 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/frame/History.h ('k') | Source/core/loader/FrameLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698