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

Side by Side Diff: Source/bindings/core/v8/ToV8.h

Issue 1118653002: Componentization: add toV8(void*,...) to check function overload mismatch. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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
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 #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
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
OLDNEW
« no previous file with comments | « no previous file | Source/modules/background_sync/SyncCallbacks.h » ('j') | Source/modules/background_sync/SyncCallbacks.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698