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

Unified Diff: Source/bindings/core/v8/ToV8.h

Issue 972153002: [bindings] Remove custom binding usage in SQLResultSetRowList. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@test
Patch Set: Addition of new file ToV8.h for modules Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/bindings/core/v8/ToV8Test.cpp » ('j') | Source/bindings/modules/v8/ToV8.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/ToV8.h
diff --git a/Source/bindings/core/v8/ToV8.h b/Source/bindings/core/v8/ToV8.h
index e06dcd323a1ad8eccd8fff17325ed32c64cf9df7..0ef597a650d3517b2c627831fbe3c798f2dcbcaf 100644
--- a/Source/bindings/core/v8/ToV8.h
+++ b/Source/bindings/core/v8/ToV8.h
@@ -210,6 +210,15 @@ inline v8::Handle<v8::Value> toV8(const Vector<T, inlineCapacity>& value, v8::Ha
return toV8SequenceInternal(value, creationContext, isolate);
}
+template<typename T>
+inline v8::Handle<v8::Value> toV8(const Vector<std::pair<String, T>>& value, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
Yuki 2015/03/04 14:11:04 Since both of toV8(Vector<T>) and toV8(HeapVector<
+{
+ v8::Local<v8::Object> object = v8::Object::New(isolate);
+ for (unsigned i = 0; i < value.size(); ++i)
+ object->Set(v8String(isolate, value[i].first), value[i].second);
Jens Widell 2015/03/04 13:53:52 By passing value[i].second directly to v8::Object:
vivekg 2015/03/04 13:57:19 Thanks Jens, I did the same thing initially. Thou
Jens Widell 2015/03/04 14:03:54 It would certainly be wrong to include modules/v8/
Yuki 2015/03/04 14:11:04 Please use toV8(value[i].second, creationContext
+ return object;
+}
+
template<typename T, size_t inlineCapacity>
inline v8::Handle<v8::Value> toV8(const HeapVector<T, inlineCapacity>& value, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
{
« no previous file with comments | « no previous file | Source/bindings/core/v8/ToV8Test.cpp » ('j') | Source/bindings/modules/v8/ToV8.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698