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

Side by Side Diff: sky/engine/platform/fetcher/DrainDataPipeJob.h

Issue 650903006: Factor DrainDataPipeJob out of MojoLoader (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 | « sky/engine/platform/DEPS ('k') | sky/engine/platform/fetcher/DrainDataPipeJob.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 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 SKY_ENGINE_PLATFORM_FETCHER_DRAIN_DATA_PIPE_JOB_H_
6 #define SKY_ENGINE_PLATFORM_FETCHER_DRAIN_DATA_PIPE_JOB_H_
7
8 #include "base/memory/weak_ptr.h"
9 #include "mojo/common/handle_watcher.h"
10 #include "mojo/public/cpp/system/core.h"
11
12 namespace blink {
13
14 class DrainDataPipeJob {
eseidel 2014/10/24 19:00:42 DataPipeDrainer? I have trouble with this name.
15 public:
16 class Client {
17 public:
18 virtual void OnDataAvailable(const void* data, size_t num_bytes) = 0;
19 virtual void OnDataComplete() = 0;
20
21 protected:
22 virtual ~Client() { }
23 };
24
25 DrainDataPipeJob(Client*, mojo::ScopedDataPipeConsumerHandle source);
26 ~DrainDataPipeJob();
27
28 private:
29 void ReadData();
30 void WaitForData();
31 void WaitComplete(MojoResult result);
32
33 Client* client_;
34 mojo::ScopedDataPipeConsumerHandle source_;
35 mojo::common::HandleWatcher handle_watcher_;
36
37 base::WeakPtrFactory<DrainDataPipeJob> weak_factory_;
38
39 DISALLOW_COPY_AND_ASSIGN(DrainDataPipeJob);
40 };
41
42 } // namespace blink
43
44 #endif // SKY_ENGINE_PLATFORM_FETCHER_DRAIN_DATA_PIPE_JOB_H_
OLDNEW
« no previous file with comments | « sky/engine/platform/DEPS ('k') | sky/engine/platform/fetcher/DrainDataPipeJob.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698