Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  StopGapEventTarget.h

  Sprache: C
 

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */


#ifndef mozilla_StopGapEventTarget_h
#define mozilla_StopGapEventTarget_h

#include "nsISerialEventTarget.h"
#include "nsCOMPtr.h"
#include "nsISupports.h"
#include "nsTArray.h"
#include "mozilla/Mutex.h"
#include "mozilla/Queue.h"

namespace mozilla {

// This is an event target that buffers events until a "real" event target is
// connected to it. This is for situations where events must be dispatched, but
// we don't know *where* yet.
// Note: GetCurrentSerialEventTarget and friends will return the *real* event
// target for tasks that are dispatched to this.
class StopGapEventTarget final : public nsISerialEventTarget {
 public:
  StopGapEventTarget();

  NS_DECL_THREADSAFE_ISUPPORTS
  NS_DECL_NSIEVENTTARGET_FULL

  // Call this when you know the real event target. Dispatches all queued
  // events right away, and passes subsequent events straight through.
  nsresult SetRealEventTarget(nsISerialEventTarget* aRealEventTarget);

 private:
  virtual ~StopGapEventTarget();
  typedef struct TaskStruct {
    nsCOMPtr<nsIRunnable> event;
    nsIEventTarget::DispatchFlags flags;
  } TaskStruct;

  Mutex mMutex;
  nsCOMPtr<nsISerialEventTarget> mRealEventTarget MOZ_GUARDED_BY(mMutex);
  nsTArray<TaskStruct> mTasks MOZ_GUARDED_BY(mMutex);
};
}  // namespace mozilla

#endif  // mozilla_StopGapEventTarget_h

Messung V0.5 in Prozent
C=91 H=95 G=92

¤ Dauer der Verarbeitung: 0.2 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=141584
#Domains=752002