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

Issue 1257203002: Fix ODR violation that can break WTF::String pretty printing in tests. (Closed)

Created:
5 years, 4 months ago by dcheng
Modified:
5 years, 3 months ago
CC:
blink-reviews, blink-reviews-dom_chromium.org, blink-reviews-wtf_chromium.org, dglazkov+blink, eae+blinkwatch, Mikhail, rwlbuis, sof, tyoshino+watch_chromium.org, webcomponents-bugzilla_chromium.org, yhirano, Yuta Kitamura
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Fix ODR violation that can break WTF::String pretty printing in tests. WTF::String's operator<< was declared in a separate header, presumably to prevent non-test code from depending on it. Unfortunately, this resulted in ODR violations, since tests that forgot to include this header would have a different template instantiation of gtest's DefaultPrintNonContainerTo() vs tests that did remember to include it. Rather than forcing tests to remember a non-obvious dependency that can implicitly introduced with no warning, operator<< has been moved to the same header where WTF::String is declared. In order to prevent it from being used outside tests, operator<< is still only defined in the test support library. BUG=514330 TBR=yhirano@chromium.org Committed: https://crrev.com/37e7fd401a4ef48a6ce0e0342675e3629a177309 git-svn-id: svn://svn.chromium.org/blink/trunk@199609 bbb929c8-8fbe-4397-9dbb-9b2b20218538

Patch Set 1 #

Patch Set 2 : . #

Total comments: 1

Patch Set 3 : Fix Windows build #

Patch Set 4 : Really fix #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+7 lines, -216 lines) Patch
M Source/core/dom/DocumentMarkerControllerTest.cpp View 1 chunk +0 lines, -1 line 0 comments Download
M Source/core/dom/shadow/ComposedTreeTraversalTest.cpp View 1 chunk +0 lines, -1 line 0 comments Download
M Source/core/editing/FrameSelectionTest.cpp View 1 chunk +0 lines, -1 line 0 comments Download
M Source/core/editing/GranularityStrategyTest.cpp View 1 chunk +0 lines, -1 line 0 comments Download
M Source/core/testing/CoreTestHelpers.h View 1 chunk +0 lines, -1 line 0 comments Download
M Source/modules/websockets/DOMWebSocketTest.cpp View 1 chunk +0 lines, -1 line 0 comments Download
M Source/platform/network/HTTPParsersTest.cpp View 1 chunk +0 lines, -1 line 0 comments Download
M Source/platform/weborigin/DatabaseIdentifierTest.cpp View 1 chunk +0 lines, -1 line 0 comments Download
M Source/platform/weborigin/KURLTest.cpp View 1 chunk +0 lines, -1 line 0 comments Download
D Source/wtf/testing/WTFTestHelpers.h View 1 chunk +0 lines, -45 lines 0 comments Download
D Source/wtf/testing/WTFTestHelpers.cpp View 1 chunk +0 lines, -83 lines 0 comments Download
D Source/wtf/testing/WTFTestHelpersTest.cpp View 1 chunk +0 lines, -71 lines 0 comments Download
A + Source/wtf/testing/WTFTestPrinters.cpp View 1 chunk +0 lines, -2 lines 0 comments Download
A + Source/wtf/testing/WTFTestPrintersTest.cpp View 1 1 chunk +0 lines, -1 line 0 comments Download
M Source/wtf/text/StringBuilderTest.cpp View 1 chunk +0 lines, -1 line 0 comments Download
M Source/wtf/text/WTFString.h View 1 2 2 chunks +5 lines, -0 lines 1 comment Download
M Source/wtf/wtf.gypi View 2 chunks +2 lines, -4 lines 0 comments Download

Messages

Total messages: 18 (4 generated)
dcheng
https://codereview.chromium.org/1257203002/diff/20001/Source/wtf/text/WTFString.h File Source/wtf/text/WTFString.h (right): https://codereview.chromium.org/1257203002/diff/20001/Source/wtf/text/WTFString.h#newcode638 Source/wtf/text/WTFString.h:638: WTF_EXPORT std::ostream& operator<<(std::ostream&, const String&); It feels a little ...
5 years, 4 months ago (2015-07-27 19:59:04 UTC) #2
dcheng
It seems I spoke to soon, since this breaks on Windows. Let me try to ...
5 years, 4 months ago (2015-07-27 20:28:07 UTC) #3
dcheng
OK, fixed the build. It's not the nicest thing in the world, but given the ...
5 years, 4 months ago (2015-07-27 22:10:57 UTC) #4
Julien - ping for review
lgtm, that looks reasonable to me. +Nico as a C++ master in case I missed ...
5 years, 4 months ago (2015-07-28 17:35:32 UTC) #6
Nico
Right now, no non-test files in blink include iosfwd, ostream, sstream, strstream, iostream (that's all ...
5 years, 4 months ago (2015-07-28 17:45:57 UTC) #7
dcheng
On 2015/07/28 at 17:45:57, thakis wrote: > Right now, no non-test files in blink include ...
5 years, 4 months ago (2015-07-28 17:49:15 UTC) #8
Nico
On 2015/07/28 17:49:15, dcheng wrote: > On 2015/07/28 at 17:45:57, thakis wrote: > > Right ...
5 years, 4 months ago (2015-07-28 18:22:16 UTC) #9
Julien - ping for review
On 2015/07/28 at 18:22:16, thakis wrote: > On 2015/07/28 17:49:15, dcheng wrote: > > On ...
5 years, 4 months ago (2015-07-28 18:29:58 UTC) #10
dcheng
On 2015/07/28 at 18:29:58, jchaffraix wrote: > On 2015/07/28 at 18:22:16, thakis wrote: > > ...
5 years, 4 months ago (2015-07-28 19:01:49 UTC) #11
Nico
a'ight, lgtm I guess. /me wishes gtest wouldn't rely on ostream, but it does, and ...
5 years, 4 months ago (2015-07-28 19:05:41 UTC) #12
dcheng
TBR yhirano@ for Source/modules/websockets changes.
5 years, 4 months ago (2015-07-28 21:40:17 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1257203002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1257203002/60001
5 years, 4 months ago (2015-07-28 21:40:31 UTC) #16
commit-bot: I haz the power
Committed patchset #4 (id:60001) as https://src.chromium.org/viewvc/blink?view=rev&revision=199609
5 years, 4 months ago (2015-07-28 21:43:05 UTC) #17
commit-bot: I haz the power
5 years, 3 months ago (2015-09-23 11:51:49 UTC) #18
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/37e7fd401a4ef48a6ce0e0342675e3629a177309

Powered by Google App Engine
This is Rietveld 408576698