Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(194)

Side by Side Diff: third_party/WebKit/Source/core/clipboard/ClipboardAsync.h

Issue 2695593006: Initial stub version of Async Clipboard API (Closed)
Patch Set: Add WPTs; Update naming conventions; Review comments Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef ClipboardAsync_h
6 #define ClipboardAsync_h
7
8 #include "bindings/core/v8/ScriptPromise.h"
9 #include "core/CoreExport.h"
10 #include "core/dom/ContextLifecycleObserver.h"
11 #include "public/platform/WebClipboard.h"
12
13 namespace blink {
14
15 class DataTransfer;
16 class ScriptPromiseResolver;
17
18 class CORE_EXPORT ClipboardAsync final
dcheng 2017/05/13 22:18:32 My main question about this is stylistic: this see
garykac 2017/05/17 23:51:14 Re: The name. That's a good point that I hadn't co
19 : public GarbageCollectedFinalized<ClipboardAsync>,
20 public ContextLifecycleObserver {
21 USING_GARBAGE_COLLECTED_MIXIN(ClipboardAsync);
22 WTF_MAKE_NONCOPYABLE(ClipboardAsync);
23
24 public:
25 virtual ~ClipboardAsync(){};
26
27 static ClipboardAsync* create(ScriptState*);
dcheng 2017/05/13 22:18:32 Nit: to follow the updated style guide, these shou
garykac 2017/05/17 23:51:14 Done.
28
29 ScriptPromise scheduleRead();
30 ScriptPromise scheduleReadText();
31
32 ScriptPromise scheduleWrite(DataTransfer*);
33 ScriptPromise scheduleWriteText(const String&);
34
35 // ContextLifecycleObserver
36 void ContextDestroyed(ExecutionContext*) override;
37
38 DECLARE_VIRTUAL_TRACE();
39
40 private:
41 ClipboardAsync(ScriptState*);
42
43 WebTaskRunner* getTaskRunner();
44
45 void handleRead();
46 void handleReadText();
47
48 void handleWrite(DataTransfer*);
49 void handleWriteText(const String&);
50
51 Member<ScriptPromiseResolver> m_scriptPromiseResolver;
52
53 WebClipboard::Buffer m_buffer;
dcheng 2017/05/13 22:18:32 Similarly, this should be buffer_
garykac 2017/05/17 23:51:14 Done.
54 };
55
56 } // namespace blink
57
58 #endif // ClipboardAsync_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698