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

Side by Side Diff: gin/converter.cc

Issue 62333018: Implement Asynchronous Module Definition API for Mojo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moar testing Created 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "gin/converter.h" 5 #include "gin/converter.h"
6 6
7 #include "v8/include/v8.h" 7 #include "v8/include/v8.h"
8 8
9 using v8::Boolean; 9 using v8::Boolean;
10 using v8::Function; 10 using v8::Function;
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 } 117 }
118 118
119 bool Converter<Handle<Object> >::FromV8(Handle<Value> val, 119 bool Converter<Handle<Object> >::FromV8(Handle<Value> val,
120 Handle<Object>* out) { 120 Handle<Object>* out) {
121 if (!val->IsObject()) 121 if (!val->IsObject())
122 return false; 122 return false;
123 *out = Handle<Object>::Cast(val); 123 *out = Handle<Object>::Cast(val);
124 return true; 124 return true;
125 } 125 }
126 126
127 Handle<Value> Converter<Handle<Value> >::ToV8(v8::Isolate* isolate,
128 Handle<Value> val) {
129 return val;
130 }
131
132 bool Converter<Handle<Value> >::FromV8(Handle<Value> val,
133 Handle<Value>* out) {
134 *out = val;
135 return true;
136 }
137
127 v8::Handle<v8::String> StringToSymbol(v8::Isolate* isolate, 138 v8::Handle<v8::String> StringToSymbol(v8::Isolate* isolate,
128 const std::string& val) { 139 const std::string& val) {
129 return String::NewFromUtf8(isolate, 140 return String::NewFromUtf8(isolate,
130 val.data(), 141 val.data(),
131 String::kInternalizedString, 142 String::kInternalizedString,
132 static_cast<uint32_t>(val.length())); 143 static_cast<uint32_t>(val.length()));
133 } 144 }
134 145
135 146
136 } // namespace gin 147 } // namespace gin
OLDNEW
« no previous file with comments | « gin/converter.h ('k') | gin/gin.gyp » ('j') | gin/modules/module_registry.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698