| Index: third_party/WebKit/Source/core/clipboard/ClipboardAsync.h
|
| diff --git a/third_party/WebKit/Source/core/clipboard/ClipboardAsync.h b/third_party/WebKit/Source/core/clipboard/ClipboardAsync.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..98b8990a6cdeda07086e988079e728847ca42ff4
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Source/core/clipboard/ClipboardAsync.h
|
| @@ -0,0 +1,57 @@
|
| +// Copyright 2017 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.
|
| +
|
| +#ifndef ClipboardAsync_h
|
| +#define ClipboardAsync_h
|
| +
|
| +#include "bindings/core/v8/ScriptPromise.h"
|
| +#include "core/CoreExport.h"
|
| +#include "core/dom/ContextLifecycleObserver.h"
|
| +#include "public/platform/WebClipboard.h"
|
| +
|
| +namespace blink {
|
| +
|
| +class DataTransfer;
|
| +class ScriptPromiseResolver;
|
| +
|
| +class CORE_EXPORT ClipboardAsync final
|
| + : public GarbageCollectedFinalized<ClipboardAsync>,
|
| + public ContextLifecycleObserver {
|
| + USING_GARBAGE_COLLECTED_MIXIN(ClipboardAsync);
|
| +
|
| + public:
|
| + virtual ~ClipboardAsync(){};
|
| +
|
| + static ClipboardAsync* create(ScriptState*);
|
| +
|
| + ScriptPromise scheduleRead();
|
| + ScriptPromise scheduleReadText();
|
| +
|
| + ScriptPromise scheduleWrite(DataTransfer*);
|
| + ScriptPromise scheduleWriteText(const String&);
|
| +
|
| + // ContextLifecycleObserver
|
| + void contextDestroyed(ExecutionContext*) override;
|
| +
|
| + DECLARE_VIRTUAL_TRACE();
|
| +
|
| + private:
|
| + ClipboardAsync(ScriptState*);
|
| +
|
| + WebTaskRunner* getTaskRunner();
|
| +
|
| + void handleRead();
|
| + void handleReadText();
|
| +
|
| + void handleWrite(DataTransfer*);
|
| + void handleWriteText(const String&);
|
| +
|
| + Member<ScriptPromiseResolver> m_scriptPromiseResolver;
|
| +
|
| + WebClipboard::Buffer m_buffer;
|
| +};
|
| +
|
| +} // namespace blink
|
| +
|
| +#endif // ClipboardAsync_h
|
|
|