netwerk/protocol/websocket/WebSocketFrameListenerParent.h
author Andrea Marchesini <amarchesini@mozilla.com>
Mon, 26 Oct 2015 15:31:00 +0000
changeset 304690 e415ff528bd18f8e5db55051ddee6ec3be2c6d6c
child 305182 1e700005a0ddf2b17803213e1f3f8d78a7a618b8
permissions -rw-r--r--
Bug 1203802 - Websocket Frame Listener API for devtool Network Inspector - part 4 - IPC, r=michal

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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_net_WebSocketFrameListenerParent_h
#define mozilla_net_WebSocketFrameListenerParent_h

#include "mozilla/net/PWebSocketFrameListenerParent.h"
#include "nsIWebSocketFrameService.h"

namespace mozilla {
namespace net {

class WebSocketFrameService;

class WebSocketFrameListenerParent final : public PWebSocketFrameListenerParent
                                         , public nsIWebSocketFrameListener
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIWEBSOCKETFRAMELISTENER

  explicit WebSocketFrameListenerParent(uint64_t aInnerWindowID);

private:
  ~WebSocketFrameListenerParent();

  virtual bool RecvClose() override;

  virtual void ActorDestroy(ActorDestroyReason aWhy) override;

  void UnregisterListener();

  RefPtr<WebSocketFrameService> mService;
  uint64_t mInnerWindowID;
};

} // namespace net
} // namespace mozilla

#endif // mozilla_net_WebSocketFrameListenerParent_h