content/media/webaudio/OfflineAudioCompletionEvent.h

Fri, 16 Jan 2015 04:50:19 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 04:50:19 +0100
branch
TOR_BUG_9701
changeset 13
44a2da4a2ab2
permissions
-rw-r--r--

Replace accessor implementation with direct member state manipulation, by
request https://trac.torproject.org/projects/tor/ticket/9701#comment:32

     1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* vim:set ts=2 sw=2 sts=2 et cindent: */
     3 /* This Source Code Form is subject to the terms of the Mozilla Public
     4  * License, v. 2.0. If a copy of the MPL was not distributed with this
     5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 #ifndef OfflineAudioCompletionEvent_h_
     8 #define OfflineAudioCompletionEvent_h_
    10 #include "AudioBuffer.h"
    11 #include "mozilla/dom/Event.h"
    13 namespace mozilla {
    14 namespace dom {
    16 class AudioContext;
    18 class OfflineAudioCompletionEvent : public Event
    19 {
    20 public:
    21   OfflineAudioCompletionEvent(AudioContext* aOwner,
    22                               nsPresContext* aPresContext,
    23                               WidgetEvent* aEvent);
    25   NS_DECL_ISUPPORTS_INHERITED
    26   NS_FORWARD_TO_EVENT
    27   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(OfflineAudioCompletionEvent, Event)
    29   virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
    31   void InitEvent(AudioBuffer* aRenderedBuffer)
    32   {
    33     InitEvent(NS_LITERAL_STRING("complete"), false, false);
    34     mRenderedBuffer = aRenderedBuffer;
    35   }
    37   AudioBuffer* RenderedBuffer() const
    38   {
    39     return mRenderedBuffer;
    40   }
    42 private:
    43   nsRefPtr<AudioBuffer> mRenderedBuffer;
    44 };
    46 }
    47 }
    49 #endif

mercurial