From 348998b290e5eb856a2826089b87ec7cb92ae79f Mon Sep 17 00:00:00 2001 From: Kyle Huey Date: Wed, 16 Mar 2016 11:51:11 -0700 Subject: [PATCH] Bug 1257038: Remove the worker descriptor for WorkerLocation. r=bz --HG-- rename : dom/workers/Location.cpp => dom/workers/WorkerLocation.cpp rename : dom/workers/Location.h => dom/workers/WorkerLocation.h --- dom/bindings/Bindings.conf | 5 ----- dom/workers/{Location.cpp => WorkerLocation.cpp} | 12 +++++++----- dom/workers/{Location.h => WorkerLocation.h} | 14 ++++++++------ dom/workers/WorkerScope.cpp | 2 +- dom/workers/WorkerScope.h | 2 +- dom/workers/moz.build | 4 ++-- 6 files changed, 19 insertions(+), 20 deletions(-) rename dom/workers/{Location.cpp => WorkerLocation.cpp} (83%) rename dom/workers/{Location.h => WorkerLocation.h} (91%) diff --git a/dom/bindings/Bindings.conf b/dom/bindings/Bindings.conf index bb672882665f..85d198aa4302 100644 --- a/dom/bindings/Bindings.conf +++ b/dom/bindings/Bindings.conf @@ -1614,11 +1614,6 @@ DOMInterfaces = { }, }, -'WorkerLocation': { - 'headerFile': 'mozilla/dom/workers/bindings/Location.h', - 'workers': True, -}, - 'WorkerNavigator': { 'headerFile': 'mozilla/dom/workers/bindings/Navigator.h', 'workers': True, diff --git a/dom/workers/Location.cpp b/dom/workers/WorkerLocation.cpp similarity index 83% rename from dom/workers/Location.cpp rename to dom/workers/WorkerLocation.cpp index 30e8a2f295ec..469bf84bfd2d 100644 --- a/dom/workers/Location.cpp +++ b/dom/workers/WorkerLocation.cpp @@ -4,11 +4,12 @@ * 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 "Location.h" +#include "mozilla/dom/WorkerLocation.h" #include "mozilla/dom/WorkerLocationBinding.h" -BEGIN_WORKERS_NAMESPACE +namespace mozilla { +namespace dom { NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(WorkerLocation) @@ -16,7 +17,7 @@ NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(WorkerLocation, AddRef) NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(WorkerLocation, Release) /* static */ already_AddRefed -WorkerLocation::Create(WorkerPrivate::LocationInfo& aInfo) +WorkerLocation::Create(workers::WorkerPrivate::LocationInfo& aInfo) { RefPtr location = new WorkerLocation(NS_ConvertUTF8toUTF16(aInfo.mHref), @@ -35,7 +36,8 @@ WorkerLocation::Create(WorkerPrivate::LocationInfo& aInfo) JSObject* WorkerLocation::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return WorkerLocationBinding_workers::Wrap(aCx, this, aGivenProto); + return WorkerLocationBinding::Wrap(aCx, this, aGivenProto); } -END_WORKERS_NAMESPACE +} // namespace dom +} // namespace mozilla diff --git a/dom/workers/Location.h b/dom/workers/WorkerLocation.h similarity index 91% rename from dom/workers/Location.h rename to dom/workers/WorkerLocation.h index cf70001131e3..73137efff229 100644 --- a/dom/workers/Location.h +++ b/dom/workers/WorkerLocation.h @@ -4,14 +4,15 @@ * 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_workers_location_h__ -#define mozilla_dom_workers_location_h__ +#ifndef mozilla_dom_location_h__ +#define mozilla_dom_location_h__ #include "Workers.h" #include "WorkerPrivate.h" #include "nsWrapperCache.h" -BEGIN_WORKERS_NAMESPACE +namespace mozilla { +namespace dom { class WorkerLocation final : public nsWrapperCache { @@ -58,7 +59,7 @@ public: NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WorkerLocation) static already_AddRefed - Create(WorkerPrivate::LocationInfo& aInfo); + Create(workers::WorkerPrivate::LocationInfo& aInfo); virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; @@ -109,6 +110,7 @@ public: } }; -END_WORKERS_NAMESPACE +} // namespace dom +} // namespace mozilla -#endif // mozilla_dom_workers_location_h__ +#endif // mozilla_dom_location_h__ diff --git a/dom/workers/WorkerScope.cpp b/dom/workers/WorkerScope.cpp index 8c98f3cc8152..b9d78951e2f4 100644 --- a/dom/workers/WorkerScope.cpp +++ b/dom/workers/WorkerScope.cpp @@ -21,6 +21,7 @@ #include "mozilla/dom/SharedWorkerGlobalScopeBinding.h" #include "mozilla/dom/WorkerDebuggerGlobalScopeBinding.h" #include "mozilla/dom/WorkerGlobalScopeBinding.h" +#include "mozilla/dom/WorkerLocation.h" #include "mozilla/dom/cache/CacheStorage.h" #include "mozilla/Services.h" #include "nsServiceManagerUtils.h" @@ -32,7 +33,6 @@ #include #endif -#include "Location.h" #include "Navigator.h" #include "Principal.h" #include "RuntimeService.h" diff --git a/dom/workers/WorkerScope.h b/dom/workers/WorkerScope.h index 50de58e39712..ff0be3d62d6d 100644 --- a/dom/workers/WorkerScope.h +++ b/dom/workers/WorkerScope.h @@ -23,6 +23,7 @@ class IDBFactory; class Promise; class RequestOrUSVString; class ServiceWorkerRegistrationWorkerThread; +class WorkerLocation; namespace cache { @@ -36,7 +37,6 @@ BEGIN_WORKERS_NAMESPACE class ServiceWorkerClients; class WorkerPrivate; -class WorkerLocation; class WorkerNavigator; class Performance; diff --git a/dom/workers/moz.build b/dom/workers/moz.build index 9512f57c21e7..1bd546d48f87 100644 --- a/dom/workers/moz.build +++ b/dom/workers/moz.build @@ -12,6 +12,7 @@ EXPORTS.mozilla.dom += [ 'ServiceWorkerMessageEvent.h', 'ServiceWorkerRegistrar.h', 'ServiceWorkerRegistration.h', + 'WorkerLocation.h', 'WorkerPrefs.h', 'WorkerPrivate.h', 'WorkerRunnable.h', @@ -29,7 +30,6 @@ EXPORTS.mozilla.dom.workers.bindings += [ 'DataStore.h', 'DataStoreCursor.h', 'FileReaderSync.h', - 'Location.h', 'Navigator.h', 'Performance.h', 'ServiceWorker.h', @@ -55,7 +55,6 @@ UNIFIED_SOURCES += [ 'DataStore.cpp', 'DataStoreCursor.cpp', 'FileReaderSync.cpp', - 'Location.cpp', 'Navigator.cpp', 'Performance.cpp', 'Principal.cpp', @@ -80,6 +79,7 @@ UNIFIED_SOURCES += [ 'SharedWorker.cpp', 'URL.cpp', 'WorkerDebuggerManager.cpp', + 'WorkerLocation.cpp', 'WorkerPrivate.cpp', 'WorkerRunnable.cpp', 'WorkerScope.cpp',