Bug 1867190 - Initialise the PHC allocate delay later r=glandium
[gecko.git] / dom / ipc / ProcessActor.cpp
blobb036f625c2964fe8c617f702a7028dce3f8776f2
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:set ts=2 sw=2 sts=2 et cindent: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "mozilla/dom/ProcessActor.h"
9 #include "nsContentUtils.h"
10 #include "mozilla/ContentBlockingAllowList.h"
11 #include "mozilla/Logging.h"
12 #include "mozilla/dom/JSActorService.h"
13 #include "mozilla/dom/JSProcessActorParent.h"
14 #include "mozilla/dom/JSProcessActorChild.h"
15 #include "mozilla/dom/JSProcessActorProtocol.h"
17 namespace mozilla::dom {
19 already_AddRefed<JSActorProtocol> ProcessActor::MatchingJSActorProtocol(
20 JSActorService* aActorSvc, const nsACString& aName, ErrorResult& aRv) {
21 RefPtr<JSProcessActorProtocol> proto =
22 aActorSvc->GetJSProcessActorProtocol(aName);
23 if (!proto) {
24 aRv.ThrowNotFoundError(nsPrintfCString("No such JSProcessActor '%s'",
25 PromiseFlatCString(aName).get()));
26 return nullptr;
29 if (!proto->Matches(GetRemoteType(), aRv)) {
30 MOZ_ASSERT(aRv.Failed());
31 return nullptr;
33 MOZ_ASSERT(!aRv.Failed());
34 return proto.forget();
37 } // namespace mozilla::dom