summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/modules/payments/goods/digital_goods_service.cc
blob: 03dbd69a6508bf09c25ec4ad53bf6c0d8c4fe5cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "third_party/blink/renderer/modules/payments/goods/digital_goods_service.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h"

namespace blink {

DigitalGoodsService::DigitalGoodsService(ExecutionContext* context) {}

DigitalGoodsService::~DigitalGoodsService() = default;

ScriptPromise DigitalGoodsService::getDetails(ScriptState* script_state,
                                              const Vector<String>& item_ids) {
  auto* resolver = MakeGarbageCollected<ScriptPromiseResolver>(script_state);
  ScriptPromise promise = resolver->Promise();

  // TODO(crbug.com/1061503): This should call out to a mojo service. However,
  // we can't land the mojo service until a browser side implementation is
  // available (for security review). Until then, use this stub which never
  // resolves.

  return promise;
}

ScriptPromise DigitalGoodsService::acknowledge(ScriptState* script_state,
                                               const String& purchase_token,
                                               const String& purchase_type) {
  auto* resolver = MakeGarbageCollected<ScriptPromiseResolver>(script_state);
  ScriptPromise promise = resolver->Promise();

  // TODO(crbug.com/1061503): This should call out to a mojo service. However,
  // we can't land the mojo service until a browser side implementation is
  // available (for security review). Until then, use this stub which never
  // resolves.

  return promise;
}

void DigitalGoodsService::Trace(Visitor* visitor) const {
  ScriptWrappable::Trace(visitor);
}

}  // namespace blink