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

Side by Side Diff: mojo/edk/js/drain_data.h

Issue 1676913002: [mojo] Delete third_party/mojo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: let's try that again Created 4 years, 10 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 | « mojo/edk/js/core.cc ('k') | mojo/edk/js/drain_data.cc » ('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 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 MOJO_EDK_JS_DRAIN_DATA_H_ 5 #ifndef MOJO_EDK_JS_DRAIN_DATA_H_
6 #define MOJO_EDK_JS_DRAIN_DATA_H_ 6 #define MOJO_EDK_JS_DRAIN_DATA_H_
7 7
8 #include "base/memory/scoped_vector.h" 8 #include "base/memory/scoped_vector.h"
9 #include "gin/runner.h" 9 #include "gin/runner.h"
10 #include "mojo/public/c/environment/async_waiter.h" 10 #include "mojo/public/c/environment/async_waiter.h"
11 #include "mojo/public/cpp/system/core.h" 11 #include "mojo/public/cpp/system/core.h"
12 #include "v8/include/v8.h" 12 #include "v8/include/v8.h"
13 13
14 namespace mojo { 14 namespace mojo {
15 namespace edk { 15 namespace edk {
16 namespace js {
16 17
17 // This class is the implementation of the Mojo JavaScript core module's 18 // This class is the implementation of the Mojo JavaScript core module's
18 // drainData() method. It is not intended to be used directly. The caller 19 // drainData() method. It is not intended to be used directly. The caller
19 // allocates a DrainData on the heap and returns GetPromise() to JS. The 20 // allocates a DrainData on the heap and returns GetPromise() to JS. The
20 // implementation deletes itself after reading as much data as possible 21 // implementation deletes itself after reading as much data as possible
21 // and rejecting or resolving the Promise. 22 // and rejecting or resolving the Promise.
22 23
23 class DrainData { 24 class DrainData {
24 public: 25 public:
25 // Starts waiting for data on the specified data pipe consumer handle. 26 // Starts waiting for data on the specified data pipe consumer handle.
(...skipping 25 matching lines...) Expand all
51 using DataBuffer = std::vector<char>; 52 using DataBuffer = std::vector<char>;
52 53
53 v8::Isolate* isolate_; 54 v8::Isolate* isolate_;
54 ScopedDataPipeConsumerHandle handle_; 55 ScopedDataPipeConsumerHandle handle_;
55 MojoAsyncWaitID wait_id_; 56 MojoAsyncWaitID wait_id_;
56 base::WeakPtr<gin::Runner> runner_; 57 base::WeakPtr<gin::Runner> runner_;
57 v8::UniquePersistent<v8::Promise::Resolver> resolver_; 58 v8::UniquePersistent<v8::Promise::Resolver> resolver_;
58 ScopedVector<DataBuffer> data_buffers_; 59 ScopedVector<DataBuffer> data_buffers_;
59 }; 60 };
60 61
62 } // namespace js
61 } // namespace edk 63 } // namespace edk
62 } // namespace mojo 64 } // namespace mojo
63 65
64 #endif // MOJO_EDK_JS_DRAIN_DATA_H_ 66 #endif // MOJO_EDK_JS_DRAIN_DATA_H_
OLDNEW
« no previous file with comments | « mojo/edk/js/core.cc ('k') | mojo/edk/js/drain_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698