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

Issue 848673002: Add keys(), values() and entries() methods on iterable<> interfaces (Closed)

Created:
5 years, 11 months ago by Jens Widell
Modified:
5 years, 11 months ago
Reviewers:
haraken, jsbell, yhirano, bashi
CC:
blink-reviews, arv+blink, sof, eae+blinkwatch, blink-reviews-dom_chromium.org, dglazkov+blink, blink-reviews-bindings_chromium.org, rwlbuis
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Add keys(), values() and entries() methods on iterable<> interfaces Change the IDL code generator to add keys(), values() and entries() methods to interfaces with an iterable<> definition. Also add utility (mixin) base-classes for iterable interfaces, ValueIterable<> and PairIterable<>, that take care of most of the work of supporting iterable<> IDL definitions on the C++ side, i.e. implementing keys(), values(), entries() and @@iterator. Finally, update the two interfaces with iterable<> definitions (core/testing/Internals.idl and modules/fetch/Headers.idl) to inherit the new utility base classes. Internals has a "value iterator" and thus inherits ValueIterable<>, while Headers has a "pair iterator" and inherits PairIterable<>. Update existing tests for each to test the new keys(), values() and entries() methods. BUG=432683 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=188364

Patch Set 1 #

Patch Set 2 : #

Total comments: 8

Patch Set 3 : core.gypi + assert_not_equals #

Total comments: 24

Patch Set 4 : address comments #

Total comments: 2

Patch Set 5 : const& #

Total comments: 8

Patch Set 6 : #

Patch Set 7 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+440 lines, -103 lines) Patch
M LayoutTests/fast/js/iterable-object.html View 1 chunk +12 lines, -0 lines 0 comments Download
M LayoutTests/fast/js/iterable-object-expected.txt View 1 chunk +15 lines, -0 lines 0 comments Download
M LayoutTests/http/tests/fetch/script-tests/headers.js View 1 2 4 chunks +37 lines, -10 lines 0 comments Download
M Source/bindings/scripts/v8_interface.py View 4 chunks +47 lines, -28 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestInterface3.cpp View 3 chunks +67 lines, -1 line 0 comments Download
M Source/bindings/tests/results/modules/V8TestInterface5.cpp View 2 chunks +63 lines, -0 lines 0 comments Download
M Source/core/core.gypi View 1 2 1 chunk +1 line, -0 lines 0 comments Download
A Source/core/dom/Iterable.h View 1 2 3 4 5 6 1 chunk +167 lines, -0 lines 0 comments Download
M Source/core/testing/Internals.h View 4 chunks +4 lines, -3 lines 0 comments Download
M Source/core/testing/Internals.cpp View 1 2 3 2 chunks +10 lines, -22 lines 0 comments Download
M Source/modules/fetch/Headers.h View 1 4 chunks +4 lines, -4 lines 0 comments Download
M Source/modules/fetch/Headers.cpp View 1 2 3 4 5 2 chunks +13 lines, -35 lines 0 comments Download

Messages

