Bug 1218146 - Move WindowClient.frameType to Client.frameType; r=bzbarsky
authorEhsan Akhgari <ehsan@mozilla.com>
Sat, 24 Oct 2015 23:17:02 -0400
changeset 304798 6aa63a7bc1afb43476d3383b4d3238d38afc1b22
parent 304797 add63b27b7ba7e248f9903ed9e569d75d7d10e03
child 304799 dc9f05c4fef97d314322092b4a9bfed2ad27dc51
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)
reviewersbzbarsky
bugs1218146
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 1218146 - Move WindowClient.frameType to Client.frameType; r=bzbarsky
dom/webidl/Client.webidl
dom/workers/ServiceWorkerClient.h
dom/workers/ServiceWorkerWindowClient.h
--- a/dom/webidl/Client.webidl
+++ b/dom/webidl/Client.webidl
@@ -5,28 +5,28 @@
  *
  * The origin of this IDL file is
  * http://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html
  *
  */
 
 [Exposed=ServiceWorker]
 interface Client {
+  readonly attribute USVString url;
+  readonly attribute FrameType frameType;
   readonly attribute DOMString id;
-  readonly attribute USVString url;
 
   [Throws]
   void postMessage(any message, optional sequence<Transferable> transfer);
 };
 
 [Exposed=ServiceWorker]
 interface WindowClient : Client {
   readonly attribute VisibilityState visibilityState;
   readonly attribute boolean focused;
-  readonly attribute FrameType frameType;
 
   [Throws]
   Promise<WindowClient> focus();
 };
 
 enum FrameType {
   "auxiliary",
   "top-level",
--- a/dom/workers/ServiceWorkerClient.h
+++ b/dom/workers/ServiceWorkerClient.h
@@ -52,16 +52,17 @@ public:
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(ServiceWorkerClient)
 
   ServiceWorkerClient(nsISupports* aOwner,
                       const ServiceWorkerClientInfo& aClientInfo)
     : mOwner(aOwner)
     , mId(aClientInfo.mClientId)
     , mUrl(aClientInfo.mUrl)
     , mWindowId(aClientInfo.mWindowId)
+    , mFrameType(aClientInfo.mFrameType)
   {
     MOZ_ASSERT(aOwner);
   }
 
   nsISupports*
   GetParentObject() const
   {
     return mOwner;
@@ -73,16 +74,22 @@ public:
   }
 
   void
   GetUrl(nsAString& aUrl) const
   {
     aUrl.Assign(mUrl);
   }
 
+  mozilla::dom::FrameType
+  FrameType() const
+  {
+    return mFrameType;
+  }
+
   void
   PostMessage(JSContext* aCx, JS::Handle<JS::Value> aMessage,
               const Optional<Sequence<JS::Value>>& aTransferable,
               ErrorResult& aRv);
 
   JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
 
 protected:
@@ -91,15 +98,16 @@ protected:
 
 private:
   nsCOMPtr<nsISupports> mOwner;
   nsString mId;
   nsString mUrl;
 
 protected:
   uint64_t mWindowId;
+  mozilla::dom::FrameType mFrameType;
 };
 
 } // namespace workers
 } // namespace dom
 } // namespace mozilla
 
 #endif // mozilla_dom_workers_serviceworkerclient_h
--- a/dom/workers/ServiceWorkerWindowClient.h
+++ b/dom/workers/ServiceWorkerWindowClient.h
@@ -19,18 +19,17 @@ namespace workers {
 
 class ServiceWorkerWindowClient final : public ServiceWorkerClient
 {
 public:
   ServiceWorkerWindowClient(nsISupports* aOwner,
                             const ServiceWorkerClientInfo& aClientInfo)
     : ServiceWorkerClient(aOwner, aClientInfo),
       mVisibilityState(aClientInfo.mVisibilityState),
-      mFocused(aClientInfo.mFocused),
-      mFrameType(aClientInfo.mFrameType)
+      mFocused(aClientInfo.mFocused)
   {
   }
 
   virtual JSObject*
   WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
 
   mozilla::dom::VisibilityState
   VisibilityState() const
@@ -39,31 +38,24 @@ public:
   }
 
   bool
   Focused() const
   {
     return mFocused;
   }
 
-  mozilla::dom::FrameType
-  FrameType() const
-  {
-    return mFrameType;
-  }
-
   already_AddRefed<Promise>
   Focus(ErrorResult& aRv) const;
 
 private:
   ~ServiceWorkerWindowClient()
   { }
 
   mozilla::dom::VisibilityState mVisibilityState;
   bool mFocused;
-  mozilla::dom::FrameType mFrameType;
 };
 
 } // namespace workers
 } // namespace dom
 } // namespace mozilla
 
 #endif // mozilla_dom_workers_serviceworkerwindowclient_h