Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #ifndef nsHtml5TreeOpStage_h
6 #define nsHtml5TreeOpStage_h
8 #include "mozilla/Mutex.h"
9 #include "nsHtml5TreeOperation.h"
10 #include "nsTArray.h"
11 #include "nsAHtml5TreeOpSink.h"
12 #include "nsHtml5SpeculativeLoad.h"
14 class nsHtml5TreeOpStage : public nsAHtml5TreeOpSink {
15 public:
17 nsHtml5TreeOpStage();
19 virtual ~nsHtml5TreeOpStage();
21 /**
22 * Flush the operations from the tree operations from the argument
23 * queue unconditionally.
24 */
25 virtual void MoveOpsFrom(nsTArray<nsHtml5TreeOperation>& aOpQueue);
27 /**
28 * Retrieve the staged operations and speculative loads into the arguments.
29 */
30 void MoveOpsAndSpeculativeLoadsTo(nsTArray<nsHtml5TreeOperation>& aOpQueue,
31 nsTArray<nsHtml5SpeculativeLoad>& aSpeculativeLoadQueue);
33 /**
34 * Move the speculative loads from the argument into the staging queue.
35 */
36 void MoveSpeculativeLoadsFrom(nsTArray<nsHtml5SpeculativeLoad>& aSpeculativeLoadQueue);
38 /**
39 * Retrieve the staged speculative loads into the argument.
40 */
41 void MoveSpeculativeLoadsTo(nsTArray<nsHtml5SpeculativeLoad>& aSpeculativeLoadQueue);
43 #ifdef DEBUG
44 void AssertEmpty();
45 #endif
47 private:
48 nsTArray<nsHtml5TreeOperation> mOpQueue;
49 nsTArray<nsHtml5SpeculativeLoad> mSpeculativeLoadQueue;
50 mozilla::Mutex mMutex;
52 };
54 #endif /* nsHtml5TreeOpStage_h */