Bug 1215092 - WebSocketEventService and WebSocket discovering - part 1 - Renaming WebSocketFrameService, r=michal
☠☠ backed out by 1e9c356aafe6 ☠ ☠
authorAndrea Marchesini <amarchesini@mozilla.com>
Wed, 28 Oct 2015 11:41:24 +0000
changeset 305144 7393a036ce363c6193aba95323147bc616e732b8
parent 305143 9a67e1d55e0d52f1921ae3edfde4da779ace9655
child 305145 2284c3e8c3367025ec3d4a29225f97c30f61ebf3
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmichal
bugs1215092
milestone44.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1215092 - WebSocketEventService and WebSocket discovering - part 1 - Renaming WebSocketFrameService, r=michal
dom/base/test/test_websocket_frame.html
layout/build/nsLayoutModule.cpp
netwerk/ipc/NeckoChild.cpp
netwerk/ipc/NeckoChild.h
netwerk/ipc/NeckoParent.cpp
netwerk/ipc/NeckoParent.h
netwerk/ipc/PNecko.ipdl
netwerk/protocol/websocket/PWebSocketEventListener.ipdl
netwerk/protocol/websocket/PWebSocketFrameListener.ipdl
netwerk/protocol/websocket/WebSocketChannel.cpp
netwerk/protocol/websocket/WebSocketChannel.h
netwerk/protocol/websocket/WebSocketEventListenerChild.cpp
netwerk/protocol/websocket/WebSocketEventListenerChild.h
netwerk/protocol/websocket/WebSocketEventListenerParent.cpp
netwerk/protocol/websocket/WebSocketEventListenerParent.h
netwerk/protocol/websocket/WebSocketEventService.cpp
netwerk/protocol/websocket/WebSocketEventService.h
netwerk/protocol/websocket/WebSocketFrame.h
netwerk/protocol/websocket/WebSocketFrameListenerChild.cpp
netwerk/protocol/websocket/WebSocketFrameListenerChild.h
netwerk/protocol/websocket/WebSocketFrameListenerParent.cpp
netwerk/protocol/websocket/WebSocketFrameListenerParent.h
netwerk/protocol/websocket/WebSocketFrameService.cpp
netwerk/protocol/websocket/WebSocketFrameService.h
netwerk/protocol/websocket/moz.build
netwerk/protocol/websocket/nsIWebSocketEventService.idl
netwerk/protocol/websocket/nsIWebSocketFrameService.idl
--- a/dom/base/test/test_websocket_frame.html
+++ b/dom/base/test/test_websocket_frame.html
@@ -23,22 +23,22 @@ var tests = [
   { payload: "end" },
 ]
 
 var innerId =
   window.top.QueryInterface(Ci.nsIInterfaceRequestor)
         .getInterface(Ci.nsIDOMWindowUtils).currentInnerWindowID;
 ok(innerId, "We have a valid innerWindowID: " + innerId);
 
