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

Side by Side Diff: sky/engine/core/loader/MojoLoader.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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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 MojoLoader_h 5 #ifndef MojoLoader_h
6 #define MojoLoader_h 6 #define MojoLoader_h
7 7
8 #include "base/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 #include "mojo/common/handle_watcher.h" 9 #include "mojo/common/handle_watcher.h"
10 #include "mojo/public/cpp/system/data_pipe.h" 10 #include "mojo/public/cpp/system/data_pipe.h"
11 #include "platform/fetcher/DrainDataPipeJob.h"
11 #include "platform/weborigin/KURL.h" 12 #include "platform/weborigin/KURL.h"
12 13
13 namespace blink { 14 namespace blink {
14 15
15 class LocalFrame; 16 class LocalFrame;
16 17
17 class MojoLoader { 18 class MojoLoader : public DrainDataPipeJob::Client {
18 public: 19 public:
19 explicit MojoLoader(LocalFrame&); 20 explicit MojoLoader(LocalFrame&);
20 21
21 void load(const KURL&, mojo::ScopedDataPipeConsumerHandle); 22 void load(const KURL&, mojo::ScopedDataPipeConsumerHandle);
22 23
23 private: 24 private:
24 LocalFrame& m_frame; 25 LocalFrame& m_frame;
25 26
26 // FIXME: These belong on a helper object for async reading from mojo pipes. 27 // From DrainDataPipeJob::Client
27 void readMore(); 28 void OnDataAvailable(const void* data, size_t numberOfBytes) override;
28 void waitToReadMore(); 29 void OnDataComplete() override;
29 void moreDataReady(MojoResult);
30 30
31 mojo::common::HandleWatcher m_handleWatcher; 31 OwnPtr<DrainDataPipeJob> m_drainJob;
32 mojo::ScopedDataPipeConsumerHandle m_responseStream;
33 base::WeakPtrFactory<MojoLoader> m_weakFactory;
34 }; 32 };
35 33
36 } 34 }
37 35
38 #endif 36 #endif
OLDNEW
« no previous file with comments | « no previous file | sky/engine/core/loader/MojoLoader.cpp » ('j') | sky/engine/platform/fetcher/DrainDataPipeJob.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698