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

Issue 1382583002: Add toStdString methods to CString and WTF::String (Closed)

Created:
5 years, 2 months ago by Primiano Tucci (use gerrit)
Modified:
4 years, 10 months ago
Reviewers:
haraken, tkent, esprehn, Mikhail
CC:
abarth-chromium, blink-reviews, blink-reviews-wtf_chromium.org, chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add toStdString methods to CString and WTF::String Follow-up CL to: [blink-dev] How to call Chromium's methods that take std::strings Adds a toUTF8StdString() method to WTF::String and a toStdString() method to CString. BUG=

Patch Set 1 #

Total comments: 7

Patch Set 2 : Add include #

Total comments: 4

Patch Set 3 : Switch to implicit CString -> std::string conversion #

Patch Set 4 : Fix tests #

Patch Set 5 : Back to String::toUTF8StdString #

Unified diffs Side-by-side diffs Delta from patch set Stats (+41 lines, -0 lines) Patch
M third_party/WebKit/Source/wtf/text/CString.h View 1 2 3 4 2 chunks +8 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/wtf/text/CStringTest.cpp View 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/wtf/text/WTFString.h View 1 2 3 4 2 chunks +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/wtf/text/WTFString.cpp View 1 2 3 4 2 chunks +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/wtf/text/WTFStringTest.cpp View 1 2 3 4 1 chunk +19 lines, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 36 (3 generated)
Primiano Tucci (use gerrit)
5 years, 2 months ago (2015-09-30 12:08:16 UTC) #2
haraken
+tkent Looks good to me.
5 years, 2 months ago (2015-09-30 12:11:34 UTC) #4
Mikhail
https://codereview.chromium.org/1382583002/diff/1/third_party/WebKit/Source/wtf/text/CString.h File third_party/WebKit/Source/wtf/text/CString.h (right): https://codereview.chromium.org/1382583002/diff/1/third_party/WebKit/Source/wtf/text/CString.h#newcode69 third_party/WebKit/Source/wtf/text/CString.h:69: return std::string(data(), length()); length() includes NULL terminator, so should ...
5 years, 2 months ago (2015-09-30 14:02:01 UTC) #6
Primiano Tucci (use gerrit)
https://codereview.chromium.org/1382583002/diff/1/third_party/WebKit/Source/wtf/text/CString.h File third_party/WebKit/Source/wtf/text/CString.h (right): https://codereview.chromium.org/1382583002/diff/1/third_party/WebKit/Source/wtf/text/CString.h#newcode69 third_party/WebKit/Source/wtf/text/CString.h:69: return std::string(data(), length()); On 2015/09/30 14:02:01, Mikhail wrote: > ...
5 years, 2 months ago (2015-09-30 15:08:28 UTC) #7
Mikhail
https://codereview.chromium.org/1382583002/diff/1/third_party/WebKit/Source/wtf/text/CString.h File third_party/WebKit/Source/wtf/text/CString.h (right): https://codereview.chromium.org/1382583002/diff/1/third_party/WebKit/Source/wtf/text/CString.h#newcode69 third_party/WebKit/Source/wtf/text/CString.h:69: return std::string(data(), length()); On 2015/09/30 15:08:28, Primiano Tucci wrote: ...
5 years, 2 months ago (2015-09-30 15:58:39 UTC) #8
Primiano Tucci (use gerrit)
https://codereview.chromium.org/1382583002/diff/1/third_party/WebKit/Source/wtf/text/WTFString.h File third_party/WebKit/Source/wtf/text/WTFString.h (right): https://codereview.chromium.org/1382583002/diff/1/third_party/WebKit/Source/wtf/text/WTFString.h#newcode182 third_party/WebKit/Source/wtf/text/WTFString.h:182: std::string toUTF8() const; On 2015/09/30 15:58:39, Mikhail wrote: > ...
5 years, 2 months ago (2015-09-30 16:03:37 UTC) #9
Mikhail
On 2015/09/30 16:03:37, Primiano Tucci wrote: > https://codereview.chromium.org/1382583002/diff/1/third_party/WebKit/Source/wtf/text/WTFString.h > File third_party/WebKit/Source/wtf/text/WTFString.h (right): > > https://codereview.chromium.org/1382583002/diff/1/third_party/WebKit/Source/wtf/text/WTFString.h#newcode182 ...
5 years, 2 months ago (2015-09-30 18:08:28 UTC) #10
esprehn
https://codereview.chromium.org/1382583002/diff/20001/third_party/WebKit/Source/wtf/text/WTFString.cpp File third_party/WebKit/Source/wtf/text/WTFString.cpp (right): https://codereview.chromium.org/1382583002/diff/20001/third_party/WebKit/Source/wtf/text/WTFString.cpp#newcode841 third_party/WebKit/Source/wtf/text/WTFString.cpp:841: return utf8().toStdString(); callers should just do .utf8().toStdString() https://codereview.chromium.org/1382583002/diff/20001/third_party/WebKit/Source/wtf/text/WTFString.h File ...
5 years, 2 months ago (2015-09-30 18:15:39 UTC) #11
tkent
If we add CString::toStdString(), I think adding String::toUTF8StdString() is also reasonable. str.utf8().toStdString() would be verbose ...
5 years, 2 months ago (2015-10-01 02:09:06 UTC) #12
Primiano Tucci (use gerrit)
https://codereview.chromium.org/1382583002/diff/20001/third_party/WebKit/Source/wtf/text/WTFString.h File third_party/WebKit/Source/wtf/text/WTFString.h (right): https://codereview.chromium.org/1382583002/diff/20001/third_party/WebKit/Source/wtf/text/WTFString.h#newcode183 third_party/WebKit/Source/wtf/text/WTFString.h:183: std::string toUTF8() const; On 2015/10/01 02:09:06, tkent wrote: > ...
5 years, 2 months ago (2015-10-01 07:34:51 UTC) #13
esprehn
On 2015/10/01 at 07:34:51, primiano wrote: > https://codereview.chromium.org/1382583002/diff/20001/third_party/WebKit/Source/wtf/text/WTFString.h > File third_party/WebKit/Source/wtf/text/WTFString.h (right): > > ...
5 years, 2 months ago (2015-10-01 08:28:47 UTC) #14
Primiano Tucci (use gerrit)
On 2015/10/01 08:28:47, esprehn wrote: > On 2015/10/01 at 07:34:51, primiano wrote: > > > ...
5 years, 2 months ago (2015-10-01 09:21:35 UTC) #15
Primiano Tucci (use gerrit)
>Another idea is to allow implicit conversion from CString to std::string, and >use |str.utf8()| for ...
5 years, 2 months ago (2015-10-01 15:55:40 UTC) #16
tkent
I think Patch 3 is ok if compilation errors are fixed. We can avoid unnecessary ...
5 years, 2 months ago (2015-10-02 07:52:26 UTC) #17
esprehn
On 2015/10/02 at 07:52:26, tkent wrote: > I think Patch 3 is ok if compilation ...
5 years, 2 months ago (2015-10-02 08:09:23 UTC) #18
Primiano Tucci (use gerrit)
On 2015/10/02 07:52:26, tkent wrote: > I think Patch 3 is ok if compilation errors ...
5 years, 2 months ago (2015-10-02 08:15:58 UTC) #19
Primiano Tucci (use gerrit)
On 2015/10/02 at 07:52:26, tkent wrote: > I think Patch 3 is ok if compilation ...
5 years, 2 months ago (2015-10-02 08:18:52 UTC) #20
esprehn
On 2015/10/02 at 08:18:52, primiano wrote: > On 2015/10/02 at 07:52:26, tkent wrote: > > ...
5 years, 2 months ago (2015-10-02 08:27:48 UTC) #21
esprehn
Hmm, also none of these patches are using the StringUTF8Adaptor to avoid mallocing a separate ...
5 years, 2 months ago (2015-10-02 08:34:21 UTC) #22
Primiano Tucci (use gerrit)
On 2015/10/02 08:34:21, esprehn wrote: >What is this blocking? There's no rush to start using ...
5 years, 2 months ago (2015-10-02 08:51:24 UTC) #23
tkent
I think we can agree with the following approach: - Based on Patch Set 2 ...
5 years, 2 months ago (2015-10-02 09:03:34 UTC) #24
Primiano Tucci (use gerrit)
On 2015/10/02 09:03:34, tkent wrote: > I think we can agree with the following approach: ...
5 years, 2 months ago (2015-10-02 09:50:36 UTC) #25
Primiano Tucci (use gerrit)
PING esprehn@, are you okay with the plan tkent proposed in #24?
5 years, 2 months ago (2015-10-05 15:30:48 UTC) #26
esprehn
On 2015/10/05 at 15:30:48, primiano wrote: > PING esprehn@, are you okay with the plan ...
5 years, 2 months ago (2015-10-05 19:17:17 UTC) #27
Primiano Tucci (use gerrit)
On 2015/10/05 19:17:17, esprehn wrote: > On 2015/10/05 at 15:30:48, primiano wrote: > > PING ...
5 years, 2 months ago (2015-10-05 19:21:45 UTC) #28
esprehn
On 2015/10/05 at 19:21:45, primiano wrote: > On 2015/10/05 19:17:17, esprehn wrote: > > On ...
5 years, 2 months ago (2015-10-05 19:23:40 UTC) #29
Primiano Tucci (use gerrit)
On 2015/10/05 19:23:40, esprehn wrote: > Blink should not be using std::string for 99% of ...
5 years, 2 months ago (2015-10-05 22:36:16 UTC) #30
Primiano Tucci (use gerrit)
tkent/esprehn can you please take a look now? I followed the suggestion in #24, and ...
5 years, 2 months ago (2015-10-07 18:14:09 UTC) #31
tkent
looks good to me.
5 years, 2 months ago (2015-10-07 22:58:13 UTC) #32
Primiano Tucci (use gerrit)
Ok, at this point this is a precondition to lot of cleanup. I can get ...
5 years, 2 months ago (2015-10-08 18:18:40 UTC) #33
ojan
On 2015/10/08 at 18:18:40, primiano wrote: > Ok, at this point this is a precondition ...
5 years, 2 months ago (2015-10-08 18:53:20 UTC) #34
Primiano Tucci (use gerrit)
On 2015/10/08 18:53:20, ojan wrote: > Please wait a couple weeks while we figure out ...
5 years, 2 months ago (2015-10-09 09:18:39 UTC) #35
ojan
5 years, 2 months ago (2015-10-09 17:47:08 UTC) #36
On 2015/10/09 at 09:18:39, primiano wrote:
> On 2015/10/08 18:53:20, ojan wrote:
> > Please wait a couple weeks while we figure out the right path forward. I
> > understand you don't want to block unnecessarily, but it's important that we
do
> > blink/chromium integration in a way that makes for a good, holistic end
result.
> > Elliott is on vacation right now and only just became TL for this work a
week
> > before his vacation. He'll make an initial proposal next week and we can see
> > what things look like based off the response to that proposal. That OK?
> 
> It is perfectly OK to say: "this cannot happen now, we need X weeks to figure
out how to do things properly, please adjust your plans accordingly".
> Would have been nice to get this 33 replies ago: it would have avoided me to
write refactoring/cleanup CLs that will go bitrotten and would have avoided me
to put other people on hold and just tell them "keep plumbing via the glue layer
as usual".
> 
> Super happy to know that you guys are planning a proper way forward.
> Just, maybe next time give the NACK message straight away, it will be a better
use of everybody's time.
> 
> Thanks for looking into this.

I understand the frustration. FWIW, organization around this stuff was a bit
messy for a couple weeks and only just landed on Elliott figuring it out.

Powered by Google App Engine
This is Rietveld 408576698