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

Issue 16108003: Avoid parsing path and query string more than once (Closed)

Created:
7 years, 6 months ago by Søren Gjesse
Modified:
7 years, 6 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Avoid parsing path and query string more than once This has the side-effect of making a Uri mutable to some extend. By not actuallt storing the passed in pathSegments and queryParameters objects I think this is managable. I think repeated access to uri.queryParameters should not parse the query string into a map more than once. R=lrn@google.com BUG= Committed: https://code.google.com/p/dart/source/detail?r=23530

Patch Set 1 #

Total comments: 10

Patch Set 2 : Addressed review comments #

Total comments: 6

Patch Set 3 : Addressed review comments #

Patch Set 4 : Minor fixes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+125 lines, -8 lines) Patch
M sdk/lib/core/uri.dart View 1 2 3 5 chunks +58 lines, -4 lines 0 comments Download
M tests/corelib/uri_path_test.dart View 1 2 1 chunk +41 lines, -2 lines 0 comments Download
M tests/corelib/uri_query_test.dart View 1 2 2 chunks +26 lines, -2 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
Søren Gjesse
7 years, 6 months ago (2013-05-30 11:12:49 UTC) #1
Lasse Reichstein Nielsen
lgtm https://codereview.chromium.org/16108003/diff/1/sdk/lib/core/uri.dart File sdk/lib/core/uri.dart (right): https://codereview.chromium.org/16108003/diff/1/sdk/lib/core/uri.dart#newcode84 sdk/lib/core/uri.dart:84: List<String> _pathSegments; Dartdoc saying that this caches the ...
7 years, 6 months ago (2013-05-30 11:57:50 UTC) #2
Søren Gjesse
Added immutable list and map. PTAL https://codereview.chromium.org/16108003/diff/1/sdk/lib/core/uri.dart File sdk/lib/core/uri.dart (right): https://codereview.chromium.org/16108003/diff/1/sdk/lib/core/uri.dart#newcode84 sdk/lib/core/uri.dart:84: List<String> _pathSegments; On ...
7 years, 6 months ago (2013-05-30 13:38:25 UTC) #3
Lasse Reichstein Nielsen
lgtm https://codereview.chromium.org/16108003/diff/6001/sdk/lib/core/uri.dart File sdk/lib/core/uri.dart (right): https://codereview.chromium.org/16108003/diff/6001/sdk/lib/core/uri.dart#newcode974 sdk/lib/core/uri.dart:974: dart:collections has an UnmodifiableListView you can use for ...
7 years, 6 months ago (2013-06-03 07:54:27 UTC) #4
Søren Gjesse
Committed patchset #4 manually as r23530 (presubmit successful).
7 years, 6 months ago (2013-06-03 09:17:16 UTC) #5
Søren Gjesse
7 years, 6 months ago (2013-06-03 09:18:15 UTC) #6
Message was sent while issue was closed.
https://codereview.chromium.org/16108003/diff/6001/sdk/lib/core/uri.dart
File sdk/lib/core/uri.dart (right):

https://codereview.chromium.org/16108003/diff/6001/sdk/lib/core/uri.dart#newc...
sdk/lib/core/uri.dart:974: 
On 2013/06/03 07:54:27, Lasse Reichstein Nielsen wrote:
> dart:collections has an UnmodifiableListView you can use for this
> (it uses the internal UnmodifiableListMixin)
> 
> We use "unmodifiable" instead of "immutable", because the latter can carry a
> connotation of deep immutablility, which we are not guaranteeing.

Thanks - I missed that.

https://codereview.chromium.org/16108003/diff/6001/sdk/lib/core/uri.dart#newc...
sdk/lib/core/uri.dart:1023: class _ImmutableMap<K, V> implements Map<K, V> {
On 2013/06/03 07:54:27, Lasse Reichstein Nielsen wrote:
> No UnmodifiableMapView, sorry :(
> We probably should have one, but we also need Map mixins and base classes.

OK, keeping this (renaming to _UnmodifiableMap).

https://codereview.chromium.org/16108003/diff/6001/sdk/lib/core/uri.dart#newc...
sdk/lib/core/uri.dart:1030: void operator []=(K key, V value) => throw new
StateError("Immutable map");
On 2013/06/03 07:54:27, Lasse Reichstein Nielsen wrote:
> UnsupportedError

Done.

Powered by Google App Engine
This is Rietveld 408576698