OLD | NEW |
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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 return KURL(baseURL, urlString); | 137 return KURL(baseURL, urlString); |
138 } | 138 } |
139 | 139 |
140 void History::stateObjectAdded(PassRefPtr<SerializedScriptValue> data, const Str
ing& title, const String& urlString, StateObjectType stateObjectType, ExceptionC
ode& ec) | 140 void History::stateObjectAdded(PassRefPtr<SerializedScriptValue> data, const Str
ing& title, const String& urlString, StateObjectType stateObjectType, ExceptionC
ode& ec) |
141 { | 141 { |
142 if (!m_frame || !m_frame->page()) | 142 if (!m_frame || !m_frame->page()) |
143 return; | 143 return; |
144 | 144 |
145 KURL fullURL = urlForState(urlString); | 145 KURL fullURL = urlForState(urlString); |
146 if (!fullURL.isValid() || !m_frame->document()->securityOrigin()->canRequest
(fullURL)) { | 146 if (!fullURL.isValid() || !m_frame->document()->securityOrigin()->canRequest
(fullURL)) { |
147 ec = SECURITY_ERR; | 147 ec = SecurityError; |
148 return; | 148 return; |
149 } | 149 } |
150 | 150 |
151 if (stateObjectType == StateObjectPush) | 151 if (stateObjectType == StateObjectPush) |
152 m_frame->loader()->history()->pushState(data, title, fullURL.string()); | 152 m_frame->loader()->history()->pushState(data, title, fullURL.string()); |
153 else if (stateObjectType == StateObjectReplace) | 153 else if (stateObjectType == StateObjectReplace) |
154 m_frame->loader()->history()->replaceState(data, title, fullURL.string()
); | 154 m_frame->loader()->history()->replaceState(data, title, fullURL.string()
); |
155 | 155 |
156 if (!urlString.isEmpty()) | 156 if (!urlString.isEmpty()) |
157 m_frame->document()->updateURLForPushOrReplaceState(fullURL); | 157 m_frame->document()->updateURLForPushOrReplaceState(fullURL); |
158 | 158 |
159 m_frame->loader()->client()->dispatchDidNavigateWithinPage(); | 159 m_frame->loader()->client()->dispatchDidNavigateWithinPage(); |
160 } | 160 } |
161 | 161 |
162 } // namespace WebCore | 162 } // namespace WebCore |
OLD | NEW |