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

Side by Side Diff: third_party/WebKit/Source/modules/fetch/BytesConsumer.h

Issue 2229313002: Make FetchDataLoader accept BytesConsumer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove-c++-rs
Patch Set: fix Created 4 years, 4 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 BytesConsumer_h 5 #ifndef BytesConsumer_h
6 #define BytesConsumer_h 6 #define BytesConsumer_h
7 7
8 #include "modules/ModulesExport.h" 8 #include "modules/ModulesExport.h"
9 #include "platform/blob/BlobData.h" 9 #include "platform/blob/BlobData.h"
10 #include "platform/heap/Handle.h" 10 #include "platform/heap/Handle.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 private: 51 private:
52 String m_message; 52 String m_message;
53 }; 53 };
54 // Client gets notification from the associated ByteConsumer. 54 // Client gets notification from the associated ByteConsumer.
55 class MODULES_EXPORT Client : public GarbageCollectedMixin { 55 class MODULES_EXPORT Client : public GarbageCollectedMixin {
56 public: 56 public:
57 virtual ~Client() {} 57 virtual ~Client() {}
58 58
59 // This function is called when the state changes. This function can 59 // This function is called when the state changes. This function can
60 // be called more than needed, i.e., it can be called even when the 60 // be called more than needed, i.e., it can be called even when the
61 // state is not actually changed. 61 // state is not actually changed, but it is guaranteed that this
62 // function cannot be called when the state is closed or errored before
hiroshige 2016/08/15 07:09:57 nit: how about "... but it is guaranteed that this
yhirano 2016/08/16 09:02:21 Done.
63 // this function is called.
62 // 64 //
63 // This function is not called when the state change is trigerred by 65 // This function is not called when the state change is trigerred by
64 // public methods called by a user. For example, when a user reads 66 // public methods called by a user. For example, when a user reads
65 // data by |read| and the state changes from waiting to readable, this 67 // data by |read| and the state changes from waiting to readable, this
66 // function will not be called. 68 // function will not be called.
67 virtual void onStateChange() = 0; 69 virtual void onStateChange() = 0;
68 }; 70 };
69 71
70 virtual ~BytesConsumer() {} 72 virtual ~BytesConsumer() {}
71 73
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 return PublicState::Errored; 163 return PublicState::Errored;
162 } 164 }
163 NOTREACHED(); 165 NOTREACHED();
164 return PublicState::ReadableOrWaiting; 166 return PublicState::ReadableOrWaiting;
165 } 167 }
166 }; 168 };
167 169
168 } // namespace blink 170 } // namespace blink
169 171
170 #endif // BytesConsumer_h 172 #endif // BytesConsumer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698