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

Side by Side Diff: mojo/bindings/js/core.cc

Issue 324783002: Mojo: Add a MojoCreateMessagePipeOptions struct parameter to MojoCreateMessagePipe. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « mojo/android/system/core_impl.cc ('k') | mojo/embedder/embedder_unittest.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 #include "mojo/bindings/js/core.h" 5 #include "mojo/bindings/js/core.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "gin/arguments.h" 9 #include "gin/arguments.h"
10 #include "gin/array_buffer.h" 10 #include "gin/array_buffer.h"
(...skipping 28 matching lines...) Expand all
39 MojoResult WaitMany( 39 MojoResult WaitMany(
40 const std::vector<mojo::Handle>& handles, 40 const std::vector<mojo::Handle>& handles,
41 const std::vector<MojoWaitFlags>& flags, 41 const std::vector<MojoWaitFlags>& flags,
42 MojoDeadline deadline) { 42 MojoDeadline deadline) {
43 return mojo::WaitMany(handles, flags, deadline); 43 return mojo::WaitMany(handles, flags, deadline);
44 } 44 }
45 45
46 gin::Dictionary CreateMessagePipe(const gin::Arguments& args) { 46 gin::Dictionary CreateMessagePipe(const gin::Arguments& args) {
47 MojoHandle handle0 = MOJO_HANDLE_INVALID; 47 MojoHandle handle0 = MOJO_HANDLE_INVALID;
48 MojoHandle handle1 = MOJO_HANDLE_INVALID; 48 MojoHandle handle1 = MOJO_HANDLE_INVALID;
49 MojoResult result = MojoCreateMessagePipe(&handle0, &handle1); 49 // TODO(vtl): Add support for the options struct.
50 MojoResult result = MojoCreateMessagePipe(NULL, &handle0, &handle1);
50 CHECK(result == MOJO_RESULT_OK); 51 CHECK(result == MOJO_RESULT_OK);
51 52
52 gin::Dictionary dictionary = gin::Dictionary::CreateEmpty(args.isolate()); 53 gin::Dictionary dictionary = gin::Dictionary::CreateEmpty(args.isolate());
53 dictionary.Set("handle0", mojo::Handle(handle0)); 54 dictionary.Set("handle0", mojo::Handle(handle0));
54 dictionary.Set("handle1", mojo::Handle(handle1)); 55 dictionary.Set("handle1", mojo::Handle(handle1));
55 return dictionary; 56 return dictionary;
56 } 57 }
57 58
58 MojoResult WriteMessage( 59 MojoResult WriteMessage(
59 mojo::Handle handle, 60 mojo::Handle handle,
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 .Build(); 270 .Build();
270 271
271 data->SetObjectTemplate(&g_wrapper_info, templ); 272 data->SetObjectTemplate(&g_wrapper_info, templ);
272 } 273 }
273 274
274 return templ->NewInstance(); 275 return templ->NewInstance();
275 } 276 }
276 277
277 } // namespace js 278 } // namespace js
278 } // namespace mojo 279 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/android/system/core_impl.cc ('k') | mojo/embedder/embedder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698