OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 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 13 matching lines...) Expand all Loading... |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 /** | 31 /** |
32 * @interface | 32 * @interface |
33 */ | 33 */ |
34 WebInspector.HistoryEntry = function() { } | 34 WebInspector.HistoryEntry = function() { }; |
35 | 35 |
36 WebInspector.HistoryEntry.prototype = { | 36 WebInspector.HistoryEntry.prototype = { |
37 /** | 37 /** |
38 * @return {boolean} | 38 * @return {boolean} |
39 */ | 39 */ |
40 valid: function() { }, | 40 valid: function() { }, |
41 | 41 |
42 reveal: function() { } | 42 reveal: function() { } |
43 }; | 43 }; |
44 | 44 |
45 /** | 45 /** |
46 * @constructor | 46 * @constructor |
47 * @param {number} historyDepth | 47 * @param {number} historyDepth |
48 */ | 48 */ |
49 WebInspector.SimpleHistoryManager = function(historyDepth) | 49 WebInspector.SimpleHistoryManager = function(historyDepth) |
50 { | 50 { |
51 this._entries = []; | 51 this._entries = []; |
52 this._activeEntryIndex = -1; | 52 this._activeEntryIndex = -1; |
53 this._coalescingReadonly = 0; | 53 this._coalescingReadonly = 0; |
54 this._historyDepth = historyDepth; | 54 this._historyDepth = historyDepth; |
55 } | 55 }; |
56 | 56 |
57 WebInspector.SimpleHistoryManager.prototype = { | 57 WebInspector.SimpleHistoryManager.prototype = { |
58 readOnlyLock: function() | 58 readOnlyLock: function() |
59 { | 59 { |
60 ++this._coalescingReadonly; | 60 ++this._coalescingReadonly; |
61 }, | 61 }, |
62 | 62 |
63 releaseReadOnlyLock: function() | 63 releaseReadOnlyLock: function() |
64 { | 64 { |
65 --this._coalescingReadonly; | 65 --this._coalescingReadonly; |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 return false; | 158 return false; |
159 | 159 |
160 this.readOnlyLock(); | 160 this.readOnlyLock(); |
161 this._entries[revealIndex].reveal(); | 161 this._entries[revealIndex].reveal(); |
162 this.releaseReadOnlyLock(); | 162 this.releaseReadOnlyLock(); |
163 | 163 |
164 this._activeEntryIndex = revealIndex; | 164 this._activeEntryIndex = revealIndex; |
165 return true; | 165 return true; |
166 }, | 166 }, |
167 }; | 167 }; |
OLD | NEW |