Bug 1472338: part 2) Change `clipboard.readText()` to read from the clipboard asynchr...
[gecko.git] / dom / fs / FileSystemHandle.cpp
bloba63aff258e0cecb497c39ff1306a7eec098f5037
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/. */
7 #include "FileSystemHandle.h"
9 #include "mozilla/ErrorResult.h"
10 #include "mozilla/dom/FileSystemHandleBinding.h"
11 #include "mozilla/dom/Promise.h"
13 namespace mozilla::dom {
15 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(FileSystemHandle)
16 NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
17 NS_INTERFACE_MAP_ENTRY(nsISupports)
18 NS_INTERFACE_MAP_END
19 NS_IMPL_CYCLE_COLLECTING_ADDREF(FileSystemHandle);
20 NS_IMPL_CYCLE_COLLECTING_RELEASE(FileSystemHandle);
21 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(FileSystemHandle, mGlobal);
23 // WebIDL Boilerplate
25 nsIGlobalObject* FileSystemHandle::GetParentObject() const { return mGlobal; }
27 JSObject* FileSystemHandle::WrapObject(JSContext* aCx,
28 JS::Handle<JSObject*> aGivenProto) {
29 return FileSystemHandle_Binding::Wrap(aCx, this, aGivenProto);
32 // WebIDL Interface
34 void FileSystemHandle::GetName(DOMString& aResult) { aResult.SetNull(); }
36 already_AddRefed<Promise> FileSystemHandle::IsSameEntry(
37 FileSystemHandle& aOther) {
38 IgnoredErrorResult rv;
40 RefPtr<Promise> promise = Promise::Create(GetParentObject(), rv);
41 if (rv.Failed()) {
42 return nullptr;
45 promise->MaybeReject(NS_ERROR_NOT_IMPLEMENTED);
47 return promise.forget();
50 } // namespace mozilla::dom