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 |
11 * documentation and/or other materials provided with the distribution. | 11 * documentation and/or other materials provided with the distribution. |
12 * | 12 * |
13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY | 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY |
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR | 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR |
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #ifndef History_h | 26 #ifndef History_h |
27 #define History_h | 27 #define History_h |
28 | 28 |
| 29 #include "base/gtest_prod_util.h" |
29 #include "bindings/core/v8/ScriptWrappable.h" | 30 #include "bindings/core/v8/ScriptWrappable.h" |
30 #include "bindings/core/v8/SerializedScriptValue.h" | 31 #include "bindings/core/v8/SerializedScriptValue.h" |
31 #include "core/loader/FrameLoaderTypes.h" | 32 #include "core/loader/FrameLoaderTypes.h" |
32 #include "core/frame/DOMWindowProperty.h" | 33 #include "core/frame/DOMWindowProperty.h" |
33 #include "platform/heap/Handle.h" | 34 #include "platform/heap/Handle.h" |
34 #include "wtf/Forward.h" | 35 #include "wtf/Forward.h" |
35 | 36 |
36 namespace blink { | 37 namespace blink { |
37 | 38 |
38 class LocalFrame; | 39 class LocalFrame; |
39 class KURL; | 40 class KURL; |
40 class ExecutionContext; | 41 class ExecutionContext; |
41 class ExceptionState; | 42 class ExceptionState; |
| 43 class SecurityOrigin; |
42 | 44 |
43 class History final : public GarbageCollectedFinalized<History>, public ScriptWr
appable, public DOMWindowProperty { | 45 class CORE_EXPORT History final : public GarbageCollectedFinalized<History>, pub
lic ScriptWrappable, public DOMWindowProperty { |
44 DEFINE_WRAPPERTYPEINFO(); | 46 DEFINE_WRAPPERTYPEINFO(); |
45 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(History); | 47 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(History); |
46 public: | 48 public: |
47 static History* create(LocalFrame* frame) | 49 static History* create(LocalFrame* frame) |
48 { | 50 { |
49 return new History(frame); | 51 return new History(frame); |
50 } | 52 } |
51 | 53 |
52 unsigned length() const; | 54 unsigned length() const; |
53 SerializedScriptValue* state(); | 55 SerializedScriptValue* state(); |
(...skipping 15 matching lines...) Expand all Loading... |
69 void setScrollRestoration(const String& value); | 71 void setScrollRestoration(const String& value); |
70 String scrollRestoration(); | 72 String scrollRestoration(); |
71 | 73 |
72 bool stateChanged() const; | 74 bool stateChanged() const; |
73 bool isSameAsCurrentState(SerializedScriptValue*) const; | 75 bool isSameAsCurrentState(SerializedScriptValue*) const; |
74 | 76 |
75 | 77 |
76 DECLARE_VIRTUAL_TRACE(); | 78 DECLARE_VIRTUAL_TRACE(); |
77 | 79 |
78 private: | 80 private: |
| 81 FRIEND_TEST_ALL_PREFIXES(HistoryTest, CanChangeToURL); |
| 82 FRIEND_TEST_ALL_PREFIXES(HistoryTest, CanChangeToURLInFileOrigin); |
| 83 FRIEND_TEST_ALL_PREFIXES(HistoryTest, CanChangeToURLInUniqueOrigin); |
| 84 |
79 explicit History(LocalFrame*); | 85 explicit History(LocalFrame*); |
80 | 86 |
| 87 static bool canChangeToUrl(const KURL&, SecurityOrigin*, const KURL& documen
tURL); |
| 88 |
81 KURL urlForState(const String& url); | 89 KURL urlForState(const String& url); |
82 bool canChangeToUrl(const KURL& url); | |
83 | 90 |
84 void stateObjectAdded(PassRefPtr<SerializedScriptValue>, const String& title
, const String& url, HistoryScrollRestorationType, FrameLoadType, ExceptionState
&); | 91 void stateObjectAdded(PassRefPtr<SerializedScriptValue>, const String& title
, const String& url, HistoryScrollRestorationType, FrameLoadType, ExceptionState
&); |
85 SerializedScriptValue* stateInternal() const; | 92 SerializedScriptValue* stateInternal() const; |
86 HistoryScrollRestorationType scrollRestorationInternal() const; | 93 HistoryScrollRestorationType scrollRestorationInternal() const; |
87 | 94 |
88 RefPtr<SerializedScriptValue> m_lastStateObjectRequested; | 95 RefPtr<SerializedScriptValue> m_lastStateObjectRequested; |
89 }; | 96 }; |
90 | 97 |
91 } // namespace blink | 98 } // namespace blink |
92 | 99 |
93 #endif // History_h | 100 #endif // History_h |
OLD | NEW |