parser/html/nsHtml5TreeOpStage.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/parser/html/nsHtml5TreeOpStage.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,54 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +
     1.8 +#ifndef nsHtml5TreeOpStage_h
     1.9 +#define nsHtml5TreeOpStage_h
    1.10 +
    1.11 +#include "mozilla/Mutex.h"
    1.12 +#include "nsHtml5TreeOperation.h"
    1.13 +#include "nsTArray.h"
    1.14 +#include "nsAHtml5TreeOpSink.h"
    1.15 +#include "nsHtml5SpeculativeLoad.h"
    1.16 +
    1.17 +class nsHtml5TreeOpStage : public nsAHtml5TreeOpSink {
    1.18 +  public:
    1.19 +  
    1.20 +    nsHtml5TreeOpStage();
    1.21 +    
    1.22 +    virtual ~nsHtml5TreeOpStage();
    1.23 +  
    1.24 +    /**
    1.25 +     * Flush the operations from the tree operations from the argument
    1.26 +     * queue unconditionally.
    1.27 +     */
    1.28 +    virtual void MoveOpsFrom(nsTArray<nsHtml5TreeOperation>& aOpQueue);
    1.29 +    
    1.30 +    /**
    1.31 +     * Retrieve the staged operations and speculative loads into the arguments.
    1.32 +     */
    1.33 +    void MoveOpsAndSpeculativeLoadsTo(nsTArray<nsHtml5TreeOperation>& aOpQueue,
    1.34 +        nsTArray<nsHtml5SpeculativeLoad>& aSpeculativeLoadQueue);
    1.35 +
    1.36 +    /**
    1.37 +     * Move the speculative loads from the argument into the staging queue.
    1.38 +     */
    1.39 +    void MoveSpeculativeLoadsFrom(nsTArray<nsHtml5SpeculativeLoad>& aSpeculativeLoadQueue);
    1.40 +
    1.41 +    /**
    1.42 +     * Retrieve the staged speculative loads into the argument.
    1.43 +     */
    1.44 +    void MoveSpeculativeLoadsTo(nsTArray<nsHtml5SpeculativeLoad>& aSpeculativeLoadQueue);
    1.45 +
    1.46 +#ifdef DEBUG
    1.47 +    void AssertEmpty();
    1.48 +#endif
    1.49 +
    1.50 +  private:
    1.51 +    nsTArray<nsHtml5TreeOperation> mOpQueue;
    1.52 +    nsTArray<nsHtml5SpeculativeLoad> mSpeculativeLoadQueue;
    1.53 +    mozilla::Mutex mMutex;
    1.54 +    
    1.55 +};
    1.56 +
    1.57 +#endif /* nsHtml5TreeOpStage_h */

mercurial