Backed out changeset 057ffdc30f1e (bug 1257355) for build bustage CLOSED TREE
authorWes Kocher <wkocher@mozilla.com>
Thu, 17 Mar 2016 15:38:39 -0700
changeset 289321 736bdd60d885e75abde0fee1b74296d8c4d233db
parent 289320 35a5691320bcee45d192725d2c3690db2f081240
child 289322 976994a6955bbdc3258b50586857965b0ef7d000
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1257355
milestone48.0a1
backs out057ffdc30f1e80f1b39d0175a61aeb3884302b23
Backed out changeset 057ffdc30f1e (bug 1257355) for build bustage CLOSED TREE MozReview-Commit-ID: 6e53Rrv5mEz
dom/base/Navigator.h
dom/bindings/Bindings.conf
dom/webidl/Navigator.webidl
dom/workers/Navigator.cpp
dom/workers/Navigator.h
dom/workers/WorkerNavigator.cpp
dom/workers/WorkerNavigator.h
dom/workers/WorkerScope.cpp
dom/workers/WorkerScope.h
dom/workers/moz.build
--- a/dom/base/Navigator.h
+++ b/dom/base/Navigator.h
@@ -147,20 +147,16 @@ public:
    */
   void OnNavigation();
 
   // Helper to initialize mMessagesManager.
   nsresult EnsureMessagesManager();
 
   // The XPCOM GetProduct is OK
   // The XPCOM GetLanguage is OK
-  void GetUserAgent(nsString& aUserAgent, ErrorResult& /* unused */)
-  {
-    GetUserAgent(aUserAgent);
-  }
   bool OnLine();
   void RegisterProtocolHandler(const nsAString& aScheme, const nsAString& aURL,
                                const nsAString& aTitle, ErrorResult& aRv);
   void RegisterContentHandler(const nsAString& aMIMEType, const nsAString& aURL,
                               const nsAString& aTitle, ErrorResult& aRv);
   nsMimeTypeArray* GetMimeTypes(ErrorResult& aRv);
   nsPluginArray* GetPlugins(ErrorResult& aRv);
   Permissions* GetPermissions(ErrorResult& aRv);
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -1607,16 +1607,18 @@ DOMInterfaces = {
     # with the same name
     'binaryNames': {
         'console': 'getConsole',
         'performance': 'getPerformance',
     },
 },
 
 'WorkerNavigator': {
+    'headerFile': 'mozilla/dom/workers/bindings/Navigator.h',
+    'workers': True,
     'implicitJSContext': ['getDataStores'],
 },
 
 'XMLHttpRequest': [
 {
     'nativeType': 'nsXMLHttpRequest',
     'implicitJSContext': [ 'send'],
 },
--- a/dom/webidl/Navigator.webidl
+++ b/dom/webidl/Navigator.webidl
@@ -36,17 +36,17 @@ interface NavigatorID {
   [Constant, Cached]
   readonly attribute DOMString appCodeName; // constant "Mozilla"
   [Constant, Cached]
   readonly attribute DOMString appName;
   [Constant, Cached]
   readonly attribute DOMString appVersion;
   [Constant, Cached]
   readonly attribute DOMString platform;
-  [Pure, Cached, Throws]
+  [Pure, Cached, Throws=Workers]
   readonly attribute DOMString userAgent;
   [Constant, Cached]
   readonly attribute DOMString product; // constant "Gecko"
 
   // Everyone but WebKit/Blink supports this.  See bug 679971.
   [Exposed=Window]
   boolean taintEnabled(); // constant false
 };
rename from dom/workers/WorkerNavigator.cpp
rename to dom/workers/Navigator.cpp
--- a/dom/workers/WorkerNavigator.cpp
+++ b/dom/workers/Navigator.cpp
@@ -1,35 +1,34 @@
 /* -*- 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 "mozilla/dom/WorkerNavigator.h"
+#include "DataStore.h"
 
 #include "mozilla/dom/BindingUtils.h"
 #include "mozilla/dom/DataStore.h"
 #include "mozilla/dom/DataStoreBinding.h"
 #include "mozilla/dom/Promise.h"
 #include "mozilla/dom/PromiseWorkerProxy.h"
 #include "mozilla/dom/WorkerNavigatorBinding.h"
 
-#include "DataStore.h"
+#include "Navigator.h"
 #include "nsProxyRelease.h"
 #include "RuntimeService.h"
 
 #include "nsIDocument.h"
 
 #include "WorkerPrivate.h"
 #include "WorkerRunnable.h"
 #include "WorkerScope.h"
 
-namespace mozilla {
-namespace dom {
+BEGIN_WORKERS_NAMESPACE
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(WorkerNavigator)
 
 NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(WorkerNavigator, AddRef)
 NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(WorkerNavigator, Release)
 
 /* static */ already_AddRefed<WorkerNavigator>
 WorkerNavigator::Create(bool aOnLine)
@@ -44,17 +43,17 @@ WorkerNavigator::Create(bool aOnLine)
     new WorkerNavigator(properties, aOnLine);
 
   return navigator.forget();
 }
 
 JSObject*
 WorkerNavigator::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return WorkerNavigatorBinding::Wrap(aCx, this, aGivenProto);
