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

Issue 333163003: Add Uri.replace which creates a new Uri with the same fields as the original, but with some fields … (Closed)

Created:
6 years, 6 months ago by Lasse Reichstein Nielsen
Modified:
6 years, 4 months ago
CC:
reviews_dartlang.org, floitsch, kustermann
Visibility:
Public.

Description

Add Uri.replace which creates a new Uri with the same fields as the original, but with some fields replaced by the user. BUG= http://dartbug.com/18950 R=ajohnsen@google.com Committed: https://code.google.com/p/dart/source/detail?r=38894 Committed: https://code.google.com/p/dart/source/detail?r=38897

Patch Set 1 #

Total comments: 10

Patch Set 2 : Updated documementation slightly #

Patch Set 3 : Reapply after revert #

Patch Set 4 : Update to work with new Uri internal structure #

Total comments: 2

Patch Set 5 : Address comment. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+174 lines, -1 line) Patch
M sdk/lib/core/uri.dart View 1 2 3 4 2 chunks +111 lines, -1 line 0 comments Download
M tests/corelib/uri_test.dart View 1 2 3 4 2 chunks +63 lines, -0 lines 0 comments Download

Messages

Total messages: 21 (0 generated)
Lasse Reichstein Nielsen
6 years, 6 months ago (2014-06-24 05:59:19 UTC) #1
floitsch
DBC. https://codereview.chromium.org/333163003/diff/1/sdk/lib/core/uri.dart File sdk/lib/core/uri.dart (right): https://codereview.chromium.org/333163003/diff/1/sdk/lib/core/uri.dart#newcode826 sdk/lib/core/uri.dart:826: Uri replace({String scheme, I don't like "replace" it ...
6 years, 6 months ago (2014-06-24 09:15:54 UTC) #2
Lasse Reichstein Nielsen
https://codereview.chromium.org/333163003/diff/1/sdk/lib/core/uri.dart File sdk/lib/core/uri.dart (right): https://codereview.chromium.org/333163003/diff/1/sdk/lib/core/uri.dart#newcode826 sdk/lib/core/uri.dart:826: Uri replace({String scheme, I picked "replace" because we already ...
6 years, 6 months ago (2014-06-24 09:25:58 UTC) #3
floitsch
https://codereview.chromium.org/333163003/diff/1/sdk/lib/core/uri.dart File sdk/lib/core/uri.dart (right): https://codereview.chromium.org/333163003/diff/1/sdk/lib/core/uri.dart#newcode826 sdk/lib/core/uri.dart:826: Uri replace({String scheme, On 2014/06/24 09:25:58, Lasse Reichstein Nielsen ...
6 years, 6 months ago (2014-06-24 09:32:28 UTC) #4
kustermann
+kevmoo DBC https://codereview.chromium.org/333163003/diff/1/sdk/lib/core/uri.dart File sdk/lib/core/uri.dart (right): https://codereview.chromium.org/333163003/diff/1/sdk/lib/core/uri.dart#newcode826 sdk/lib/core/uri.dart:826: Uri replace({String scheme, On 2014/06/24 09:32:27, floitsch ...
6 years, 6 months ago (2014-06-25 00:54:38 UTC) #5
Lasse Reichstein Nielsen
https://codereview.chromium.org/333163003/diff/1/sdk/lib/core/uri.dart File sdk/lib/core/uri.dart (right): https://codereview.chromium.org/333163003/diff/1/sdk/lib/core/uri.dart#newcode826 sdk/lib/core/uri.dart:826: Uri replace({String scheme, I like "change" even less than ...
6 years, 6 months ago (2014-06-26 06:01:31 UTC) #6
Anders Johnsen
https://codereview.chromium.org/333163003/diff/1/sdk/lib/core/uri.dart File sdk/lib/core/uri.dart (right): https://codereview.chromium.org/333163003/diff/1/sdk/lib/core/uri.dart#newcode826 sdk/lib/core/uri.dart:826: Uri replace({String scheme, What about Uri.from(Uri uri, {...}); ?
6 years, 6 months ago (2014-06-26 08:20:35 UTC) #7
Lasse Reichstein Nielsen
> What about > > Uri.from(Uri uri, {...}); My only complain is that it's longer ...
6 years, 6 months ago (2014-06-26 08:27:50 UTC) #8
Anders Johnsen
A good thing about making it a constructor, is that it can easily be tree-shaken, ...
6 years, 6 months ago (2014-06-26 11:15:29 UTC) #9
Lasse Reichstein Nielsen
I'm warming to the constructor solution, but there is one small problem with it. With ...
6 years, 6 months ago (2014-06-26 12:15:50 UTC) #10
kevmoo
On 2014/06/26 12:15:50, Lasse Reichstein Nielsen wrote: > I'm warming to the constructor solution, but ...
6 years, 5 months ago (2014-06-27 20:30:36 UTC) #11
kustermann
> A good thing about making it a constructor, is that it can easily be ...
6 years, 5 months ago (2014-06-27 20:45:06 UTC) #12
Lasse Reichstein Nielsen
message: On 2014/06/27 20:45:06, kustermann wrote: ... > The "new" keyword is IMHO horrible. http://dartbug.com/18241 ...
6 years, 5 months ago (2014-07-02 09:06:01 UTC) #13
Lasse Reichstein Nielsen
Ok, not better suggestions have surfaced. Unless Luke has a better idea, let's use "replace". ...
6 years, 5 months ago (2014-07-15 13:04:11 UTC) #14
Anders Johnsen
lgtm, but with the same concerns about the name 'replace' :) https://codereview.chromium.org/333163003/diff/1/sdk/lib/core/uri.dart File sdk/lib/core/uri.dart (right): ...
6 years, 4 months ago (2014-07-29 07:13:34 UTC) #15
Lasse Reichstein Nielsen
https://codereview.chromium.org/333163003/diff/1/sdk/lib/core/uri.dart File sdk/lib/core/uri.dart (right): https://codereview.chromium.org/333163003/diff/1/sdk/lib/core/uri.dart#newcode808 sdk/lib/core/uri.dart:808: * Using this method is similar to using the ...
6 years, 4 months ago (2014-08-05 10:30:39 UTC) #16
Lasse Reichstein Nielsen
Committed patchset #2 manually as 38894 (presubmit successful).
6 years, 4 months ago (2014-08-05 10:32:29 UTC) #17
Lasse Reichstein Nielsen
Updated code, PTAL
6 years, 4 months ago (2014-08-05 12:11:04 UTC) #18
Anders Johnsen
lgtm https://codereview.chromium.org/333163003/diff/60001/sdk/lib/core/uri.dart File sdk/lib/core/uri.dart (right): https://codereview.chromium.org/333163003/diff/60001/sdk/lib/core/uri.dart#newcode887 sdk/lib/core/uri.dart:887: if (schemeChanged) { Add comment. Also, use else?
6 years, 4 months ago (2014-08-05 12:15:04 UTC) #19
Lasse Reichstein Nielsen
https://codereview.chromium.org/333163003/diff/60001/sdk/lib/core/uri.dart File sdk/lib/core/uri.dart (right): https://codereview.chromium.org/333163003/diff/60001/sdk/lib/core/uri.dart#newcode887 sdk/lib/core/uri.dart:887: if (schemeChanged) { Comment added. Can't see any use ...
6 years, 4 months ago (2014-08-05 12:21:02 UTC) #20
Lasse Reichstein Nielsen
6 years, 4 months ago (2014-08-05 12:23:21 UTC) #21
Message was sent while issue was closed.
Committed patchset #5 manually as 38897 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698