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

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: Patch for landing 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 | « Source/bindings/core/v8/ScriptValue.h ('k') | Source/bindings/core/v8/ToV8Test.cpp » ('j') | no next file with comments »
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..71995e97161999014aa32c7d9dc17f10b375ee53 100644
--- a/Source/bindings/core/v8/ToV8.h
+++ b/Source/bindings/core/v8/ToV8.h
@@ -216,6 +216,15 @@ inline v8::Handle<v8::Value> toV8(const HeapVector<T, inlineCapacity>& value, v8
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)
+{
+ v8::Local<v8::Object> object = v8::Object::New(isolate);
+ for (unsigned i = 0; i < value.size(); ++i)
+ object->Set(v8String(isolate, value[i].first), toV8(value[i].second, creationContext, isolate));
+ return object;
+}
+
} // namespace blink
#endif // ToV8_h
« no previous file with comments | « Source/bindings/core/v8/ScriptValue.h ('k') | Source/bindings/core/v8/ToV8Test.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698