+  return WorkerNavigatorBinding_workers::Wrap(aCx, this, aGivenProto);
 }
 
 // A WorkerMainThreadRunnable to synchronously add DataStoreChangeEventProxy on
 // the main thread. We need this because we have to access |mBackingStore| on
 // the main thread.
 class DataStoreAddEventListenerRunnable : public WorkerMainThreadRunnable
 {
   nsMainThreadPtrHandle<DataStore> mBackingStore;
@@ -296,17 +295,17 @@ WorkerNavigator::GetDataStores(JSContext
   }
 
   return promise.forget();
 }
 
 void
 WorkerNavigator::SetLanguages(const nsTArray<nsString>& aLanguages)
 {
-  WorkerNavigatorBinding::ClearCachedLanguagesValue(this);
+  WorkerNavigatorBinding_workers::ClearCachedLanguagesValue(this);
   mProperties.mLanguages = aLanguages;
 }
 
 void
 WorkerNavigator::GetAppName(nsString& aAppName) const
 {
   WorkerPrivate* workerPrivate = GetCurrentThreadWorkerPrivate();
   MOZ_ASSERT(workerPrivate);
@@ -395,10 +394,9 @@ WorkerNavigator::GetUserAgent(nsString& 
   MOZ_ASSERT(workerPrivate);
 
   RefPtr<GetUserAgentRunnable> runnable =
     new GetUserAgentRunnable(workerPrivate, aUserAgent);
 
   runnable->Dispatch(aRv);
 }
 
-} // namespace dom
-} // namespace mozilla
+END_WORKERS_NAMESPACE
rename from dom/workers/WorkerNavigator.h
rename to dom/workers/Navigator.h
--- a/dom/workers/WorkerNavigator.h
+++ b/dom/workers/Navigator.h
@@ -1,33 +1,37 @@
 /* -*- 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_dom_navigator_h__
-#define mozilla_dom_navigator_h__
+#ifndef mozilla_dom_workers_navigator_h__
+#define mozilla_dom_workers_navigator_h__
 
 #include "Workers.h"
 #include "RuntimeService.h"
 #include "nsString.h"
 #include "nsWrapperCache.h"
 
 // Need this to use Navigator::HasDataStoreSupport() in
 // WorkerNavigatorBinding.cpp
 #include "mozilla/dom/Navigator.h"
 
 namespace mozilla {
 namespace dom {
 class Promise;
+} // namespace dom
+} // namespace mozilla
+
+BEGIN_WORKERS_NAMESPACE
 
 class WorkerNavigator final : public nsWrapperCache
 {
-  typedef struct workers::RuntimeService::NavigatorProperties NavigatorProperties;
+  typedef struct RuntimeService::NavigatorProperties NavigatorProperties;
 
   NavigatorProperties mProperties;
   bool mOnline;
 
   WorkerNavigator(const NavigatorProperties& aProperties,
                   bool aOnline)
     : mProperties(aProperties)
     , mOnline(aOnline)
@@ -105,12 +109,11 @@ public:
   void SetLanguages(const nsTArray<nsString>& aLanguages);
 
   already_AddRefed<Promise> GetDataStores(JSContext* aCx,
                                           const nsAString& aName,
                                           const nsAString& aOwner,
                                           ErrorResult& aRv);
 };
 
-} // namespace dom
-} // namespace mozilla
+END_WORKERS_NAMESPACE
 
-#endif // mozilla_dom_navigator_h__
+#endif // mozilla_dom_workers_navigator_h__
--- a/dom/workers/WorkerScope.cpp
+++ b/dom/workers/WorkerScope.cpp
@@ -17,28 +17,28 @@
 #include "mozilla/dom/ImageBitmap.h"
 #include "mozilla/dom/Promise.h"
 #include "mozilla/dom/PromiseWorkerProxy.h"
 #include "mozilla/dom/ServiceWorkerGlobalScopeBinding.h"
 #include "mozilla/dom/SharedWorkerGlobalScopeBinding.h"
 #include "mozilla/dom/WorkerDebuggerGlobalScopeBinding.h"
 #include "mozilla/dom/WorkerGlobalScopeBinding.h"
 #include "mozilla/dom/WorkerLocation.h"
-#include "mozilla/dom/WorkerNavigator.h"
 #include "mozilla/dom/cache/CacheStorage.h"
 #include "mozilla/Services.h"
 #include "nsServiceManagerUtils.h"
 
 #include "nsIDocument.h"
 #include "nsIServiceWorkerManager.h"
 
 #ifdef ANDROID
 #include <android/log.h>
 #endif
 
+#include "Navigator.h"
 #include "Principal.h"
 #include "RuntimeService.h"
 #include "ScriptLoader.h"
 #include "WorkerPrivate.h"
 #include "WorkerRunnable.h"
 #include "Performance.h"
 #include "ServiceWorkerClients.h"
 #include "ServiceWorkerManager.h"
--- a/dom/workers/WorkerScope.h
+++ b/dom/workers/WorkerScope.h
@@ -19,30 +19,30 @@ namespace dom {
 
 class Console;
 class Function;
 class IDBFactory;
 class Promise;
 class RequestOrUSVString;
 class ServiceWorkerRegistrationWorkerThread;
 class WorkerLocation;
-class WorkerNavigator;
 
 namespace cache {
 
 class CacheStorage;
 
 } // namespace cache
 } // namespace dom
 } // namespace mozilla
 
 BEGIN_WORKERS_NAMESPACE
 
 class ServiceWorkerClients;
 class WorkerPrivate;
+class WorkerNavigator;
 class Performance;
 
 class WorkerGlobalScope : public DOMEventTargetHelper,
                           public nsIGlobalObject,
                           public nsSupportsWeakReference
 {
   typedef mozilla::dom::IDBFactory IDBFactory;
 
--- a/dom/workers/moz.build
+++ b/dom/workers/moz.build
@@ -9,33 +9,33 @@ EXPORTS.mozilla.dom += [
     'FileReaderSync.h',
     'ServiceWorkerCommon.h',
     'ServiceWorkerContainer.h',
     'ServiceWorkerEvents.h',
     'ServiceWorkerMessageEvent.h',
     'ServiceWorkerRegistrar.h',
     'ServiceWorkerRegistration.h',
     'WorkerLocation.h',
-    'WorkerNavigator.h',
     'WorkerPrefs.h',
     'WorkerPrivate.h',
     'WorkerRunnable.h',
     'WorkerScope.h',
 ]
 
 EXPORTS.mozilla.dom.workers += [
     'ServiceWorkerManager.h',
     'WorkerDebuggerManager.h',
     'Workers.h',
 ]
 
 # Stuff needed for the bindings, not really public though.
 EXPORTS.mozilla.dom.workers.bindings += [
     'DataStore.h',
     'DataStoreCursor.h',
+    'Navigator.h',
     'Performance.h',
     'ServiceWorker.h',
     'ServiceWorkerClient.h',
     'ServiceWorkerClients.h',
     'ServiceWorkerWindowClient.h',
     'SharedWorker.h',
     'URL.h',
     'WorkerFeature.h',
@@ -50,16 +50,17 @@ XPIDL_SOURCES += [
     'nsIWorkerDebuggerManager.idl',
 ]
 
 UNIFIED_SOURCES += [
     'ChromeWorkerScope.cpp',
     'DataStore.cpp',
     'DataStoreCursor.cpp',
     'FileReaderSync.cpp',
+    'Navigator.cpp',
     'Performance.cpp',
     'Principal.cpp',
     'RegisterBindings.cpp',
     'RuntimeService.cpp',
     'ScriptLoader.cpp',
     'ServiceWorker.cpp',
     'ServiceWorkerClient.cpp',
     'ServiceWorkerClients.cpp',
@@ -74,17 +75,16 @@ UNIFIED_SOURCES += [
     'ServiceWorkerRegistrar.cpp',
     'ServiceWorkerRegistration.cpp',
     'ServiceWorkerScriptCache.cpp',
     'ServiceWorkerWindowClient.cpp',
     'SharedWorker.cpp',
     'URL.cpp',
     'WorkerDebuggerManager.cpp',
     'WorkerLocation.cpp',
-    'WorkerNavigator.cpp',
     'WorkerPrivate.cpp',
     'WorkerRunnable.cpp',
     'WorkerScope.cpp',
     'WorkerThread.cpp',
     'XMLHttpRequest.cpp',
     'XMLHttpRequestUpload.cpp',
 ]