Skip to content

Commit

Permalink
Bug 885982 - Part 1: Convert TCPSocket to WebIDL and rewrite in C++. …
Browse files Browse the repository at this point in the history
…r=asuth,mayhemer,bz
  • Loading branch information
jdm committed Mar 25, 2015
1 parent 538706c commit 6d83166
Show file tree
Hide file tree
Showing 19 changed files with 1,435 additions and 32 deletions.
8 changes: 8 additions & 0 deletions dom/base/Navigator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#include "mozilla/dom/Permissions.h"
#include "mozilla/dom/Presentation.h"
#include "mozilla/dom/ServiceWorkerContainer.h"
#include "mozilla/dom/TCPSocket.h"
#include "mozilla/dom/Telephony.h"
#include "mozilla/dom/Voicemail.h"
#include "mozilla/dom/TVManager.h"
Expand Down Expand Up @@ -1805,6 +1806,13 @@ Navigator::GetInputPortManager(ErrorResult& aRv)
return mInputPortManager;
}

already_AddRefed<LegacyMozTCPSocket>
Navigator::MozTCPSocket()
{
nsRefPtr<LegacyMozTCPSocket> socket = new LegacyMozTCPSocket(GetWindow());
return socket.forget();
}

#ifdef MOZ_B2G
already_AddRefed<Promise>
Navigator::GetMobileIdAssertion(const MobileIdOptions& aOptions,
Expand Down
2 changes: 2 additions & 0 deletions dom/base/Navigator.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ class TVManager;
class InputPortManager;
class DeviceStorageAreaListener;
class Presentation;
class LegacyMozTCPSocket;

namespace time {
class TimeManager;
Expand Down Expand Up @@ -242,6 +243,7 @@ class Navigator final : public nsIDOMNavigator
Voicemail* GetMozVoicemail(ErrorResult& aRv);
TVManager* GetTv();
InputPortManager* GetInputPortManager(ErrorResult& aRv);
already_AddRefed<LegacyMozTCPSocket> MozTCPSocket();
network::Connection* GetConnection(ErrorResult& aRv);
nsDOMCameraManager* GetMozCameras(ErrorResult& aRv);
MediaDevices* GetMediaDevices(ErrorResult& aRv);
Expand Down
2 changes: 2 additions & 0 deletions dom/base/nsGkAtomList.h
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,7 @@ GK_ATOM(onDOMNodeInsertedIntoDocument, "onDOMNodeInsertedIntoDocument")
GK_ATOM(onDOMNodeRemoved, "onDOMNodeRemoved")
GK_ATOM(onDOMNodeRemovedFromDocument, "onDOMNodeRemovedFromDocument")
GK_ATOM(onDOMSubtreeModified, "onDOMSubtreeModified")
GK_ATOM(ondata, "ondata")
GK_ATOM(ondrag, "ondrag")
GK_ATOM(ondragdrop, "ondragdrop")
GK_ATOM(ondragend, "ondragend")
Expand All @@ -762,6 +763,7 @@ GK_ATOM(ondraggesture, "ondraggesture")
GK_ATOM(ondragleave, "ondragleave")
GK_ATOM(ondragover, "ondragover")
GK_ATOM(ondragstart, "ondragstart")
GK_ATOM(ondrain, "ondrain")
GK_ATOM(ondrop, "ondrop")
GK_ATOM(oneitbroadcasted, "oneitbroadcasted")
GK_ATOM(onenabled, "onenabled")
Expand Down
5 changes: 5 additions & 0 deletions dom/bindings/Bindings.conf
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,11 @@ DOMInterfaces = {
'concrete': False
},

'LegacyMozTCPSocket': {
'headerFile': 'TCPSocket.h',
'wrapperCache': False,
},

'LocalMediaStream': {
'headerFile': 'DOMMediaStream.h',
'nativeType': 'mozilla::DOMLocalMediaStream'
Expand Down
8 changes: 8 additions & 0 deletions dom/events/test/test_all_synthetic_events.html
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,14 @@
return e;
},
},
TCPSocketErrorEvent: { create: function(aName, aProps) {
return new TCPSocketErrorEvent(aName, aProps);
},
},
TCPSocketEvent: { create: function(aName, aProps) {
return new TCPSocketEvent(aName, aProps);
},
},
TimeEvent: { create: function (aName, aProps) {
var e = document.createEvent("timeevent");
e.initTimeEvent(aName, aProps.view, aProps.detail);
Expand Down
Loading

0 comments on commit 6d83166

Please sign in to comment.