| 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 14 matching lines...) Expand all Loading... |
| 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/Allocator.h" |
| 34 #include "wtf/Noncopyable.h" | 34 #include "wtf/Noncopyable.h" |
| 35 #include "wtf/text/WTFString.h" |
| 35 | 36 |
| 36 namespace blink { | 37 namespace blink { |
| 37 | 38 |
| 38 // Encapsulates a state machine for FrameLoader. Note that this is different fro
m FrameState, | 39 // Encapsulates a state machine for FrameLoader. Note that this is different fro
m FrameState, |
| 39 // which stores the state of the current load that FrameLoader is executing. | 40 // which stores the state of the current load that FrameLoader is executing. |
| 40 class CORE_EXPORT FrameLoaderStateMachine { | 41 class CORE_EXPORT FrameLoaderStateMachine { |
| 41 DISALLOW_NEW(); | 42 DISALLOW_NEW(); |
| 42 WTF_MAKE_NONCOPYABLE(FrameLoaderStateMachine); | 43 WTF_MAKE_NONCOPYABLE(FrameLoaderStateMachine); |
| 43 public: | 44 public: |
| 44 FrameLoaderStateMachine(); | 45 FrameLoaderStateMachine(); |
| 45 | 46 |
| 46 // Once a load has been committed, the state may | 47 // Once a load has been committed, the state may |
| 47 // alternate between CommittedFirstRealLoad and FirstLayoutDone. | 48 // alternate between CommittedFirstRealLoad and FirstLayoutDone. |
| 48 // Otherwise, the states only go down the list. | 49 // Otherwise, the states only go down the list. |
| 49 enum State { | 50 enum State { |
| 50 CreatingInitialEmptyDocument, | 51 CreatingInitialEmptyDocument, |
| 51 DisplayingInitialEmptyDocument, | 52 DisplayingInitialEmptyDocument, |
| 52 CommittedFirstRealLoad, | 53 CommittedFirstRealLoad, |
| 53 CommittedMultipleRealLoads | 54 CommittedMultipleRealLoads |
| 54 }; | 55 }; |
| 55 | 56 |
| 56 bool committedFirstRealDocumentLoad() const; | 57 bool committedFirstRealDocumentLoad() const; |
| 57 bool creatingInitialEmptyDocument() const; | 58 bool creatingInitialEmptyDocument() const; |
| 58 bool isDisplayingInitialEmptyDocument() const; | 59 bool isDisplayingInitialEmptyDocument() const; |
| 59 bool committedMultipleRealLoads() const; | 60 bool committedMultipleRealLoads() const; |
| 60 void advanceTo(State); | 61 void advanceTo(State); |
| 61 | 62 |
| 63 String toString() const; |
| 64 |
| 62 private: | 65 private: |
| 63 State m_state; | 66 State m_state; |
| 64 }; | 67 }; |
| 65 | 68 |
| 66 } // namespace blink | 69 } // namespace blink |
| 67 | 70 |
| 68 #endif // FrameLoaderStateMachine_h | 71 #endif // FrameLoaderStateMachine_h |
| OLD | NEW |