-var service = Cc["@mozilla.org/websocketframe/service;1"]
-                .getService(Ci.nsIWebSocketFrameService);
-ok(!!service, "We have the nsIWebSocketFrameService");
+var service = Cc["@mozilla.org/websocketevent/service;1"]
+                .getService(Ci.nsIWebSocketEventService);
+ok(!!service, "We have the nsIWebSocketEventService");
 
 var listener = {
-  QueryInterface: XPCOMUtils.generateQI([Ci.nsIWebSocketFrameListener]),
+  QueryInterface: XPCOMUtils.generateQI([Ci.nsIWebSocketEventListener]),
 
   frameReceived: function(aWebSocketSerialID, aFrame) {
     ok(!!aFrame, "We have received a frame");
 
     if (tests.length) {
       ok(aFrame.timeStamp, "Checking timeStamp: " + aFrame.timeStamp);
       is(aFrame.finBit, true, "Checking finBit");
       is(aFrame.rsvBit1, true, "Checking rsvBit1");
--- a/layout/build/nsLayoutModule.cpp
+++ b/layout/build/nsLayoutModule.cpp
@@ -226,17 +226,17 @@ static void Shutdown();
 #include "nsIMobileMessageService.h"
 #include "nsIMobileMessageDatabaseService.h"
 #include "nsIPowerManagerService.h"
 #include "nsIAlarmHalService.h"
 #include "nsIMediaManager.h"
 #include "mozilla/dom/nsMixedContentBlocker.h"
 
 #include "AudioChannelService.h"
-#include "mozilla/net/WebSocketFrameService.h"
+#include "mozilla/net/WebSocketEventService.h"
 
 #include "mozilla/dom/DataStoreService.h"
 
 #include "mozilla/dom/power/PowerManagerService.h"
 #include "mozilla/dom/alarm/AlarmHalService.h"
 #include "mozilla/dom/time/TimeService.h"
 #include "StreamingProtocolService.h"
 
@@ -628,27 +628,27 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsDOMScri
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(Geolocation, Init)
 
 #define NS_GEOLOCATION_SERVICE_CID \
   { 0x404d02a, 0x1CA, 0xAAAB, { 0x47, 0x62, 0x94, 0x4b, 0x1b, 0xf2, 0xf7, 0xb5 } }
 
 #define NS_AUDIOCHANNEL_SERVICE_CID \
   { 0xf712e983, 0x048a, 0x443f, { 0x88, 0x02, 0xfc, 0xc3, 0xd9, 0x27, 0xce, 0xac }}
 
-#define NS_WEBSOCKETFRAME_SERVICE_CID \
-  { 0x5973dd8f, 0xed2c, 0x41ff, { 0x9e, 0x64, 0x25, 0x1f, 0xf5, 0x5a, 0x67, 0xb9 }}
+#define NS_WEBSOCKETEVENT_SERVICE_CID \
+  { 0x31689828, 0xda66, 0x49a6, { 0x87, 0x0c, 0xdf, 0x62, 0xb8, 0x3f, 0xe7, 0x89 }}
 
 #define NS_DATASTORE_SERVICE_CID \
   { 0x0d4285fe, 0xf1b3, 0x49fa, { 0xbc, 0x51, 0xa4, 0xa8, 0x3f, 0x0a, 0xaf, 0x85 }}
 
 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsGeolocationService, nsGeolocationService::GetGeolocationService)
 
 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(AudioChannelService, AudioChannelService::GetOrCreate)
 
-NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(WebSocketFrameService, WebSocketFrameService::GetOrCreate)
+NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(WebSocketEventService, WebSocketEventService::GetOrCreate)
 
 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(DataStoreService, DataStoreService::GetOrCreate)
 
 #ifdef MOZ_WEBSPEECH_TEST_BACKEND
 NS_GENERIC_FACTORY_CONSTRUCTOR(FakeSpeechRecognitionService)
 #endif
 #ifdef MOZ_WEBSPEECH_POCKETSPHINX
 NS_GENERIC_FACTORY_CONSTRUCTOR(PocketSphinxSpeechRecognitionService)
@@ -790,17 +790,17 @@ NS_DEFINE_NAMED_CID(NS_HTMLEDITOR_CID);
 NS_DEFINE_NAMED_CID(NS_EDITORCONTROLLER_CID);
 NS_DEFINE_NAMED_CID(NS_EDITINGCONTROLLER_CID);
 NS_DEFINE_NAMED_CID(NS_EDITORCOMMANDTABLE_CID);
 NS_DEFINE_NAMED_CID(NS_EDITINGCOMMANDTABLE_CID);
 NS_DEFINE_NAMED_CID(NS_TEXTSERVICESDOCUMENT_CID);
 NS_DEFINE_NAMED_CID(NS_GEOLOCATION_SERVICE_CID);
 NS_DEFINE_NAMED_CID(NS_GEOLOCATION_CID);
 NS_DEFINE_NAMED_CID(NS_AUDIOCHANNEL_SERVICE_CID);
-NS_DEFINE_NAMED_CID(NS_WEBSOCKETFRAME_SERVICE_CID);
+NS_DEFINE_NAMED_CID(NS_WEBSOCKETEVENT_SERVICE_CID);
 NS_DEFINE_NAMED_CID(NS_DATASTORE_SERVICE_CID);
 NS_DEFINE_NAMED_CID(NS_FOCUSMANAGER_CID);
 NS_DEFINE_NAMED_CID(NS_CONTENTSECURITYMANAGER_CID);
 NS_DEFINE_NAMED_CID(CSPSERVICE_CID);
 NS_DEFINE_NAMED_CID(NS_CSPCONTEXT_CID);
 NS_DEFINE_NAMED_CID(NS_MIXEDCONTENTBLOCKER_CID);
 NS_DEFINE_NAMED_CID(NS_EVENTLISTENERSERVICE_CID);
 NS_DEFINE_NAMED_CID(NS_GLOBALMESSAGEMANAGER_CID);
@@ -1098,17 +1098,17 @@ static const mozilla::Module::CIDEntry k
   { &kNS_EDITORCONTROLLER_CID, false, nullptr, nsEditorControllerConstructor },
   { &kNS_EDITINGCONTROLLER_CID, false, nullptr, nsEditingControllerConstructor },
   { &kNS_EDITORCOMMANDTABLE_CID, false, nullptr, nsEditorCommandTableConstructor },
   { &kNS_EDITINGCOMMANDTABLE_CID, false, nullptr, nsEditingCommandTableConstructor },
   { &kNS_TEXTSERVICESDOCUMENT_CID, false, nullptr, nsTextServicesDocumentConstructor },
   { &kNS_GEOLOCATION_SERVICE_CID, false, nullptr, nsGeolocationServiceConstructor },
   { &kNS_GEOLOCATION_CID, false, nullptr, GeolocationConstructor },
   { &kNS_AUDIOCHANNEL_SERVICE_CID, false, nullptr, AudioChannelServiceConstructor },
-  { &kNS_WEBSOCKETFRAME_SERVICE_CID, false, nullptr, WebSocketFrameServiceConstructor },
+  { &kNS_WEBSOCKETEVENT_SERVICE_CID, false, nullptr, WebSocketEventServiceConstructor },
   { &kNS_DATASTORE_SERVICE_CID, false, nullptr, DataStoreServiceConstructor },
   { &kNS_FOCUSMANAGER_CID, false, nullptr, CreateFocusManager },
 #ifdef MOZ_WEBSPEECH_TEST_BACKEND
   { &kNS_FAKE_SPEECH_RECOGNITION_SERVICE_CID, false, nullptr, FakeSpeechRecognitionServiceConstructor },
 #endif
 #ifdef MOZ_WEBSPEECH_POCKETSPHINX
   { &kNS_POCKETSPHINX_SPEECH_RECOGNITION_SERVICE_CID, false, nullptr, PocketSphinxSpeechRecognitionServiceConstructor },
 #endif
@@ -1266,17 +1266,17 @@ static const mozilla::Module::ContractID
   { NS_AUDIOCHANNELAGENT_CONTRACTID, &kNS_AUDIOCHANNELAGENT_CID },
   { "@mozilla.org/editor/htmleditor;1", &kNS_HTMLEDITOR_CID },
   { "@mozilla.org/editor/editorcontroller;1", &kNS_EDITORCONTROLLER_CID },
   { "@mozilla.org/editor/editingcontroller;1", &kNS_EDITINGCONTROLLER_CID },
   { "@mozilla.org/textservices/textservicesdocument;1", &kNS_TEXTSERVICESDOCUMENT_CID },
   { "@mozilla.org/geolocation/service;1", &kNS_GEOLOCATION_SERVICE_CID },
   { "@mozilla.org/geolocation;1", &kNS_GEOLOCATION_CID },
   { "@mozilla.org/audiochannel/service;1", &kNS_AUDIOCHANNEL_SERVICE_CID },
-  { "@mozilla.org/websocketframe/service;1", &kNS_WEBSOCKETFRAME_SERVICE_CID },
+  { "@mozilla.org/websocketevent/service;1", &kNS_WEBSOCKETEVENT_SERVICE_CID },
   { "@mozilla.org/datastore-service;1", &kNS_DATASTORE_SERVICE_CID },
   { "@mozilla.org/focus-manager;1", &kNS_FOCUSMANAGER_CID },
 #ifdef MOZ_WEBSPEECH_TEST_BACKEND
   { NS_SPEECH_RECOGNITION_SERVICE_CONTRACTID_PREFIX "fake", &kNS_FAKE_SPEECH_RECOGNITION_SERVICE_CID },
 #endif
 #ifdef MOZ_WEBSPEECH_POCKETSPHINX
   { NS_SPEECH_RECOGNITION_SERVICE_CONTRACTID_PREFIX "pocketsphinx-en-US", &kNS_POCKETSPHINX_SPEECH_RECOGNITION_SERVICE_CID },
 #endif
--- a/netwerk/ipc/NeckoChild.cpp
+++ b/netwerk/ipc/NeckoChild.cpp
@@ -10,17 +10,17 @@
 #include "mozilla/net/NeckoChild.h"
 #include "mozilla/dom/ContentChild.h"
 #include "mozilla/dom/TabChild.h"
 #include "mozilla/net/HttpChannelChild.h"
 #include "mozilla/net/CookieServiceChild.h"
 #include "mozilla/net/WyciwygChannelChild.h"
 #include "mozilla/net/FTPChannelChild.h"
 #include "mozilla/net/WebSocketChannelChild.h"
-#include "mozilla/net/WebSocketFrameListenerChild.h"
+#include "mozilla/net/WebSocketEventListenerChild.h"
 #include "mozilla/net/DNSRequestChild.h"
 #include "mozilla/net/RemoteOpenFileChild.h"
 #include "mozilla/net/ChannelDiverterChild.h"
 #include "mozilla/dom/network/TCPSocketChild.h"
 #include "mozilla/dom/network/TCPServerSocketChild.h"
 #include "mozilla/dom/network/UDPSocketChild.h"
 #ifdef NECKO_PROTOCOL_rtsp
 #include "mozilla/net/RtspControllerChild.h"
@@ -154,29 +154,29 @@ NeckoChild::AllocPWebSocketChild(const P
 bool
 NeckoChild::DeallocPWebSocketChild(PWebSocketChild* child)
 {
   WebSocketChannelChild* p = static_cast<WebSocketChannelChild*>(child);
   p->ReleaseIPDLReference();
   return true;
 }
 
-PWebSocketFrameListenerChild*
-NeckoChild::AllocPWebSocketFrameListenerChild(const uint64_t& aInnerWindowID)
+PWebSocketEventListenerChild*
+NeckoChild::AllocPWebSocketEventListenerChild(const uint64_t& aInnerWindowID)
 {
-  RefPtr<WebSocketFrameListenerChild> c =
-    new WebSocketFrameListenerChild(aInnerWindowID);
+  RefPtr<WebSocketEventListenerChild> c =
+    new WebSocketEventListenerChild(aInnerWindowID);
   return c.forget().take();
 }
 
 bool
-NeckoChild::DeallocPWebSocketFrameListenerChild(PWebSocketFrameListenerChild* aActor)
+NeckoChild::DeallocPWebSocketEventListenerChild(PWebSocketEventListenerChild* aActor)
 {
-  RefPtr<WebSocketFrameListenerChild> c =
-    dont_AddRef(static_cast<WebSocketFrameListenerChild*>(aActor));
+  RefPtr<WebSocketEventListenerChild> c =
+    dont_AddRef(static_cast<WebSocketEventListenerChild*>(aActor));
   MOZ_ASSERT(c);
   return true;
 }
 
 PDataChannelChild*
 NeckoChild::AllocPDataChannelChild(const uint32_t& channelId)
 {
   MOZ_ASSERT_UNREACHABLE("Should never get here");
--- a/netwerk/ipc/NeckoChild.h
+++ b/netwerk/ipc/NeckoChild.h
@@ -74,19 +74,19 @@ protected:
   AllocPChannelDiverterChild(const ChannelDiverterArgs& channel) override;
   virtual bool
   DeallocPChannelDiverterChild(PChannelDiverterChild* actor) override;
   virtual bool RecvAsyncAuthPromptForNestedFrame(const TabId& aNestedFrameId,
                                                  const nsCString& aUri,
                                                  const nsString& aRealm,
                                                  const uint64_t& aCallbackId) override;
   virtual bool RecvAppOfflineStatus(const uint32_t& aId, const bool& aOffline) override;
-  virtual PWebSocketFrameListenerChild*
-    AllocPWebSocketFrameListenerChild(const uint64_t& aInnerWindowID) override;
-  virtual bool DeallocPWebSocketFrameListenerChild(PWebSocketFrameListenerChild*) override;
+  virtual PWebSocketEventListenerChild*
+    AllocPWebSocketEventListenerChild(const uint64_t& aInnerWindowID) override;
+  virtual bool DeallocPWebSocketEventListenerChild(PWebSocketEventListenerChild*) override;
 
   /* Predictor Messsages */
   virtual bool RecvPredOnPredictPreconnect(const URIParams& aURI) override;
   virtual bool RecvPredOnPredictDNS(const URIParams& aURI) override;
 };
 
 /**
  * Reference to the PNecko Child protocol.
--- a/netwerk/ipc/NeckoParent.cpp
+++ b/netwerk/ipc/NeckoParent.cpp
@@ -8,17 +8,17 @@
 #include "necko-config.h"
 #include "nsHttp.h"
 #include "mozilla/net/NeckoParent.h"
 #include "mozilla/net/HttpChannelParent.h"
 #include "mozilla/net/CookieServiceParent.h"
 #include "mozilla/net/WyciwygChannelParent.h"
 #include "mozilla/net/FTPChannelParent.h"
 #include "mozilla/net/WebSocketChannelParent.h"
-#include "mozilla/net/WebSocketFrameListenerParent.h"
+#include "mozilla/net/WebSocketEventListenerParent.h"
 #include "mozilla/net/DataChannelParent.h"
 #ifdef NECKO_PROTOCOL_rtsp
 #include "mozilla/net/RtspControllerParent.h"
 #include "mozilla/net/RtspChannelParent.h"
 #endif
 #include "mozilla/net/DNSRequestParent.h"
 #include "mozilla/net/RemoteOpenFileParent.h"
 #include "mozilla/net/ChannelDiverterParent.h"
@@ -343,29 +343,29 @@ NeckoParent::AllocPWebSocketParent(const
 bool
 NeckoParent::DeallocPWebSocketParent(PWebSocketParent* actor)
 {
   WebSocketChannelParent* p = static_cast<WebSocketChannelParent*>(actor);
   p->Release();
   return true;
 }
 
-PWebSocketFrameListenerParent*
-NeckoParent::AllocPWebSocketFrameListenerParent(const uint64_t& aInnerWindowID)
+PWebSocketEventListenerParent*
+NeckoParent::AllocPWebSocketEventListenerParent(const uint64_t& aInnerWindowID)
 {
-  RefPtr<WebSocketFrameListenerParent> c =
-    new WebSocketFrameListenerParent(aInnerWindowID);
+  RefPtr<WebSocketEventListenerParent> c =
+    new WebSocketEventListenerParent(aInnerWindowID);
   return c.forget().take();
 }
 
 bool
-NeckoParent::DeallocPWebSocketFrameListenerParent(PWebSocketFrameListenerParent* aActor)
+NeckoParent::DeallocPWebSocketEventListenerParent(PWebSocketEventListenerParent* aActor)
 {
-  RefPtr<WebSocketFrameListenerParent> c =
-    dont_AddRef(static_cast<WebSocketFrameListenerParent*>(aActor));
+  RefPtr<WebSocketEventListenerParent> c =
+    dont_AddRef(static_cast<WebSocketEventListenerParent*>(aActor));
   MOZ_ASSERT(c);
   return true;
 }
 
 PDataChannelParent*
 NeckoParent::AllocPDataChannelParent(const uint32_t &channelId)
 {
   RefPtr<DataChannelParent> p = new DataChannelParent();
--- a/netwerk/ipc/NeckoParent.h
+++ b/netwerk/ipc/NeckoParent.h
@@ -167,19 +167,19 @@ protected:
                                           const nsCString& aNetworkInterface) override;
   virtual bool DeallocPDNSRequestParent(PDNSRequestParent*) override;
   virtual bool RecvSpeculativeConnect(const URIParams& aURI, const bool& aAnonymous) override;
   virtual bool RecvHTMLDNSPrefetch(const nsString& hostname,
                                    const uint16_t& flags) override;
   virtual bool RecvCancelHTMLDNSPrefetch(const nsString& hostname,
                                          const uint16_t& flags,
                                          const nsresult& reason) override;
-  virtual PWebSocketFrameListenerParent*
-    AllocPWebSocketFrameListenerParent(const uint64_t& aInnerWindowID) override;
-  virtual bool DeallocPWebSocketFrameListenerParent(PWebSocketFrameListenerParent*) override;
+  virtual PWebSocketEventListenerParent*
+    AllocPWebSocketEventListenerParent(const uint64_t& aInnerWindowID) override;
+  virtual bool DeallocPWebSocketEventListenerParent(PWebSocketEventListenerParent*) override;
 
   virtual mozilla::ipc::IProtocol*
   CloneProtocol(Channel* aChannel,
                 mozilla::ipc::ProtocolCloneContext* aCtx) override;
 
   virtual PDataChannelParent*
     AllocPDataChannelParent(const uint32_t& channelId) override;
   virtual bool DeallocPDataChannelParent(PDataChannelParent* parent) override;
--- a/netwerk/ipc/PNecko.ipdl
+++ b/netwerk/ipc/PNecko.ipdl
@@ -7,17 +7,17 @@
 
 include protocol PContent;
 include protocol PHttpChannel;
 include protocol PCookieService;
 include protocol PBrowser;
 include protocol PWyciwygChannel;
 include protocol PFTPChannel;
 include protocol PWebSocket;
-include protocol PWebSocketFrameListener;
+include protocol PWebSocketEventListener;
 include protocol PTCPSocket;
 include protocol PTCPServerSocket;
 include protocol PUDPSocket;
 include protocol PRemoteOpenFile;
 include protocol PDNSRequest;
 include protocol PChannelDiverter;
 include protocol PBlob; //FIXME: bug #792908
 include protocol PFileDescriptorSet;
@@ -41,17 +41,17 @@ namespace net {
 prio(normal upto urgent) sync protocol PNecko
 {
   manager PContent;
   manages PHttpChannel;
   manages PCookieService;
   manages PWyciwygChannel;
   manages PFTPChannel;
   manages PWebSocket;
-  manages PWebSocketFrameListener;
+  manages PWebSocketEventListener;
   manages PTCPSocket;
   manages PTCPServerSocket;
   manages PUDPSocket;
   manages PDNSRequest;
   manages PRemoteOpenFile;
   manages PDataChannel;
   manages PRtspController;
   manages PRtspChannel;
@@ -69,17 +69,17 @@ parent:
               FTPChannelCreationArgs args);
 
   PWebSocket(PBrowserOrId browser, SerializedLoadContext loadContext);
   PTCPServerSocket(uint16_t localPort, uint16_t backlog, bool useArrayBuffers);
   PUDPSocket(Principal principal, nsCString filter);
 
   PDNSRequest(nsCString hostName, uint32_t flags, nsCString networkInterface);
 
-  PWebSocketFrameListener(uint64_t aInnerWindowID);
+  PWebSocketEventListener(uint64_t aInnerWindowID);
 
   /* Predictor Methods */
   PredPredict(OptionalURIParams targetURI, OptionalURIParams sourceURI,
               uint32_t reason, SerializedLoadContext loadContext,
               bool hasVerifier);
   PredLearn(URIParams targetURI, OptionalURIParams sourceURI,
             uint32_t reason, SerializedLoadContext loadContext);
   PredReset();
rename from netwerk/protocol/websocket/PWebSocketFrameListener.ipdl
rename to netwerk/protocol/websocket/PWebSocketEventListener.ipdl
--- a/netwerk/protocol/websocket/PWebSocketFrameListener.ipdl
+++ b/netwerk/protocol/websocket/PWebSocketEventListener.ipdl
@@ -7,17 +7,17 @@
 
 include protocol PNecko;
 
 using mozilla::net::WebSocketFrameData from "ipc/IPCMessageUtils.h";
 
 namespace mozilla {
 namespace net {
 
-async protocol PWebSocketFrameListener
+async protocol PWebSocketEventListener
 {
   manager PNecko;
 
 child:
   FrameReceived(uint32_t aWebSocketSerialID,
                 WebSocketFrameData aFrameData);
 
   FrameSent(uint32_t aWebSocketSerialID,
--- a/netwerk/protocol/websocket/WebSocketChannel.cpp
+++ b/netwerk/protocol/websocket/WebSocketChannel.cpp
@@ -7,17 +7,17 @@
 #include "WebSocketFrame.h"
 #include "WebSocketLog.h"
 #include "WebSocketChannel.h"
 
 #include "mozilla/Atomics.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/Endian.h"
 #include "mozilla/MathAlgorithms.h"
-#include "mozilla/net/WebSocketFrameService.h"
+#include "mozilla/net/WebSocketEventService.h"
 
 #include "nsIURI.h"
 #include "nsIChannel.h"
 #include "nsICryptoHash.h"
 #include "nsIRunnable.h"
 #include "nsIPrefBranch.h"
 #include "nsIPrefService.h"
 #include "nsICancelable.h"
@@ -1191,17 +1191,17 @@ WebSocketChannel::WebSocketChannel() :
 
   nsresult rv;
   mConnectionLogService = do_GetService("@mozilla.org/network/dashboard;1",&rv);
   if (NS_FAILED(rv))
     LOG(("Failed to initiate dashboard service."));
 
   mSerial = sSerialSeed++;
 
-  mFrameService = WebSocketFrameService::GetOrCreate();
+  mService = WebSocketEventService::GetOrCreate();
 }
 
 WebSocketChannel::~WebSocketChannel()
 {
   LOG(("WebSocketChannel::~WebSocketChannel() %p\n", this));
 
   if (mWasOpened) {
     MOZ_ASSERT(mCalledOnStop, "WebSocket was opened but OnStop was not called");
@@ -1223,17 +1223,17 @@ WebSocketChannel::~WebSocketChannel()
 
   NS_ReleaseOnMainThread(mURI);
   NS_ReleaseOnMainThread(mOriginalURI);
 
   mListenerMT = nullptr;
 
   NS_ReleaseOnMainThread(mLoadGroup);
   NS_ReleaseOnMainThread(mLoadInfo);
-  NS_ReleaseOnMainThread(static_cast<nsIWebSocketFrameService*>(mFrameService.forget().take()));
+  NS_ReleaseOnMainThread(static_cast<nsIWebSocketEventService*>(mService.forget().take()));
 }
 
 NS_IMETHODIMP
 WebSocketChannel::Observe(nsISupports *subject,
                           const char *topic,
                           const char16_t *data)
 {
   LOG(("WebSocketChannel::Observe [topic=\"%s\"]\n", topic));
@@ -1694,21 +1694,21 @@ WebSocketChannel::ProcessInput(uint8_t *
 
         // Section 8.1 says to fail connection if invalid utf-8 in text message
         if (!IsUTF8(utf8Data, false)) {
           LOG(("WebSocketChannel:: text frame invalid utf-8\n"));
           return NS_ERROR_CANNOT_CONVERT_DATA;
         }
 
         RefPtr<WebSocketFrame> frame =
-          mFrameService->CreateFrameIfNeeded(finBit, rsvBit1, rsvBit2, rsvBit3,
-                                             opcode, maskBit, mask, utf8Data);
+          mService->CreateFrameIfNeeded(finBit, rsvBit1, rsvBit2, rsvBit3,
+                                        opcode, maskBit, mask, utf8Data);
 
         if (frame) {
-          mFrameService->FrameReceived(mSerial, mInnerWindowID, frame);
+          mService->FrameReceived(mSerial, mInnerWindowID, frame);
         }
 
         mTargetThread->Dispatch(new CallOnMessageAvailable(this, utf8Data, -1),
                                 NS_DISPATCH_NORMAL);
         if (mConnectionLogService && !mPrivateBrowsing) {
           mConnectionLogService->NewMsgReceived(mHost, mSerial, count);
           LOG(("Added new msg received for %s", mHost.get()));
         }
@@ -1717,19 +1717,19 @@ WebSocketChannel::ProcessInput(uint8_t *
       // control frames
       if (payloadLength > 125) {
         LOG(("WebSocketChannel:: bad control frame code %d length %d\n",
              opcode, payloadLength));
         return NS_ERROR_ILLEGAL_VALUE;
       }
 
       RefPtr<WebSocketFrame> frame =
-        mFrameService->CreateFrameIfNeeded(finBit, rsvBit1, rsvBit2, rsvBit3,
-                                           opcode, maskBit, mask, payload,
-                                           payloadLength);
+        mService->CreateFrameIfNeeded(finBit, rsvBit1, rsvBit2, rsvBit3,
+                                      opcode, maskBit, mask, payload,
+                                      payloadLength);
 
       if (opcode == nsIWebSocketFrame::OPCODE_CLOSE) {
         LOG(("WebSocketChannel:: close received\n"));
         mServerClosed = 1;
 
         mServerCloseCode = CLOSE_NO_STATUS;
         if (payloadLength >= 2) {
           mServerCloseCode = NetworkEndian::readUint16(payload);
@@ -1757,17 +1757,17 @@ WebSocketChannel::ProcessInput(uint8_t *
         if (mCloseTimer) {
           mCloseTimer->Cancel();
           mCloseTimer = nullptr;
         }
 
         if (frame) {
           // We send the frame immediately becuase we want to have it dispatched
           // before the CallOnServerClose.
-          mFrameService->FrameReceived(mSerial, mInnerWindowID, frame);
+          mService->FrameReceived(mSerial, mInnerWindowID, frame);
           frame = nullptr;
         }
 
         if (mListenerMT) {
           mTargetThread->Dispatch(new CallOnServerClose(this, mServerCloseCode,
                                                         mServerCloseReason),
                                   NS_DISPATCH_NORMAL);
         }
@@ -1797,17 +1797,17 @@ WebSocketChannel::ProcessInput(uint8_t *
         payload = mFramePtr;
         avail -= payloadLength;
         if (mBuffered)
           mBuffered -= framingLength + payloadLength;
         payloadLength = 0;
       }
 
       if (frame) {
-        mFrameService->FrameReceived(mSerial, mInnerWindowID, frame);
+        mService->FrameReceived(mSerial, mInnerWindowID, frame);
       }
     } else if (opcode == nsIWebSocketFrame::OPCODE_BINARY) {
       bool isDeflated = mPMCECompressor && mPMCECompressor->IsMessageDeflated();
       LOG(("WebSocketChannel:: %sbinary frame received\n",
            isDeflated ? "deflated " : ""));
 
       if (mListenerMT) {
         nsCString binaryData;
@@ -1823,20 +1823,20 @@ WebSocketChannel::ProcessInput(uint8_t *
         } else {
           if (!binaryData.Assign((const char *)payload, payloadLength,
                                  mozilla::fallible)) {
             return NS_ERROR_OUT_OF_MEMORY;
           }
         }
 
         RefPtr<WebSocketFrame> frame =
-          mFrameService->CreateFrameIfNeeded(finBit, rsvBit1, rsvBit2, rsvBit3,
-                                             opcode, maskBit, mask, binaryData);
+          mService->CreateFrameIfNeeded(finBit, rsvBit1, rsvBit2, rsvBit3,
+                                        opcode, maskBit, mask, binaryData);
         if (frame) {
-          mFrameService->FrameReceived(mSerial, mInnerWindowID, frame);
+          mService->FrameReceived(mSerial, mInnerWindowID, frame);
         }
 
         mTargetThread->Dispatch(
           new CallOnMessageAvailable(this, binaryData, binaryData.Length()),
           NS_DISPATCH_NORMAL);
         // To add the header to 'Networking Dashboard' log
         if (mConnectionLogService && !mPrivateBrowsing) {
           mConnectionLogService->NewMsgReceived(mHost, mSerial, count);
@@ -2172,30 +2172,30 @@ WebSocketChannel::PrimeNewOutgoingMessag
 
   // We don't mask the framing, but occasionally we stick a little payload
   // data in the buffer used for the framing. Close frames are the current
   // example. This data needs to be masked, but it is never more than a
   // handful of bytes and might rotate the mask, so we can just do it locally.
   // For real data frames we ship the bulk of the payload off to ApplyMask()
 
    RefPtr<WebSocketFrame> frame =
-     mFrameService->CreateFrameIfNeeded(
+     mService->CreateFrameIfNeeded(
                            mOutHeader[0] & WebSocketChannel::kFinalFragBit,
                            mOutHeader[0] & WebSocketChannel::kRsv1Bit,
                            mOutHeader[0] & WebSocketChannel::kRsv2Bit,
                            mOutHeader[0] & WebSocketChannel::kRsv3Bit,
                            mOutHeader[0] & WebSocketChannel::kOpcodeBitsMask,
                            mOutHeader[1] & WebSocketChannel::kMaskBit,
                            mask,
                            payload, mHdrOutToSend - (payload - mOutHeader),
                            mCurrentOut->BeginOrigReading(),
                            mCurrentOut->OrigLength());
 
   if (frame) {
-    mFrameService->FrameSent(mSerial, mInnerWindowID, frame);
+    mService->FrameSent(mSerial, mInnerWindowID, frame);
   }
 
   while (payload < (mOutHeader + mHdrOutToSend)) {
     *payload ^= mask >> 24;
     mask = RotateLeft(mask, 8);
     payload++;
   }
 
--- a/netwerk/protocol/websocket/WebSocketChannel.h
+++ b/netwerk/protocol/websocket/WebSocketChannel.h
@@ -45,17 +45,17 @@ namespace net {
 class OutboundMessage;
 class OutboundEnqueuer;
 class nsWSAdmissionManager;
 class PMCECompression;
 class CallOnMessageAvailable;
 class CallOnStop;
 class CallOnServerClose;
 class CallAcknowledge;
-class WebSocketFrameService;
+class WebSocketEventService;
 
 // Used to enforce "1 connecting websocket per host" rule, and reconnect delays
 enum wsConnectingState {
   NOT_CONNECTING = 0,     // Not yet (or no longer) trying to open connection
   CONNECTING_QUEUED,      // Waiting for other ws to same host to finish opening
   CONNECTING_DELAYED,     // Delayed by "reconnect after failure" algorithm
   CONNECTING_IN_PROGRESS  // Started connection: waiting for result
 };
@@ -222,17 +222,17 @@ private:
   nsCOMPtr<nsITimer>              mReconnectDelayTimer;
 
   nsCOMPtr<nsITimer>              mPingTimer;
 
   nsCOMPtr<nsITimer>              mLingeringCloseTimer;
   const static int32_t            kLingeringCloseTimeout =   1000;
   const static int32_t            kLingeringCloseThreshold = 50;
 
-  RefPtr<WebSocketFrameService>   mFrameService;
+  RefPtr<WebSocketEventService>   mService;
 
   int32_t                         mMaxConcurrentConnections;
 
   uint64_t                        mInnerWindowID;
 
   // following members are accessed only on the main thread
   uint32_t                        mGotUpgradeOK              : 1;
   uint32_t                        mRecvdHttpUpgradeTransport : 1;
rename from netwerk/protocol/websocket/WebSocketFrameListenerChild.cpp
rename to netwerk/protocol/websocket/WebSocketEventListenerChild.cpp
--- a/netwerk/protocol/websocket/WebSocketFrameListenerChild.cpp
+++ b/netwerk/protocol/websocket/WebSocketEventListenerChild.cpp
@@ -1,63 +1,63 @@
 /* -*- 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/. */
 
-#include "WebSocketFrameListenerChild.h"
+#include "WebSocketEventListenerChild.h"
 
+#include "WebSocketEventService.h"
 #include "WebSocketFrame.h"
-#include "WebSocketFrameService.h"
 
 namespace mozilla {
 namespace net {
 
-WebSocketFrameListenerChild::WebSocketFrameListenerChild(uint64_t aInnerWindowID)
-  : mService(WebSocketFrameService::GetOrCreate())
+WebSocketEventListenerChild::WebSocketEventListenerChild(uint64_t aInnerWindowID)
+  : mService(WebSocketEventService::GetOrCreate())
   , mInnerWindowID(aInnerWindowID)
 {}
 
-WebSocketFrameListenerChild::~WebSocketFrameListenerChild()
+WebSocketEventListenerChild::~WebSocketEventListenerChild()
 {
   MOZ_ASSERT(!mService);
 }
 
 bool
-WebSocketFrameListenerChild::RecvFrameReceived(const uint32_t& aWebSocketSerialID,
+WebSocketEventListenerChild::RecvFrameReceived(const uint32_t& aWebSocketSerialID,
                                                const WebSocketFrameData& aFrameData)
 {
   if (mService) {
     RefPtr<WebSocketFrame> frame = new WebSocketFrame(aFrameData);
     mService->FrameReceived(aWebSocketSerialID, mInnerWindowID, frame);
   }
 
   return true;
 }
 
 bool
-WebSocketFrameListenerChild::RecvFrameSent(const uint32_t& aWebSocketSerialID,
+WebSocketEventListenerChild::RecvFrameSent(const uint32_t& aWebSocketSerialID,
                                            const WebSocketFrameData& aFrameData)
 {
   if (mService) {
     RefPtr<WebSocketFrame> frame = new WebSocketFrame(aFrameData);
     mService->FrameSent(aWebSocketSerialID, mInnerWindowID, frame);
   }
 
   return true;
 }
 
 void
-WebSocketFrameListenerChild::Close()
+WebSocketEventListenerChild::Close()
 {
   mService = nullptr;
   SendClose();
 }
 
 void
-WebSocketFrameListenerChild::ActorDestroy(ActorDestroyReason aWhy)
+WebSocketEventListenerChild::ActorDestroy(ActorDestroyReason aWhy)
 {
   mService = nullptr;
 }
 
 } // namespace net
 } // namespace mozilla
rename from netwerk/protocol/websocket/WebSocketFrameListenerChild.h
rename to netwerk/protocol/websocket/WebSocketEventListenerChild.h
--- a/netwerk/protocol/websocket/WebSocketFrameListenerChild.h
+++ b/netwerk/protocol/websocket/WebSocketEventListenerChild.h
@@ -1,44 +1,44 @@
 /* -*- 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_WebSocketFrameListenerChild_h
-#define mozilla_net_WebSocketFrameListenerChild_h
+#ifndef mozilla_net_WebSocketEventListenerChild_h
+#define mozilla_net_WebSocketEventListenerChild_h
 
-#include "mozilla/net/PWebSocketFrameListenerChild.h"
+#include "mozilla/net/PWebSocketEventListenerChild.h"
 
 namespace mozilla {
 namespace net {
 
-class WebSocketFrameService;
+class WebSocketEventService;
 
-class WebSocketFrameListenerChild final : public PWebSocketFrameListenerChild
+class WebSocketEventListenerChild final : public PWebSocketEventListenerChild
 {
 public:
-  NS_INLINE_DECL_REFCOUNTING(WebSocketFrameListenerChild)
+  NS_INLINE_DECL_REFCOUNTING(WebSocketEventListenerChild)
 
-  explicit WebSocketFrameListenerChild(uint64_t aInnerWindowID);
+  explicit WebSocketEventListenerChild(uint64_t aInnerWindowID);
 
   bool RecvFrameReceived(const uint32_t& aWebSocketSerialID,
                          const WebSocketFrameData& aFrameData) override;
 
   bool RecvFrameSent(const uint32_t& aWebSocketSerialID,
                      const WebSocketFrameData& aFrameData) override;
 
   void Close();
 
 private:
-  ~WebSocketFrameListenerChild();
+  ~WebSocketEventListenerChild();
 
   virtual void ActorDestroy(ActorDestroyReason aWhy) override;
 
-  RefPtr<WebSocketFrameService> mService;
+  RefPtr<WebSocketEventService> mService;
   uint64_t mInnerWindowID;
 };
 
 } // namespace net
 } // namespace mozilla
 
-#endif // mozilla_net_WebSocketFrameListenerChild_h
+#endif // mozilla_net_WebSocketEventListenerChild_h
rename from netwerk/protocol/websocket/WebSocketFrameListenerParent.cpp
rename to netwerk/protocol/websocket/WebSocketEventListenerParent.cpp
--- a/netwerk/protocol/websocket/WebSocketFrameListenerParent.cpp
+++ b/netwerk/protocol/websocket/WebSocketEventListenerParent.cpp
@@ -1,81 +1,81 @@
 /* -*- 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/. */
 
-#include "WebSocketFrameListenerParent.h"
+#include "WebSocketEventListenerParent.h"
 #include "mozilla/unused.h"
 
 namespace mozilla {
 namespace net {
 
-NS_INTERFACE_MAP_BEGIN(WebSocketFrameListenerParent)
-  NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIWebSocketFrameListener)
-  NS_INTERFACE_MAP_ENTRY(nsIWebSocketFrameListener)
+NS_INTERFACE_MAP_BEGIN(WebSocketEventListenerParent)
+  NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIWebSocketEventListener)
+  NS_INTERFACE_MAP_ENTRY(nsIWebSocketEventListener)
 NS_INTERFACE_MAP_END
 
-NS_IMPL_ADDREF(WebSocketFrameListenerParent)
-NS_IMPL_RELEASE(WebSocketFrameListenerParent)
+NS_IMPL_ADDREF(WebSocketEventListenerParent)
+NS_IMPL_RELEASE(WebSocketEventListenerParent)
 
-WebSocketFrameListenerParent::WebSocketFrameListenerParent(uint64_t aInnerWindowID)
-  : mService(WebSocketFrameService::GetOrCreate())
+WebSocketEventListenerParent::WebSocketEventListenerParent(uint64_t aInnerWindowID)
+  : mService(WebSocketEventService::GetOrCreate())
   , mInnerWindowID(aInnerWindowID)
 {
   mService->AddListener(mInnerWindowID, this);
 }
 
-WebSocketFrameListenerParent::~WebSocketFrameListenerParent()
+WebSocketEventListenerParent::~WebSocketEventListenerParent()
 {
   MOZ_ASSERT(!mService);
 }
 
 bool
-WebSocketFrameListenerParent::RecvClose()
+WebSocketEventListenerParent::RecvClose()
 {
   if (mService) {
     UnregisterListener();
     unused << Send__delete__(this);
   }
 
   return true;
 }
 
 void
-WebSocketFrameListenerParent::ActorDestroy(ActorDestroyReason aWhy)
+WebSocketEventListenerParent::ActorDestroy(ActorDestroyReason aWhy)
 {
   UnregisterListener();
 }
 
 void
-WebSocketFrameListenerParent::UnregisterListener()
+WebSocketEventListenerParent::UnregisterListener()
 {
   if (mService) {
     mService->RemoveListener(mInnerWindowID, this);
     mService = nullptr;
   }
 }
 
 NS_IMETHODIMP
-WebSocketFrameListenerParent::FrameReceived(uint32_t aWebSocketSerialID,
+WebSocketEventListenerParent::FrameReceived(uint32_t aWebSocketSerialID,
                                             nsIWebSocketFrame* aFrame)
 {
   if (!aFrame) {
     return NS_ERROR_FAILURE;
   }
 
   WebSocketFrame* frame = static_cast<WebSocketFrame*>(aFrame);
   unused << SendFrameReceived(aWebSocketSerialID, frame->Data());
   return NS_OK;
 }
 
 NS_IMETHODIMP
-WebSocketFrameListenerParent::FrameSent(uint32_t aWebSocketSerialID,
+WebSocketEventListenerParent::FrameSent(uint32_t aWebSocketSerialID,
                                         nsIWebSocketFrame* aFrame)
 {
   if (!aFrame) {
     return NS_ERROR_FAILURE;
   }
 
   WebSocketFrame* frame = static_cast<WebSocketFrame*>(aFrame);
   unused << SendFrameSent(aWebSocketSerialID, frame->Data());
rename from netwerk/protocol/websocket/WebSocketFrameListenerParent.h
rename to netwerk/protocol/websocket/WebSocketEventListenerParent.h
--- a/netwerk/protocol/websocket/WebSocketFrameListenerParent.h
+++ b/netwerk/protocol/websocket/WebSocketEventListenerParent.h
@@ -1,43 +1,43 @@
 /* -*- 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
+#ifndef mozilla_net_WebSocketEventListenerParent_h
+#define mozilla_net_WebSocketEventListenerParent_h
 
-#include "mozilla/net/PWebSocketFrameListenerParent.h"
-#include "nsIWebSocketFrameService.h"
+#include "mozilla/net/PWebSocketEventListenerParent.h"
+#include "nsIWebSocketEventService.h"
 
 namespace mozilla {
 namespace net {
 
-class WebSocketFrameService;
+class WebSocketEventService;
 
-class WebSocketFrameListenerParent final : public PWebSocketFrameListenerParent
-                                         , public nsIWebSocketFrameListener
+class WebSocketEventListenerParent final : public PWebSocketEventListenerParent
+                                         , public nsIWebSocketEventListener
 {
 public:
   NS_DECL_ISUPPORTS
-  NS_DECL_NSIWEBSOCKETFRAMELISTENER
+  NS_DECL_NSIWEBSOCKETEVENTLISTENER
 
-  explicit WebSocketFrameListenerParent(uint64_t aInnerWindowID);
+  explicit WebSocketEventListenerParent(uint64_t aInnerWindowID);
 
 private:
-  ~WebSocketFrameListenerParent();
+  ~WebSocketEventListenerParent();
 
   virtual bool RecvClose() override;
 
   virtual void ActorDestroy(ActorDestroyReason aWhy) override;
 
   void UnregisterListener();
 
-  RefPtr<WebSocketFrameService> mService;
+  RefPtr<WebSocketEventService> mService;
   uint64_t mInnerWindowID;
 };
 
 } // namespace net
 } // namespace mozilla
 
-#endif // mozilla_net_WebSocketFrameListenerParent_h
+#endif // mozilla_net_WebSocketEventListenerParent_h
rename from netwerk/protocol/websocket/WebSocketFrameService.cpp
rename to netwerk/protocol/websocket/WebSocketEventService.cpp
--- a/netwerk/protocol/websocket/WebSocketFrameService.cpp
+++ b/netwerk/protocol/websocket/WebSocketEventService.cpp
@@ -1,31 +1,31 @@
 /* -*- 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/. */
 
+#include "WebSocketEventListenerChild.h"
+#include "WebSocketEventService.h"
 #include "WebSocketFrame.h"
-#include "WebSocketFrameListenerChild.h"
-#include "WebSocketFrameService.h"
 
 #include "mozilla/net/NeckoChild.h"
 #include "mozilla/StaticPtr.h"
 #include "nsISupportsPrimitives.h"
 #include "nsXULAppAPI.h"
 
 extern PRThread *gSocketThread;
 
 namespace mozilla {
 namespace net {
 
 namespace {
 
-StaticRefPtr<WebSocketFrameService> gWebSocketFrameService;
+StaticRefPtr<WebSocketEventService> gWebSocketEventService;
 
 bool
 IsChildProcess()
 {
   return XRE_GetProcessType() != GeckoProcessType_Default;
 }
 
 } // anonymous namespace
@@ -42,30 +42,29 @@ public:
     , mFrame(aFrame)
     , mFrameSent(aFrameSent)
   {}
 
   NS_IMETHOD Run() override
   {
     MOZ_ASSERT(NS_IsMainThread());
 
-    RefPtr<WebSocketFrameService> service =
-      WebSocketFrameService::GetOrCreate();
+    RefPtr<WebSocketEventService> service = WebSocketEventService::GetOrCreate();
     MOZ_ASSERT(service);
 
-    WebSocketFrameService::WindowListeners* listeners =
+    WebSocketEventService::WindowListeners* listeners =
       service->GetListeners(mInnerWindowID);
     if (!listeners) {
       return NS_OK;
     }
 
     nsresult rv;
-    WebSocketFrameService::WindowListeners::ForwardIterator iter(*listeners);
+    WebSocketEventService::WindowListeners::ForwardIterator iter(*listeners);
     while (iter.HasMore()) {
-      nsCOMPtr<nsIWebSocketFrameListener> listener = iter.GetNext();
+      nsCOMPtr<nsIWebSocketEventListener> listener = iter.GetNext();
 
       if (mFrameSent) {
         rv = listener->FrameSent(mWebSocketSerialID, mFrame);
       } else {
         rv = listener->FrameReceived(mWebSocketSerialID, mFrame);
       }
 
       NS_WARN_IF(NS_FAILED(rv));
@@ -81,57 +80,57 @@ protected:
   uint32_t mWebSocketSerialID;
   uint64_t mInnerWindowID;
 
   RefPtr<WebSocketFrame> mFrame;
 
   bool mFrameSent;
 };
 
-/* static */ already_AddRefed<WebSocketFrameService>
-WebSocketFrameService::GetOrCreate()
+/* static */ already_AddRefed<WebSocketEventService>
+WebSocketEventService::GetOrCreate()
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  if (!gWebSocketFrameService) {
-    gWebSocketFrameService = new WebSocketFrameService();
+  if (!gWebSocketEventService) {
+    gWebSocketEventService = new WebSocketEventService();
   }
 
-  RefPtr<WebSocketFrameService> service = gWebSocketFrameService.get();
+  RefPtr<WebSocketEventService> service = gWebSocketEventService.get();
   return service.forget();
 }
 
-NS_INTERFACE_MAP_BEGIN(WebSocketFrameService)
-  NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIWebSocketFrameService)
+NS_INTERFACE_MAP_BEGIN(WebSocketEventService)
+  NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIWebSocketEventService)
   NS_INTERFACE_MAP_ENTRY(nsIObserver)
-  NS_INTERFACE_MAP_ENTRY(nsIWebSocketFrameService)
+  NS_INTERFACE_MAP_ENTRY(nsIWebSocketEventService)
 NS_INTERFACE_MAP_END
 
-NS_IMPL_ADDREF(WebSocketFrameService)
-NS_IMPL_RELEASE(WebSocketFrameService)
+NS_IMPL_ADDREF(WebSocketEventService)
+NS_IMPL_RELEASE(WebSocketEventService)
 
-WebSocketFrameService::WebSocketFrameService()
+WebSocketEventService::WebSocketEventService()
   : mCountListeners(0)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
   if (obs) {
     obs->AddObserver(this, "xpcom-shutdown", false);
     obs->AddObserver(this, "inner-window-destroyed", false);
   }
 }
 
-WebSocketFrameService::~WebSocketFrameService()
+WebSocketEventService::~WebSocketEventService()
 {
   MOZ_ASSERT(NS_IsMainThread());
 }
 
 void
-WebSocketFrameService::FrameReceived(uint32_t aWebSocketSerialID,
+WebSocketEventService::FrameReceived(uint32_t aWebSocketSerialID,
                                      uint64_t aInnerWindowID,
                                      WebSocketFrame* aFrame)
 {
   MOZ_ASSERT(aFrame);
 
   // Let's continue only if we have some listeners.
   if (!HasListeners()) {
     return;
@@ -140,17 +139,17 @@ WebSocketFrameService::FrameReceived(uin
   RefPtr<WebSocketFrameRunnable> runnable =
     new WebSocketFrameRunnable(aWebSocketSerialID, aInnerWindowID,
                                aFrame, false /* frameSent */);
   nsresult rv = NS_DispatchToMainThread(runnable);
   NS_WARN_IF(NS_FAILED(rv));
 }
 
 void
-WebSocketFrameService::FrameSent(uint32_t aWebSocketSerialID,
+WebSocketEventService::FrameSent(uint32_t aWebSocketSerialID,
                                  uint64_t aInnerWindowID,
                                  WebSocketFrame* aFrame)
 {
   MOZ_ASSERT(aFrame);
 
   // Let's continue only if we have some listeners.
   if (!HasListeners()) {
     return;
@@ -160,50 +159,50 @@ WebSocketFrameService::FrameSent(uint32_
     new WebSocketFrameRunnable(aWebSocketSerialID, aInnerWindowID,
                                aFrame, true /* frameSent */);
 
   nsresult rv = NS_DispatchToMainThread(runnable);
   NS_WARN_IF(NS_FAILED(rv));
 }
 
 NS_IMETHODIMP
-WebSocketFrameService::AddListener(uint64_t aInnerWindowID,
-                                   nsIWebSocketFrameListener* aListener)
+WebSocketEventService::AddListener(uint64_t aInnerWindowID,
+                                   nsIWebSocketEventListener* aListener)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (!aListener) {
     return NS_ERROR_FAILURE;
   }
 
   ++mCountListeners;
 
   WindowListener* listener = mWindows.Get(aInnerWindowID);
   if (!listener) {
     listener = new WindowListener();
 
     if (IsChildProcess()) {
-      PWebSocketFrameListenerChild* actor =
-        gNeckoChild->SendPWebSocketFrameListenerConstructor(aInnerWindowID);
+      PWebSocketEventListenerChild* actor =
+        gNeckoChild->SendPWebSocketEventListenerConstructor(aInnerWindowID);
 
-      listener->mActor = static_cast<WebSocketFrameListenerChild*>(actor);
+      listener->mActor = static_cast<WebSocketEventListenerChild*>(actor);
       MOZ_ASSERT(listener->mActor);
     }
 
     mWindows.Put(aInnerWindowID, listener);
   }
 
   listener->mListeners.AppendElement(aListener);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-WebSocketFrameService::RemoveListener(uint64_t aInnerWindowID,
-                                      nsIWebSocketFrameListener* aListener)
+WebSocketEventService::RemoveListener(uint64_t aInnerWindowID,
+                                      nsIWebSocketEventListener* aListener)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (!aListener) {
     return NS_ERROR_FAILURE;
   }
 
   WindowListener* listener = mWindows.Get(aInnerWindowID);
@@ -226,17 +225,17 @@ WebSocketFrameService::RemoveListener(ui
 
   MOZ_ASSERT(mCountListeners);
   --mCountListeners;
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-WebSocketFrameService::Observe(nsISupports* aSubject, const char* aTopic,
+WebSocketEventService::Observe(nsISupports* aSubject, const char* aTopic,
                                const char16_t* aData)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (!strcmp(aTopic, "xpcom-shutdown")) {
     Shutdown();
     return NS_OK;
   }
@@ -264,71 +263,71 @@ WebSocketFrameService::Observe(nsISuppor
     mWindows.Remove(innerID);
   }
 
   // This should not happen.
   return NS_ERROR_FAILURE;
 }
 
 void
-WebSocketFrameService::Shutdown()
+WebSocketEventService::Shutdown()
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  if (gWebSocketFrameService) {
+  if (gWebSocketEventService) {
     nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
     if (obs) {
-      obs->RemoveObserver(gWebSocketFrameService, "xpcom-shutdown");
-      obs->RemoveObserver(gWebSocketFrameService, "inner-window-destroyed");
+      obs->RemoveObserver(gWebSocketEventService, "xpcom-shutdown");
+      obs->RemoveObserver(gWebSocketEventService, "inner-window-destroyed");
     }
 
     mWindows.Clear();
-    gWebSocketFrameService = nullptr;
+    gWebSocketEventService = nullptr;
   }
 }
 
 bool
-WebSocketFrameService::HasListeners() const
+WebSocketEventService::HasListeners() const
 {
   return !!mCountListeners;
 }
 
-WebSocketFrameService::WindowListeners*
-WebSocketFrameService::GetListeners(uint64_t aInnerWindowID) const
+WebSocketEventService::WindowListeners*
+WebSocketEventService::GetListeners(uint64_t aInnerWindowID) const
 {
   WindowListener* listener = mWindows.Get(aInnerWindowID);
   return listener ? &listener->mListeners : nullptr;
 }
 
 void
-WebSocketFrameService::ShutdownActorListener(WindowListener* aListener)
+WebSocketEventService::ShutdownActorListener(WindowListener* aListener)
 {
   MOZ_ASSERT(aListener);
   MOZ_ASSERT(aListener->mActor);
   aListener->mActor->Close();
   aListener->mActor = nullptr;
 }
 
 WebSocketFrame*
-WebSocketFrameService::CreateFrameIfNeeded(bool aFinBit, bool aRsvBit1,
+WebSocketEventService::CreateFrameIfNeeded(bool aFinBit, bool aRsvBit1,
                                            bool aRsvBit2, bool aRsvBit3,
                                            uint8_t aOpCode, bool aMaskBit,
                                            uint32_t aMask,
                                            const nsCString& aPayload)
 {
   if (!HasListeners()) {
     return nullptr;
   }
 
   return new WebSocketFrame(aFinBit, aRsvBit1, aRsvBit2, aRsvBit3, aOpCode,
                             aMaskBit, aMask, aPayload);
 }
 
 WebSocketFrame*
-WebSocketFrameService::CreateFrameIfNeeded(bool aFinBit, bool aRsvBit1,
+WebSocketEventService::CreateFrameIfNeeded(bool aFinBit, bool aRsvBit1,
                                            bool aRsvBit2, bool aRsvBit3,
                                            uint8_t aOpCode, bool aMaskBit,
                                            uint32_t aMask, uint8_t* aPayload,
                                            uint32_t aPayloadLength)
 {
   if (!HasListeners()) {
     return nullptr;
   }
@@ -339,17 +338,17 @@ WebSocketFrameService::CreateFrameIfNeed
     return nullptr;
   }
 
   return new WebSocketFrame(aFinBit, aRsvBit1, aRsvBit2, aRsvBit3, aOpCode,
                             aMaskBit, aMask, payloadStr);
 }
 
 WebSocketFrame*
-WebSocketFrameService::CreateFrameIfNeeded(bool aFinBit, bool aRsvBit1,
+WebSocketEventService::CreateFrameIfNeeded(bool aFinBit, bool aRsvBit1,
                                            bool aRsvBit2, bool aRsvBit3,
                                            uint8_t aOpCode, bool aMaskBit,
                                            uint32_t aMask,
                                            uint8_t* aPayloadInHdr,
                                            uint32_t aPayloadInHdrLength,
                                            uint8_t* aPayload,
                                            uint32_t aPayloadLength)
 {
rename from netwerk/protocol/websocket/WebSocketFrameService.h
rename to netwerk/protocol/websocket/WebSocketEventService.h
--- a/netwerk/protocol/websocket/WebSocketFrameService.h
+++ b/netwerk/protocol/websocket/WebSocketEventService.h
@@ -1,44 +1,44 @@
 /* -*- 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_WebSocketFrameService_h
-#define mozilla_net_WebSocketFrameService_h
+#ifndef mozilla_net_WebSocketEventService_h
+#define mozilla_net_WebSocketEventService_h
 
 #include "mozilla/Atomics.h"
-#include "nsIWebSocketFrameService.h"
+#include "nsIWebSocketEventService.h"
 #include "nsAutoPtr.h"
 #include "nsCOMPtr.h"
 #include "nsClassHashtable.h"
 #include "nsHashKeys.h"
 #include "nsIObserver.h"
 #include "nsISupportsImpl.h"
 #include "nsTObserverArray.h"
 
 namespace mozilla {
 namespace net {
 
 class WebSocketFrame;
-class WebSocketFrameListenerChild;
+class WebSocketEventListenerChild;
 
-class WebSocketFrameService final : public nsIWebSocketFrameService
+class WebSocketEventService final : public nsIWebSocketEventService
                                   , public nsIObserver
 {
   friend class WebSocketFrameRunnable;
 
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIOBSERVER
-  NS_DECL_NSIWEBSOCKETFRAMESERVICE
+  NS_DECL_NSIWEBSOCKETEVENTSERVICE
 
-  static already_AddRefed<WebSocketFrameService> GetOrCreate();
+  static already_AddRefed<WebSocketEventService> GetOrCreate();
 
   void FrameReceived(uint32_t aWebSocketSerialID,
                      uint64_t aInnerWindowID,
                      WebSocketFrame* aFrame);
 
   void  FrameSent(uint32_t aWebSocketSerialID,
                   uint64_t aInnerWindowID,
                   WebSocketFrame* aFrame);
@@ -55,35 +55,35 @@ public:
 
   WebSocketFrame*
   CreateFrameIfNeeded(bool aFinBit, bool aRsvBit1, bool aRsvBit2, bool aRsvBit3,
                       uint8_t aOpCode, bool aMaskBit, uint32_t aMask,
                       uint8_t* aPayloadInHdr, uint32_t aPayloadInHdrLength,
                       uint8_t* aPayload, uint32_t aPayloadLength);
 
 private:
-  WebSocketFrameService();
-  ~WebSocketFrameService();
+  WebSocketEventService();
+  ~WebSocketEventService();
 
   bool HasListeners() const;
   void Shutdown();
 
-  typedef nsTObserverArray<nsCOMPtr<nsIWebSocketFrameListener>> WindowListeners;
+  typedef nsTObserverArray<nsCOMPtr<nsIWebSocketEventListener>> WindowListeners;
 
   struct WindowListener
   {
     WindowListeners mListeners;
-    RefPtr<WebSocketFrameListenerChild> mActor;
+    RefPtr<WebSocketEventListenerChild> mActor;
   };
 
   WindowListeners* GetListeners(uint64_t aInnerWindowID) const;
   void ShutdownActorListener(WindowListener* aListener);
 
   // Used only on the main-thread.
   nsClassHashtable<nsUint64HashKey, WindowListener> mWindows;
 
   Atomic<uint64_t> mCountListeners;
 };
 
 } // net namespace
 } // mozilla namespace
 
-#endif // mozilla_net_WebSocketFrameService_h
+#endif // mozilla_net_WebSocketEventService_h
--- a/netwerk/protocol/websocket/WebSocketFrame.h
+++ b/netwerk/protocol/websocket/WebSocketFrame.h
@@ -3,17 +3,17 @@
 /* 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_WebSocketFrame_h
 #define mozilla_net_WebSocketFrame_h
 
 #include "nsAutoPtr.h"
-#include "nsIWebSocketFrameService.h"
+#include "nsIWebSocketEventService.h"
 #include "nsString.h"
 
 namespace IPC {
 class Message;
 }
 
 namespace mozilla {
 namespace net {
--- a/netwerk/protocol/websocket/moz.build
+++ b/netwerk/protocol/websocket/moz.build
@@ -1,47 +1,47 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
 
 XPIDL_SOURCES += [
     'nsIWebSocketChannel.idl',
-    'nsIWebSocketFrameService.idl',
+    'nsIWebSocketEventService.idl',
     'nsIWebSocketListener.idl',
 ]
 
 XPIDL_MODULE = 'necko_websocket'
 
 EXPORTS.mozilla.net += [
     'BaseWebSocketChannel.h',
     'WebSocketChannel.h',
     'WebSocketChannelChild.h',
     'WebSocketChannelParent.h',
+    'WebSocketEventListenerChild.h',
+    'WebSocketEventListenerParent.h',
+    'WebSocketEventService.h',
     'WebSocketFrame.h',
-    'WebSocketFrameListenerChild.h',
-    'WebSocketFrameListenerParent.h',
-    'WebSocketFrameService.h',
 ]
 
 UNIFIED_SOURCES += [
     'BaseWebSocketChannel.cpp',
     'WebSocketChannel.cpp',
     'WebSocketChannelChild.cpp',
     'WebSocketChannelParent.cpp',
+    'WebSocketEventListenerChild.cpp',
+    'WebSocketEventListenerParent.cpp',
+    'WebSocketEventService.cpp',
     'WebSocketFrame.cpp',
-    'WebSocketFrameListenerChild.cpp',
-    'WebSocketFrameListenerParent.cpp',
-    'WebSocketFrameService.cpp',
 ]
 
 IPDL_SOURCES += [
     'PWebSocket.ipdl',
-    'PWebSocketFrameListener.ipdl',
+    'PWebSocketEventListener.ipdl',
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 
 LOCAL_INCLUDES += [
     '/dom/base',
rename from netwerk/protocol/websocket/nsIWebSocketFrameService.idl
rename to netwerk/protocol/websocket/nsIWebSocketEventService.idl
--- a/netwerk/protocol/websocket/nsIWebSocketFrameService.idl
+++ b/netwerk/protocol/websocket/nsIWebSocketEventService.idl
@@ -32,26 +32,26 @@ interface nsIWebSocketFrame : nsISupport
 
   // Control opCode values:
   const long OPCODE_CLOSE        = 0x8;
   const long OPCODE_PING         = 0x9;
   const long OPCODE_PONG         = 0xA;
 };
 
 [scriptable, uuid(f6a7ec44-23b2-4c77-bb94-f11a8df5a874)]
-interface nsIWebSocketFrameListener : nsISupports
+interface nsIWebSocketEventListener : nsISupports
 {
   void frameReceived(in unsigned long aWebSocketSerialID,
                      in nsIWebSocketFrame aFrame);
 
   void frameSent(in unsigned long aWebSocketSerialID,
                  in nsIWebSocketFrame aFrame);
 };
 
 [scriptable, builtinclass, uuid(b89d1b90-2cf3-4d8f-ac21-5aedfb25c760)]
-interface nsIWebSocketFrameService : nsISupports
+interface nsIWebSocketEventService : nsISupports
 {
   void addListener(in unsigned long long aInnerWindowID,
-                   in nsIWebSocketFrameListener aListener);
+                   in nsIWebSocketEventListener aListener);
 
   void removeListener(in unsigned long long aInnerWindowID,
-                      in nsIWebSocketFrameListener aListener);
+                      in nsIWebSocketEventListener aListener);
 };