OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 12 matching lines...) Expand all Loading... |
23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 */ | 27 */ |
28 | 28 |
29 #ifndef FrameLoaderStateMachine_h | 29 #ifndef FrameLoaderStateMachine_h |
30 #define FrameLoaderStateMachine_h | 30 #define FrameLoaderStateMachine_h |
31 | 31 |
32 #include "core/CoreExport.h" | 32 #include "core/CoreExport.h" |
| 33 #include "wtf/Allocator.h" |
33 #include "wtf/Noncopyable.h" | 34 #include "wtf/Noncopyable.h" |
34 | 35 |
35 namespace blink { | 36 namespace blink { |
36 | 37 |
37 // Encapsulates a state machine for FrameLoader. Note that this is different fro
m FrameState, | 38 // Encapsulates a state machine for FrameLoader. Note that this is different fro
m FrameState, |
38 // which stores the state of the current load that FrameLoader is executing. | 39 // which stores the state of the current load that FrameLoader is executing. |
39 class CORE_EXPORT FrameLoaderStateMachine { | 40 class CORE_EXPORT FrameLoaderStateMachine { |
| 41 DISALLOW_ALLOCATION(); |
40 WTF_MAKE_NONCOPYABLE(FrameLoaderStateMachine); | 42 WTF_MAKE_NONCOPYABLE(FrameLoaderStateMachine); |
41 public: | 43 public: |
42 FrameLoaderStateMachine(); | 44 FrameLoaderStateMachine(); |
43 | 45 |
44 // Once a load has been committed, the state may | 46 // Once a load has been committed, the state may |
45 // alternate between CommittedFirstRealLoad and FirstLayoutDone. | 47 // alternate between CommittedFirstRealLoad and FirstLayoutDone. |
46 // Otherwise, the states only go down the list. | 48 // Otherwise, the states only go down the list. |
47 enum State { | 49 enum State { |
48 CreatingInitialEmptyDocument, | 50 CreatingInitialEmptyDocument, |
49 DisplayingInitialEmptyDocument, | 51 DisplayingInitialEmptyDocument, |
50 CommittedFirstRealLoad, | 52 CommittedFirstRealLoad, |
51 CommittedMultipleRealLoads | 53 CommittedMultipleRealLoads |
52 }; | 54 }; |
53 | 55 |
54 bool committedFirstRealDocumentLoad() const; | 56 bool committedFirstRealDocumentLoad() const; |
55 bool creatingInitialEmptyDocument() const; | 57 bool creatingInitialEmptyDocument() const; |
56 bool isDisplayingInitialEmptyDocument() const; | 58 bool isDisplayingInitialEmptyDocument() const; |
57 bool committedMultipleRealLoads() const; | 59 bool committedMultipleRealLoads() const; |
58 void advanceTo(State); | 60 void advanceTo(State); |
59 | 61 |
60 private: | 62 private: |
61 State m_state; | 63 State m_state; |
62 }; | 64 }; |
63 | 65 |
64 } // namespace blink | 66 } // namespace blink |
65 | 67 |
66 #endif // FrameLoaderStateMachine_h | 68 #endif // FrameLoaderStateMachine_h |
OLD | NEW |