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

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

Issue 278093003: Break dependency on core from generated mojom.js files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Specialize Converter<gin::Handle<gin::HandleWrapper> > Created 6 years, 7 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/apps/js/bindings/connection_unittests.js ('k') | mojo/bindings/js/handle.h » ('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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 .SetMethod("close", CloseHandle) 213 .SetMethod("close", CloseHandle)
214 .SetMethod("wait", WaitHandle) 214 .SetMethod("wait", WaitHandle)
215 .SetMethod("waitMany", WaitMany) 215 .SetMethod("waitMany", WaitMany)
216 .SetMethod("createMessagePipe", CreateMessagePipe) 216 .SetMethod("createMessagePipe", CreateMessagePipe)
217 .SetMethod("writeMessage", WriteMessage) 217 .SetMethod("writeMessage", WriteMessage)
218 .SetMethod("readMessage", ReadMessage) 218 .SetMethod("readMessage", ReadMessage)
219 .SetMethod("createDataPipe", CreateDataPipe) 219 .SetMethod("createDataPipe", CreateDataPipe)
220 .SetMethod("writeData", WriteData) 220 .SetMethod("writeData", WriteData)
221 .SetMethod("readData", ReadData) 221 .SetMethod("readData", ReadData)
222 222
223 // TODO(vtl): Change name of "kInvalidHandle", now that there's no such
224 // C++ constant?
225 .SetValue("kInvalidHandle", mojo::Handle())
226
227 .SetValue("RESULT_OK", MOJO_RESULT_OK) 223 .SetValue("RESULT_OK", MOJO_RESULT_OK)
228 .SetValue("RESULT_CANCELLED", MOJO_RESULT_CANCELLED) 224 .SetValue("RESULT_CANCELLED", MOJO_RESULT_CANCELLED)
229 .SetValue("RESULT_UNKNOWN", MOJO_RESULT_UNKNOWN) 225 .SetValue("RESULT_UNKNOWN", MOJO_RESULT_UNKNOWN)
230 .SetValue("RESULT_INVALID_ARGUMENT", MOJO_RESULT_INVALID_ARGUMENT) 226 .SetValue("RESULT_INVALID_ARGUMENT", MOJO_RESULT_INVALID_ARGUMENT)
231 .SetValue("RESULT_DEADLINE_EXCEEDED", MOJO_RESULT_DEADLINE_EXCEEDED) 227 .SetValue("RESULT_DEADLINE_EXCEEDED", MOJO_RESULT_DEADLINE_EXCEEDED)
232 .SetValue("RESULT_NOT_FOUND", MOJO_RESULT_NOT_FOUND) 228 .SetValue("RESULT_NOT_FOUND", MOJO_RESULT_NOT_FOUND)
233 .SetValue("RESULT_ALREADY_EXISTS", MOJO_RESULT_ALREADY_EXISTS) 229 .SetValue("RESULT_ALREADY_EXISTS", MOJO_RESULT_ALREADY_EXISTS)
234 .SetValue("RESULT_PERMISSION_DENIED", MOJO_RESULT_PERMISSION_DENIED) 230 .SetValue("RESULT_PERMISSION_DENIED", MOJO_RESULT_PERMISSION_DENIED)
235 .SetValue("RESULT_RESOURCE_EXHAUSTED", MOJO_RESULT_RESOURCE_EXHAUSTED) 231 .SetValue("RESULT_RESOURCE_EXHAUSTED", MOJO_RESULT_RESOURCE_EXHAUSTED)
236 .SetValue("RESULT_FAILED_PRECONDITION", MOJO_RESULT_FAILED_PRECONDITION) 232 .SetValue("RESULT_FAILED_PRECONDITION", MOJO_RESULT_FAILED_PRECONDITION)
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 .Build(); 269 .Build();
274 270
275 data->SetObjectTemplate(&g_wrapper_info, templ); 271 data->SetObjectTemplate(&g_wrapper_info, templ);
276 } 272 }
277 273
278 return templ->NewInstance(); 274 return templ->NewInstance();
279 } 275 }
280 276
281 } // namespace js 277 } // namespace js
282 } // namespace mojo 278 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/apps/js/bindings/connection_unittests.js ('k') | mojo/bindings/js/handle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698