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

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

Issue 1350023003: Add a Mojo EDK for Chrome that uses one OS pipe per message pipe. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move to mojo::edk namespace in preparation for runtim flag Created 5 years, 3 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 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 #include "mojo/edk/js/drain_data.h" 5 #include "mojo/edk/js/drain_data.h"
6 6
7 #include "gin/array_buffer.h" 7 #include "gin/array_buffer.h"
8 #include "gin/converter.h" 8 #include "gin/converter.h"
9 #include "gin/dictionary.h" 9 #include "gin/dictionary.h"
10 #include "gin/per_context_data.h" 10 #include "gin/per_context_data.h"
11 #include "gin/per_isolate_data.h" 11 #include "gin/per_isolate_data.h"
12 #include "mojo/public/cpp/environment/environment.h" 12 #include "mojo/public/cpp/environment/environment.h"
13 #include "mojo/public/cpp/system/core.h" 13 #include "mojo/public/cpp/system/core.h"
14 14
15 namespace mojo { 15 namespace mojo {
16 namespace js { 16 namespace edk {
17 17
18 DrainData::DrainData(v8::Isolate* isolate, mojo::Handle handle) 18 DrainData::DrainData(v8::Isolate* isolate, mojo::Handle handle)
19 : isolate_(isolate), 19 : isolate_(isolate),
20 handle_(DataPipeConsumerHandle(handle.value())), 20 handle_(DataPipeConsumerHandle(handle.value())),
21 wait_id_(0) { 21 wait_id_(0) {
22 22
23 v8::Handle<v8::Context> context(isolate_->GetCurrentContext()); 23 v8::Handle<v8::Context> context(isolate_->GetCurrentContext());
24 runner_ = gin::PerContextData::From(context)->runner()->GetWeakPtr(); 24 runner_ = gin::PerContextData::From(context)->runner()->GetWeakPtr();
25 25
26 WaitForData(); 26 WaitForData();
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 v8::Handle<v8::Value> settled_value(ConvertToV8(isolate_, dictionary)); 120 v8::Handle<v8::Value> settled_value(ConvertToV8(isolate_, dictionary));
121 121
122 if (result == MOJO_RESULT_FAILED_PRECONDITION) 122 if (result == MOJO_RESULT_FAILED_PRECONDITION)
123 resolver->Resolve(settled_value); 123 resolver->Resolve(settled_value);
124 else 124 else
125 resolver->Reject(settled_value); 125 resolver->Reject(settled_value);
126 126
127 delete this; 127 delete this;
128 } 128 }
129 129
130 } // namespace js 130 } // namespace edk
131 } // namespace mojo 131 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698