Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 ToV8_h | 5 #ifndef ToV8_h |
| 6 #define ToV8_h | 6 #define ToV8_h |
| 7 | 7 |
| 8 // toV8() provides C++ -> V8 conversion. Note that toV8() can return an empty | 8 // toV8() provides C++ -> V8 conversion. Note that toV8() can return an empty |
| 9 // handle. Call sites must check IsEmpty() before using return value. | 9 // handle. Call sites must check IsEmpty() before using return value. |
| 10 | 10 |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 230 v8::Local<v8::Object> object = v8::Object::New(isolate); | 230 v8::Local<v8::Object> object = v8::Object::New(isolate); |
| 231 for (unsigned i = 0; i < value.size(); ++i) { | 231 for (unsigned i = 0; i < value.size(); ++i) { |
| 232 v8::Local<v8::Value> v8Value = toV8(value[i].second, creationContext, is olate); | 232 v8::Local<v8::Value> v8Value = toV8(value[i].second, creationContext, is olate); |
| 233 if (v8Value.IsEmpty()) | 233 if (v8Value.IsEmpty()) |
| 234 v8Value = v8::Undefined(isolate); | 234 v8Value = v8::Undefined(isolate); |
| 235 object->Set(v8String(isolate, value[i].first), v8Value); | 235 object->Set(v8String(isolate, value[i].first), v8Value); |
| 236 } | 236 } |
| 237 return object; | 237 return object; |
| 238 } | 238 } |
| 239 | 239 |
| 240 // Only declare toV8(void*,...) for checking function overload mismatch. | |
| 241 // This toV8(void*,...) should be never used. So we will find mismatch | |
| 242 // because of "unresolved external symbol". | |
|
Yuki
2015/05/01 04:26:42
Could you add a following comment?
Without toV8(v
tasak
2015/05/01 05:16:49
Done.
| |
| 243 v8::Handle<v8::Value> toV8(void* value, v8::Handle<v8::Object> creationContext, v8::Isolate*); | |
| 244 | |
| 240 } // namespace blink | 245 } // namespace blink |
| 241 | 246 |
| 242 #endif // ToV8_h | 247 #endif // ToV8_h |
| OLD | NEW |