| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 | 48 |
| 49 unsigned History::length() const | 49 unsigned History::length() const |
| 50 { | 50 { |
| 51 if (!m_frame) | 51 if (!m_frame) |
| 52 return 0; | 52 return 0; |
| 53 if (!m_frame->page()) | 53 if (!m_frame->page()) |
| 54 return 0; | 54 return 0; |
| 55 return m_frame->page()->backForward()->count(); | 55 return m_frame->page()->backForward()->count(); |
| 56 } | 56 } |
| 57 | 57 |
| 58 SerializedScriptValue* History::state() | 58 PassRefPtr<SerializedScriptValue> History::state() |
| 59 { | 59 { |
| 60 m_lastStateObjectRequested = stateInternal(); | 60 m_lastStateObjectRequested = stateInternal(); |
| 61 return m_lastStateObjectRequested; | 61 return m_lastStateObjectRequested; |
| 62 } | 62 } |
| 63 | 63 |
| 64 SerializedScriptValue* History::stateInternal() const | 64 PassRefPtr<SerializedScriptValue> History::stateInternal() const |
| 65 { | 65 { |
| 66 if (!m_frame) | 66 if (!m_frame) |
| 67 return 0; | 67 return 0; |
| 68 | 68 |
| 69 if (HistoryItem* historyItem = m_frame->loader()->history()->currentItem()) | 69 if (HistoryItem* historyItem = m_frame->loader()->history()->currentItem()) |
| 70 return historyItem->stateObject(); | 70 return historyItem->stateObject(); |
| 71 | 71 |
| 72 return 0; | 72 return 0; |
| 73 } | 73 } |
| 74 | 74 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 if (!urlString.isEmpty()) | 154 if (!urlString.isEmpty()) |
| 155 m_frame->document()->updateURLForPushOrReplaceState(fullURL); | 155 m_frame->document()->updateURLForPushOrReplaceState(fullURL); |
| 156 | 156 |
| 157 if (stateObjectType == StateObjectPush) | 157 if (stateObjectType == StateObjectPush) |
| 158 m_frame->loader()->client()->dispatchDidPushStateWithinPage(); | 158 m_frame->loader()->client()->dispatchDidPushStateWithinPage(); |
| 159 else if (stateObjectType == StateObjectReplace) | 159 else if (stateObjectType == StateObjectReplace) |
| 160 m_frame->loader()->client()->dispatchDidReplaceStateWithinPage(); | 160 m_frame->loader()->client()->dispatchDidReplaceStateWithinPage(); |
| 161 } | 161 } |
| 162 | 162 |
| 163 } // namespace WebCore | 163 } // namespace WebCore |
| OLD | NEW |