Total messages: 20 (2 generated)
Jens Widell
PTAL
5 years, 11 months ago (2015-01-12 16:00:25 UTC) #2
jsbell
https://codereview.chromium.org/848673002/diff/20001/LayoutTests/http/tests/fetch/script-tests/headers.js File LayoutTests/http/tests/fetch/script-tests/headers.js (right): https://codereview.chromium.org/848673002/diff/20001/LayoutTests/http/tests/fetch/script-tests/headers.js#newcode103 LayoutTests/http/tests/fetch/script-tests/headers.js:103: assert_true(key != deleteKey.toLowerCase()); I know this is copy/paste but.. ...
5 years, 11 months ago (2015-01-12 17:14:08 UTC) #3
jsbell
otherwise lgtm but I didn't look deeply at the code gen or its output
5 years, 11 months ago (2015-01-12 17:15:17 UTC) #4
Jens Widell
https://codereview.chromium.org/848673002/diff/20001/Source/core/dom/Iterable.h File Source/core/dom/Iterable.h (right): https://codereview.chromium.org/848673002/diff/20001/Source/core/dom/Iterable.h#newcode1 Source/core/dom/Iterable.h:1: // Copyright 2015 The Chromium Authors. All rights reserved. ...
5 years, 11 months ago (2015-01-12 17:24:14 UTC) #5
bashi
https://codereview.chromium.org/848673002/diff/40001/Source/core/dom/Iterable.h File Source/core/dom/Iterable.h (right): https://codereview.chromium.org/848673002/diff/40001/Source/core/dom/Iterable.h#newcode73 Source/core/dom/Iterable.h:73: v8::Local<v8::Object> creationContext = scriptState->context()->Global(); Help me understand: Always passing ...
5 years, 11 months ago (2015-01-12 23:42:46 UTC) #6
yhirano
https://codereview.chromium.org/848673002/diff/40001/Source/core/dom/Iterable.h File Source/core/dom/Iterable.h (right): https://codereview.chromium.org/848673002/diff/40001/Source/core/dom/Iterable.h#newcode48 Source/core/dom/Iterable.h:48: // Otherwise: set |key| and |value| and return true. ...
5 years, 11 months ago (2015-01-13 05:18:42 UTC) #7
Jens Widell
https://codereview.chromium.org/848673002/diff/40001/Source/core/dom/Iterable.h File Source/core/dom/Iterable.h (right): https://codereview.chromium.org/848673002/diff/40001/Source/core/dom/Iterable.h#newcode48 Source/core/dom/Iterable.h:48: // Otherwise: set |key| and |value| and return true. ...
5 years, 11 months ago (2015-01-13 07:50:06 UTC) #8
Jens Widell
https://codereview.chromium.org/848673002/diff/40001/Source/core/dom/Iterable.h File Source/core/dom/Iterable.h (right): https://codereview.chromium.org/848673002/diff/40001/Source/core/dom/Iterable.h#newcode73 Source/core/dom/Iterable.h:73: v8::Local<v8::Object> creationContext = scriptState->context()->Global(); On 2015/01/12 23:42:46, bashi1 wrote: ...
5 years, 11 months ago (2015-01-13 07:54:36 UTC) #9
haraken
https://codereview.chromium.org/848673002/diff/40001/Source/core/dom/Iterable.h File Source/core/dom/Iterable.h (right): https://codereview.chromium.org/848673002/diff/40001/Source/core/dom/Iterable.h#newcode73 Source/core/dom/Iterable.h:73: v8::Local<v8::Object> creationContext = scriptState->context()->Global(); On 2015/01/13 07:54:35, Jens Widell ...
5 years, 11 months ago (2015-01-13 07:58:17 UTC) #10
Jens Widell
https://codereview.chromium.org/848673002/diff/40001/Source/core/dom/Iterable.h File Source/core/dom/Iterable.h (right): https://codereview.chromium.org/848673002/diff/40001/Source/core/dom/Iterable.h#newcode73 Source/core/dom/Iterable.h:73: v8::Local<v8::Object> creationContext = scriptState->context()->Global(); On 2015/01/13 07:58:17, haraken wrote: ...
5 years, 11 months ago (2015-01-13 08:01:44 UTC) #11
yhirano
lgtm https://codereview.chromium.org/848673002/diff/60001/Source/core/dom/Iterable.h File Source/core/dom/Iterable.h (right): https://codereview.chromium.org/848673002/diff/60001/Source/core/dom/Iterable.h#newcode58 Source/core/dom/Iterable.h:58: static KeyType select(ScriptState*, KeyType key, ValueType value) const ...
5 years, 11 months ago (2015-01-13 10:44:04 UTC) #12
Jens Widell
https://codereview.chromium.org/848673002/diff/60001/Source/core/dom/Iterable.h File Source/core/dom/Iterable.h (right): https://codereview.chromium.org/848673002/diff/60001/Source/core/dom/Iterable.h#newcode58 Source/core/dom/Iterable.h:58: static KeyType select(ScriptState*, KeyType key, ValueType value) On 2015/01/13 ...
5 years, 11 months ago (2015-01-13 10:53:17 UTC) #13
haraken
LGTM https://codereview.chromium.org/848673002/diff/80001/Source/core/dom/Iterable.h File Source/core/dom/Iterable.h (right): https://codereview.chromium.org/848673002/diff/80001/Source/core/dom/Iterable.h#newcode75 Source/core/dom/Iterable.h:75: Vector<ScriptValue> entry; Let's use Vector<ScriptValue, 2>. https://codereview.chromium.org/848673002/diff/80001/Source/modules/fetch/Headers.cpp File ...
5 years, 11 months ago (2015-01-13 12:46:31 UTC) #14
Jens Widell
https://codereview.chromium.org/848673002/diff/80001/Source/core/dom/Iterable.h File Source/core/dom/Iterable.h (right): https://codereview.chromium.org/848673002/diff/80001/Source/core/dom/Iterable.h#newcode75 Source/core/dom/Iterable.h:75: Vector<ScriptValue> entry; On 2015/01/13 12:46:31, haraken wrote: > > ...
5 years, 11 months ago (2015-01-13 12:57:41 UTC) #15
Jens Widell
https://codereview.chromium.org/848673002/diff/80001/Source/modules/fetch/Headers.cpp File Source/modules/fetch/Headers.cpp (right): https://codereview.chromium.org/848673002/diff/80001/Source/modules/fetch/Headers.cpp#newcode30 Source/modules/fetch/Headers.cpp:30: if (m_current >= m_headers->size()) On 2015/01/13 12:46:31, haraken wrote: ...
5 years, 11 months ago (2015-01-13 13:07:22 UTC) #16
bashi
LGTM
5 years, 11 months ago (2015-01-13 23:33:13 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/848673002/120001
5 years, 11 months ago (2015-01-14 08:09:11 UTC) #19
commit-bot: I haz the power
5 years, 11 months ago (2015-01-14 08:13:01 UTC) #20
Message was sent while issue was closed.
Committed patchset #7 (id:120001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=188364

Powered by Google App Engine
This is Rietveld 408576698