Source code

Revision control

Other Tools

1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
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/. */
6
7
#include "FetchEventOpParent.h"
8
9
#include "nsDebug.h"
10
11
#include "mozilla/Assertions.h"
12
#include "mozilla/RefPtr.h"
13
#include "mozilla/Unused.h"
14
#include "mozilla/dom/FetchEventOpProxyParent.h"
15
#include "mozilla/dom/RemoteWorkerControllerParent.h"
16
#include "mozilla/dom/RemoteWorkerParent.h"
17
#include "mozilla/ipc/BackgroundParent.h"
18
19
namespace mozilla {
20
21
using namespace ipc;
22
23
namespace dom {
24
25
void FetchEventOpParent::Initialize(
26
const ServiceWorkerFetchEventOpArgs& aArgs) {
27
AssertIsInMainProcess();
28
AssertIsOnBackgroundThread();
29
30
RemoteWorkerControllerParent* manager =
31
static_cast<RemoteWorkerControllerParent*>(Manager());
32
MOZ_ASSERT(manager);
33
34
// This will be null when the manager's RemoteWorkerController has shutdown.
35
RefPtr<RemoteWorkerParent> proxyManager = manager->GetRemoteWorkerParent();
36
if (NS_WARN_IF(!proxyManager)) {
37
Unused << Send__delete__(this, NS_ERROR_DOM_ABORT_ERR);
38
39
return;
40
}
41
42
FetchEventOpProxyParent::Create(proxyManager.get(), aArgs, this);
43
}
44
45
void FetchEventOpParent::ActorDestroy(ActorDestroyReason) {
46
AssertIsOnBackgroundThread();
47
}
48
49
} // namespace dom
50
} // namespace mozilla