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

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

Issue 1176243004: Add FetchDataConsumerHandle and utility functions/classes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Build break fix. 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
« no previous file with comments | « no previous file | Source/modules/fetch/CompositeDataConsumerHandle.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CompositeDataConsumerHandle_h 5 #ifndef CompositeDataConsumerHandle_h
6 #define CompositeDataConsumerHandle_h 6 #define CompositeDataConsumerHandle_h
7 7
8 #include "public/platform/WebDataConsumerHandle.h" 8 #include "public/platform/WebDataConsumerHandle.h"
9 #include "wtf/OwnPtr.h" 9 #include "wtf/OwnPtr.h"
10 #include "wtf/PassOwnPtr.h" 10 #include "wtf/PassOwnPtr.h"
(...skipping 11 matching lines...) Expand all
22 { 22 {
23 ASSERT(handle); 23 ASSERT(handle);
24 return adoptPtr(new CompositeDataConsumerHandle(handle)); 24 return adoptPtr(new CompositeDataConsumerHandle(handle));
25 } 25 }
26 ~CompositeDataConsumerHandle() override; 26 ~CompositeDataConsumerHandle() override;
27 27
28 // This function should be called on the thread on which this object 28 // This function should be called on the thread on which this object
29 // was created. |handle| must not be null and must not be locked. 29 // was created. |handle| must not be null and must not be locked.
30 void update(PassOwnPtr<WebDataConsumerHandle> /* handle */); 30 void update(PassOwnPtr<WebDataConsumerHandle> /* handle */);
31 31
32 // Utility static methods each of which provides a "basic block" of
33 // a CompositeDataConsumerHandle. For example, a user can create
34 // a CompositeDataConsumerHandle with a "waiting" handle to provide
35 // WebDataConsumerHandle APIs while waiting for another handle. When that
36 // handle arrives, the user will use |update| to replace the "waiting"
37 // handle with the arrived one.
38 //
39 // Returns a handle that returns ShouldWait for read / beginRead and
40 // UnexpectedError for endRead.
41 static PassOwnPtr<WebDataConsumerHandle> createWaitingHandle();
42
43 // Returns a handle that returns Done for read / beginRead and
44 // UnexpectedError for endRead.
45 static PassOwnPtr<WebDataConsumerHandle> createDoneHandle();
46
47 private: 32 private:
48 class Context; 33 class Context;
49 class ReaderImpl; 34 class ReaderImpl;
50 Reader* obtainReaderInternal(Client*) override; 35 Reader* obtainReaderInternal(Client*) override;
51 36
52 explicit CompositeDataConsumerHandle(PassOwnPtr<WebDataConsumerHandle>); 37 explicit CompositeDataConsumerHandle(PassOwnPtr<WebDataConsumerHandle>);
53 38
54 RefPtr<Context> m_context; 39 RefPtr<Context> m_context;
55 }; 40 };
56 41
57 } // namespace blink 42 } // namespace blink
58 43
59 #endif // CompositeDataConsumerHandle_h 44 #endif // CompositeDataConsumerHandle_h
OLDNEW
« no previous file with comments | « no previous file | Source/modules/fetch/CompositeDataConsumerHandle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698