| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 else { | 95 else { |
| 96 m_history.resize(m_afterLastActionIndex); | 96 m_history.resize(m_afterLastActionIndex); |
| 97 m_history.append(action); | 97 m_history.append(action); |
| 98 ++m_afterLastActionIndex; | 98 ++m_afterLastActionIndex; |
| 99 } | 99 } |
| 100 return true; | 100 return true; |
| 101 } | 101 } |
| 102 | 102 |
| 103 void InspectorHistory::markUndoableState() | 103 void InspectorHistory::markUndoableState() |
| 104 { | 104 { |
| 105 perform(adoptPtr(new UndoableStateMark()), IGNORE_EXCEPTION_STATE); | 105 perform(adoptPtr(new UndoableStateMark()), IGNORE_EXCEPTION); |
| 106 } | 106 } |
| 107 | 107 |
| 108 bool InspectorHistory::undo(ExceptionState& es) | 108 bool InspectorHistory::undo(ExceptionState& es) |
| 109 { | 109 { |
| 110 while (m_afterLastActionIndex > 0 && m_history[m_afterLastActionIndex - 1]->
isUndoableStateMark()) | 110 while (m_afterLastActionIndex > 0 && m_history[m_afterLastActionIndex - 1]->
isUndoableStateMark()) |
| 111 --m_afterLastActionIndex; | 111 --m_afterLastActionIndex; |
| 112 | 112 |
| 113 while (m_afterLastActionIndex > 0) { | 113 while (m_afterLastActionIndex > 0) { |
| 114 Action* action = m_history[m_afterLastActionIndex - 1].get(); | 114 Action* action = m_history[m_afterLastActionIndex - 1].get(); |
| 115 if (!action->undo(es)) { | 115 if (!action->undo(es)) { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 143 } | 143 } |
| 144 | 144 |
| 145 void InspectorHistory::reset() | 145 void InspectorHistory::reset() |
| 146 { | 146 { |
| 147 m_afterLastActionIndex = 0; | 147 m_afterLastActionIndex = 0; |
| 148 m_history.clear(); | 148 m_history.clear(); |
| 149 } | 149 } |
| 150 | 150 |
| 151 } // namespace WebCore | 151 } // namespace WebCore |
| 152 | 152 |
| OLD | NEW |