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

Side by Side Diff: Source/modules/fetch/FetchDataConsumerHandle.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 FetchDataConsumerHandle_h
6 #define FetchDataConsumerHandle_h
7
8 #include "public/platform/WebDataConsumerHandle.h"
9 #include "wtf/Forward.h"
10 #include "wtf/PassRefPtr.h"
11
12 namespace blink {
13
14 class BlobDataHandle;
15
16 // This is an interface class that adds Reader's blobDataHandle() to
17 // WebDataConsumerHandle.
18 // This class works not very well with Oilpan: As this class is not garbage
19 // collected while many clients or related objects may be, it is very easy
20 // to create a reference cycle. When an client is garbage collected, making
21 // the client own the handle is the right way.
22 class FetchDataConsumerHandle : public WebDataConsumerHandle {
23 public:
24 class Reader : public WebDataConsumerHandle::Reader {
25 public:
26 // Returns a blob handle representing the body data. This function can
27 // returns null when the object doesn't have such a handle. Calling
28 // this function drains the body data.
29 // This function is defined for performance. If this function returns a
30 // non-null handle, the bytes that will be read from the handle must be
31 // idential to the bytes that will be read
32 // throughWebDataConsumerHandle APIs without calling this function.
yhirano 2015/06/17 04:13:34 space after "through"
hiroshige 2015/06/17 08:30:23 Done.
33 virtual PassRefPtr<BlobDataHandle> blobDataHandle() = 0;
yhirano 2015/06/17 04:13:35 As this function is not a getter, a name that does
hiroshige 2015/06/17 08:30:23 Hmm. Do you have suggestions for the name? (|obtai
yhirano 2015/06/17 09:10:16 take / obtain / acquire?
hiroshige 2015/06/17 09:25:26 Done in Patch Set 9.
34 };
35 PassOwnPtr<Reader> obtainReader(Client* client) { return adoptPtr(obtainRead erInternal(client)); }
yhirano 2015/06/17 04:13:35 Please say that obtainReader is non-virtual overri
hiroshige 2015/06/17 08:30:23 Done.
36
37 private:
38 Reader* obtainReaderInternal(Client*) override = 0;
39 };
40
41 } // namespace blink
42
43 #endif // FetchDataConsumerHandle_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698