/src/mozilla-central/dom/clients/manager/ClientOpenWindowOpChild.cpp
Line | Count | Source (jump to first uncovered line) |
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 "ClientOpenWindowOpChild.h" |
8 | | #include "ClientOpenWindowUtils.h" |
9 | | #include "mozilla/SystemGroup.h" |
10 | | |
11 | | namespace mozilla { |
12 | | namespace dom { |
13 | | |
14 | | already_AddRefed<ClientOpPromise> |
15 | | ClientOpenWindowOpChild::DoOpenWindow(const ClientOpenWindowArgs& aArgs) |
16 | 0 | { |
17 | 0 | RefPtr<ClientOpPromise> ref = |
18 | 0 | ClientOpenWindowInCurrentProcess(aArgs); |
19 | 0 | return ref.forget(); |
20 | 0 | } |
21 | | |
22 | | void |
23 | | ClientOpenWindowOpChild::ActorDestroy(ActorDestroyReason aReason) |
24 | 0 | { |
25 | 0 | mPromiseRequestHolder.DisconnectIfExists(); |
26 | 0 | } |
27 | | |
28 | | void |
29 | | ClientOpenWindowOpChild::Init(const ClientOpenWindowArgs& aArgs) |
30 | 0 | { |
31 | 0 | RefPtr<ClientOpPromise> promise = DoOpenWindow(aArgs); |
32 | 0 | promise->Then(SystemGroup::EventTargetFor(TaskCategory::Other), __func__, |
33 | 0 | [this] (const ClientOpResult& aResult) { |
34 | 0 | mPromiseRequestHolder.Complete(); |
35 | 0 | PClientOpenWindowOpChild::Send__delete__(this, aResult); |
36 | 0 | }, [this] (nsresult aResult) { |
37 | 0 | mPromiseRequestHolder.Complete(); |
38 | 0 | PClientOpenWindowOpChild::Send__delete__(this, aResult); |
39 | 0 | })->Track(mPromiseRequestHolder); |
40 | 0 | } |
41 | | |
42 | | } // namespace dom |
43 | | } // namespace mozilla |