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

Side by Side Diff: Source/modules/fetch/DataConsumerHandleUtil.h

Issue 1176243004: Add FetchDataConsumerHandle and utility functions/classes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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 2015 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 DataConsumerHandleUtil_h
6 #define DataConsumerHandleUtil_h
7
8 #include "modules/fetch/FetchDataConsumerHandle.h"
9 #include "public/platform/WebDataConsumerHandle.h"
10 #include "wtf/PassOwnPtr.h"
11 #include "wtf/WeakPtr.h"
12
13 namespace blink {
14
15 // Returns a handle that returns ShouldWait for read / beginRead and
16 // UnexpectedError for endRead.
17 PassOwnPtr<WebDataConsumerHandle> createWaitingHandle();
yhirano 2015/06/17 04:13:34 I'm afraid blink::createWaitingHandle and others a
hiroshige 2015/06/17 08:30:23 Made names longer.
18
19 // Returns a handle that returns Done for read / beginRead and
20 // UnexpectedError for endRead.
21 PassOwnPtr<WebDataConsumerHandle> createDoneHandle();
22
23 // Returns a handle that returns UnexpectedError for read / beginRead /
24 // endRead.
25 PassOwnPtr<WebDataConsumerHandle> createUnexpectedErrorHandle();
26
27 // Returns a FetchDataConsumerHandle that wraps WebDataConsumerHandle.
28 PassOwnPtr<FetchDataConsumerHandle> createFetchHandleFromWebHandle(PassOwnPtr<We bDataConsumerHandle>);
29
30 // A helper class to call Client::didGetReadable() asynchronously after
31 // Reader creation.
32 class NotifyOnReaderCreationHelper {
yhirano 2015/06/17 04:13:34 Do you want to expose this class? Is it a problem
yhirano 2015/06/17 04:13:34 +final
hiroshige 2015/06/17 08:30:23 Done.
hiroshige 2015/06/17 08:30:23 I'd like to use this in FetchBlobConsumerHandle an
33 public:
34 NotifyOnReaderCreationHelper(WebDataConsumerHandle::Client*);
35
36 private:
37 void notify(WebDataConsumerHandle::Client*);
38
39 WeakPtrFactory<NotifyOnReaderCreationHelper> m_factory;
40 };
41
42 } // namespace blink
43
44 #endif // DataConsumerHandleUtil_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698