Bug 1257355: Remove the worker descriptor for WorkerNavigator. r=bz

--HG--
rename : dom/workers/Navigator.cpp => dom/workers/WorkerNavigator.cpp
rename : dom/workers/Navigator.h => dom/workers/WorkerNavigator.h
This commit is contained in:
Kyle Huey 2016-03-17 15:06:14 -07:00
parent dd288c5851
commit bee42d87b9
8 changed files with 23 additions and 22 deletions

View File

@ -152,6 +152,10 @@ public:
// 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);

View File

@ -1612,8 +1612,6 @@ DOMInterfaces = {
},
'WorkerNavigator': {
'headerFile': 'mozilla/dom/workers/bindings/Navigator.h',
'workers': True,
'implicitJSContext': ['getDataStores'],
},

View File

@ -41,7 +41,7 @@ interface NavigatorID {
readonly attribute DOMString appVersion;
[Constant, Cached]
readonly attribute DOMString platform;
[Pure, Cached, Throws=Workers]
[Pure, Cached, Throws]
readonly attribute DOMString userAgent;
[Constant, Cached]
readonly attribute DOMString product; // constant "Gecko"

View File

@ -4,7 +4,7 @@
* 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 "DataStore.h"
#include "mozilla/dom/WorkerNavigator.h"
#include "mozilla/dom/BindingUtils.h"
#include "mozilla/dom/DataStore.h"
@ -13,7 +13,7 @@
#include "mozilla/dom/PromiseWorkerProxy.h"
#include "mozilla/dom/WorkerNavigatorBinding.h"
#include "Navigator.h"
#include "DataStore.h"
#include "nsProxyRelease.h"
#include "RuntimeService.h"
@ -23,7 +23,8 @@
#include "WorkerRunnable.h"
#include "WorkerScope.h"
BEGIN_WORKERS_NAMESPACE
namespace mozilla {
namespace dom {
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(WorkerNavigator)
@ -48,7 +49,7 @@ WorkerNavigator::Create(bool aOnLine)
JSObject*
WorkerNavigator::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
{
return WorkerNavigatorBinding_workers::Wrap(aCx, this, aGivenProto);
return WorkerNavigatorBinding::Wrap(aCx, this, aGivenProto);
}
// A WorkerMainThreadRunnable to synchronously add DataStoreChangeEventProxy on
@ -300,7 +301,7 @@ WorkerNavigator::GetDataStores(JSContext* aCx,
void
WorkerNavigator::SetLanguages(const nsTArray<nsString>& aLanguages)
{
WorkerNavigatorBinding_workers::ClearCachedLanguagesValue(this);
WorkerNavigatorBinding::ClearCachedLanguagesValue(this);
mProperties.mLanguages = aLanguages;
}
@ -399,4 +400,5 @@ WorkerNavigator::GetUserAgent(nsString& aUserAgent, ErrorResult& aRv) const
runnable->Dispatch(aRv);
}
END_WORKERS_NAMESPACE
} // namespace dom
} // namespace mozilla

View File

@ -4,8 +4,8 @@
* 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_navigator_h__
#define mozilla_dom_workers_navigator_h__
#ifndef mozilla_dom_navigator_h__
#define mozilla_dom_navigator_h__
#include "Workers.h"
#include "RuntimeService.h"
@ -19,14 +19,10 @@
namespace mozilla {
namespace dom {
class Promise;
} // namespace dom
} // namespace mozilla
BEGIN_WORKERS_NAMESPACE
class WorkerNavigator final : public nsWrapperCache
{
typedef struct RuntimeService::NavigatorProperties NavigatorProperties;
typedef struct workers::RuntimeService::NavigatorProperties NavigatorProperties;
NavigatorProperties mProperties;
bool mOnline;
@ -114,6 +110,7 @@ public:
ErrorResult& aRv);
};
END_WORKERS_NAMESPACE
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_workers_navigator_h__
#endif // mozilla_dom_navigator_h__

View File

@ -22,6 +22,7 @@
#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"
@ -33,7 +34,6 @@
#include <android/log.h>
#endif
#include "Navigator.h"
#include "Principal.h"
#include "RuntimeService.h"
#include "ScriptLoader.h"

View File

@ -24,6 +24,7 @@ class Promise;
class RequestOrUSVString;
class ServiceWorkerRegistrationWorkerThread;
class WorkerLocation;
class WorkerNavigator;
namespace cache {
@ -37,7 +38,6 @@ BEGIN_WORKERS_NAMESPACE
class ServiceWorkerClients;
class WorkerPrivate;
class WorkerNavigator;
class Performance;
class WorkerGlobalScope : public DOMEventTargetHelper,

View File

@ -14,6 +14,7 @@ EXPORTS.mozilla.dom += [
'ServiceWorkerRegistrar.h',
'ServiceWorkerRegistration.h',
'WorkerLocation.h',
'WorkerNavigator.h',
'WorkerPrefs.h',
'WorkerPrivate.h',
'WorkerRunnable.h',
@ -30,7 +31,6 @@ EXPORTS.mozilla.dom.workers += [
EXPORTS.mozilla.dom.workers.bindings += [
'DataStore.h',
'DataStoreCursor.h',
'Navigator.h',
'Performance.h',
'ServiceWorker.h',
'ServiceWorkerClient.h',
@ -55,7 +55,6 @@ UNIFIED_SOURCES += [
'DataStore.cpp',
'DataStoreCursor.cpp',
'FileReaderSync.cpp',
'Navigator.cpp',
'Performance.cpp',
'Principal.cpp',
'RegisterBindings.cpp',
@ -80,6 +79,7 @@ UNIFIED_SOURCES += [
'URL.cpp',
'WorkerDebuggerManager.cpp',
'WorkerLocation.cpp',
'WorkerNavigator.cpp',
'WorkerPrivate.cpp',
'WorkerRunnable.cpp',
'WorkerScope.cpp',