зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1468789 - Part 1: Add window id inside realm creation options. r=jandem,bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D51859 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
085e0c04f7
Коммит
bc87c9100f
|
@ -41,7 +41,6 @@
|
|||
#include "XrayWrapper.h"
|
||||
#include "nsPrintfCString.h"
|
||||
#include "mozilla/Sprintf.h"
|
||||
#include "nsGlobalWindow.h"
|
||||
#include "nsReadableUtils.h"
|
||||
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
|
@ -3242,6 +3241,16 @@ bool CreateGlobalOptionsWithXPConnect::PostCreateGlobal(
|
|||
return true;
|
||||
}
|
||||
|
||||
uint64_t GetWindowID(void* aGlobal) { return 0; }
|
||||
|
||||
uint64_t GetWindowID(nsGlobalWindowInner* aGlobal) {
|
||||
return aGlobal->WindowID();
|
||||
}
|
||||
|
||||
uint64_t GetWindowID(DedicatedWorkerGlobalScope* aGlobal) {
|
||||
return aGlobal->WindowID();
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
void AssertReturnTypeMatchesJitinfo(const JSJitInfo* aJitInfo,
|
||||
JS::Handle<JS::Value> aValue) {
|
||||
|
|
|
@ -54,6 +54,7 @@ enum UseCounter : int16_t;
|
|||
namespace dom {
|
||||
class CustomElementReactionsStack;
|
||||
class MessageManagerGlobal;
|
||||
class DedicatedWorkerGlobalScope;
|
||||
template <typename KeyType, typename ValueType>
|
||||
class Record;
|
||||
class WindowProxyHolder;
|
||||
|
@ -2812,6 +2813,10 @@ struct CreateGlobalOptions<nsGlobalWindowInner>
|
|||
ProtoAndIfaceCache::WindowLike;
|
||||
};
|
||||
|
||||
uint64_t GetWindowID(void* aGlobal);
|
||||
uint64_t GetWindowID(nsGlobalWindowInner* aGlobal);
|
||||
uint64_t GetWindowID(DedicatedWorkerGlobalScope* aGlobal);
|
||||
|
||||
// The return value is true if we created and successfully performed our part of
|
||||
// the setup for the global, false otherwise.
|
||||
//
|
||||
|
@ -2824,7 +2829,9 @@ bool CreateGlobal(JSContext* aCx, T* aNative, nsWrapperCache* aCache,
|
|||
const JSClass* aClass, JS::RealmOptions& aOptions,
|
||||
JSPrincipals* aPrincipal, bool aInitStandardClasses,
|
||||
JS::MutableHandle<JSObject*> aGlobal) {
|
||||
aOptions.creationOptions().setTrace(CreateGlobalOptions<T>::TraceGlobal);
|
||||
aOptions.creationOptions()
|
||||
.setTrace(CreateGlobalOptions<T>::TraceGlobal)
|
||||
.setProfilerRealmID(GetWindowID(aNative));
|
||||
xpc::SetPrefableRealmOptions(aOptions);
|
||||
|
||||
aGlobal.set(JS_NewGlobalObject(aCx, aClass, aPrincipal,
|
||||
|
|
|
@ -580,6 +580,10 @@ WorkerGlobalScope::GetOrCreateServiceWorkerRegistration(
|
|||
return ref.forget();
|
||||
}
|
||||
|
||||
uint64_t WorkerGlobalScope::WindowID() const {
|
||||
return mWorkerPrivate->WindowID();
|
||||
}
|
||||
|
||||
void WorkerGlobalScope::FirstPartyStorageAccessGranted() {
|
||||
// Reset the IndexedDB factory.
|
||||
mIndexedDB = nullptr;
|
||||
|
|
|
@ -228,6 +228,8 @@ class WorkerGlobalScope : public DOMEventTargetHelper,
|
|||
GetOrCreateServiceWorkerRegistration(
|
||||
const ServiceWorkerRegistrationDescriptor& aDescriptor) override;
|
||||
|
||||
uint64_t WindowID() const;
|
||||
|
||||
void FirstPartyStorageAccessGranted();
|
||||
};
|
||||
|
||||
|
|
|
@ -180,6 +180,12 @@ class JS_PUBLIC_API RealmCreationOptions {
|
|||
return *this;
|
||||
}
|
||||
|
||||
uint64_t profilerRealmID() const { return profilerRealmID_; }
|
||||
RealmCreationOptions& setProfilerRealmID(uint64_t id) {
|
||||
profilerRealmID_ = id;
|
||||
return *this;
|
||||
}
|
||||
|
||||
private:
|
||||
JSTraceOp traceGlobal_ = nullptr;
|
||||
CompartmentSpecifier compSpec_ = CompartmentSpecifier::NewCompartmentAndZone;
|
||||
|
@ -187,6 +193,7 @@ class JS_PUBLIC_API RealmCreationOptions {
|
|||
Compartment* comp_;
|
||||
Zone* zone_;
|
||||
};
|
||||
uint64_t profilerRealmID_ = 0;
|
||||
bool invisibleToDebugger_ = false;
|
||||
bool mergeable_ = false;
|
||||
bool preserveJitCode_ = false;
|
||||
|
|
Загрузка…
Ссылка в новой задаче