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

Issue 2800213002: Avoid duplicate functions/code in core/inspector.

Created:
3 years, 8 months ago by Daniel Bratell
Modified:
3 years, 4 months ago
Reviewers:
pfeldman
CC:
chromium-reviews, caseq+blink_chromium.org, lushnikov+blink_chromium.org, pfeldman+blink_chromium.org, apavlov+blink_chromium.org, devtools-reviews_chromium.org, blink-reviews, kozyatinskiy+blink_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Avoid duplicate functions/code in core/inspector. While experimenting with unity builds I encountered a few duplicate symbols and functions in core/inspector. This patch moves frameId() and urlWithoutFragment to be member functions so that they have a more clearly defined scope. Also deleted a function declaration for a function I could not find.

Patch Set 1 #

Patch Set 2 : Rebased past blink rename #

Patch Set 3 : Merge two UrlWithoutFragment() and two FrameId() functions. #

Total comments: 1

Patch Set 4 : A third way #

Total comments: 8

Patch Set 5 : Addressed review comments. #

Total comments: 1

Patch Set 6 : Manual inlined urlWithoutFragment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+51 lines, -64 lines) Patch
M third_party/WebKit/Source/core/inspector/BUILD.gn View 1 2 3 4 5 1 chunk +0 lines, -9 lines 0 comments Download
M third_party/WebKit/Source/core/inspector/IdentifiersFactory.cpp View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp View 1 2 3 4 5 8 chunks +23 lines, -19 lines 0 comments Download
M third_party/WebKit/Source/core/inspector/InspectorPageAgent.h View 1 2 3 4 5 1 chunk +0 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp View 1 2 3 4 5 9 chunks +25 lines, -25 lines 0 comments Download
M third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp View 1 2 2 chunks +1 line, -5 lines 0 comments Download

Messages

Total messages: 49 (28 generated)
Daniel Bratell
PTAL.
3 years, 8 months ago (2017-04-07 21:35:38 UTC) #3
pfeldman
>> This patch moves frameId() and urlWithoutFragment to be member functions so that they have ...
3 years, 8 months ago (2017-04-07 23:27:19 UTC) #5
Daniel Bratell
On 2017/04/07 23:27:19, pfeldman wrote: > >> This patch moves frameId() and urlWithoutFragment to be ...
3 years, 8 months ago (2017-04-08 07:26:14 UTC) #8
pfeldman
> As for the why I'm doing unity build experiments at all, I think I ...
3 years, 8 months ago (2017-04-17 20:25:04 UTC) #13
Daniel Bratell
On 2017/04/17 20:25:04, pfeldman wrote: > > As for the why I'm doing unity build ...
3 years, 8 months ago (2017-04-18 16:48:00 UTC) #14
pfeldman
I think I understand where you are coming from. But it seems very easy to ...
3 years, 8 months ago (2017-04-18 17:42:14 UTC) #15
Daniel Bratell
On 2017/04/18 17:42:14, pfeldman wrote: > I think I understand where you are coming from. ...
3 years, 8 months ago (2017-04-18 19:29:27 UTC) #16
pfeldman
>> My goal for the small patches has been to make them self sustained and ...
3 years, 8 months ago (2017-04-18 20:24:15 UTC) #17
Daniel Bratell
On 2017/04/18 20:24:15, pfeldman wrote: > >> My goal for the small patches has been ...
3 years, 7 months ago (2017-05-03 08:42:40 UTC) #20
Daniel Bratell
pfeldman, here is another approach. Instead of class static functions, I've moved UrlWithoutFragment to the ...
3 years, 5 months ago (2017-07-04 15:30:07 UTC) #23
Daniel Bratell
3 years, 5 months ago (2017-07-04 15:30:24 UTC) #25
pfeldman
https://codereview.chromium.org/2800213002/diff/40001/third_party/WebKit/Source/core/inspector/InspectorBaseAgent.h File third_party/WebKit/Source/core/inspector/InspectorBaseAgent.h (right): https://codereview.chromium.org/2800213002/diff/40001/third_party/WebKit/Source/core/inspector/InspectorBaseAgent.h#newcode113 third_party/WebKit/Source/core/inspector/InspectorBaseAgent.h:113: KURL UrlWithoutFragment(const KURL&); This really is not a great ...
3 years, 5 months ago (2017-07-05 18:24:55 UTC) #28
Daniel Bratell
On 2017/07/05 18:24:55, pfeldman wrote: > https://codereview.chromium.org/2800213002/diff/40001/third_party/WebKit/Source/core/inspector/InspectorBaseAgent.h > File third_party/WebKit/Source/core/inspector/InspectorBaseAgent.h (right): > > https://codereview.chromium.org/2800213002/diff/40001/third_party/WebKit/Source/core/inspector/InspectorBaseAgent.h#newcode113 > ...
3 years, 5 months ago (2017-07-05 19:43:55 UTC) #29
Daniel Bratell
pfeldman, can you please take a look at this variant? I guessed from your last ...
3 years, 5 months ago (2017-07-21 09:25:46 UTC) #32
pfeldman
https://codereview.chromium.org/2800213002/diff/60001/third_party/WebKit/Source/core/inspector/IdentifiersFactory.cpp File third_party/WebKit/Source/core/inspector/IdentifiersFactory.cpp (right): https://codereview.chromium.org/2800213002/diff/60001/third_party/WebKit/Source/core/inspector/IdentifiersFactory.cpp#newcode62 third_party/WebKit/Source/core/inspector/IdentifiersFactory.cpp:62: return frame ? FrameId(frame) : ""; Bake it into ...
3 years, 5 months ago (2017-07-21 18:10:59 UTC) #35
Daniel Bratell
Addressed the review comments. Please take a new look. https://codereview.chromium.org/2800213002/diff/60001/third_party/WebKit/Source/core/inspector/IdentifiersFactory.cpp File third_party/WebKit/Source/core/inspector/IdentifiersFactory.cpp (right): https://codereview.chromium.org/2800213002/diff/60001/third_party/WebKit/Source/core/inspector/IdentifiersFactory.cpp#newcode62 third_party/WebKit/Source/core/inspector/IdentifiersFactory.cpp:62: ...
3 years, 4 months ago (2017-07-23 20:14:12 UTC) #38
pfeldman
https://codereview.chromium.org/2800213002/diff/60001/third_party/WebKit/Source/core/inspector/InspectorHelpers.cpp File third_party/WebKit/Source/core/inspector/InspectorHelpers.cpp (right): https://codereview.chromium.org/2800213002/diff/60001/third_party/WebKit/Source/core/inspector/InspectorHelpers.cpp#newcode14 third_party/WebKit/Source/core/inspector/InspectorHelpers.cpp:14: const CString c_string = string.Utf8(); I wanted to inline ...
3 years, 4 months ago (2017-07-25 00:14:44 UTC) #41
Daniel Bratell
There was a bit more than two places using that function but this is what ...
3 years, 4 months ago (2017-07-26 10:38:39 UTC) #44
Daniel Bratell
On 2017/07/26 10:38:39, Daniel Bratell wrote: > There was a bit more than two places ...
3 years, 4 months ago (2017-07-26 10:39:29 UTC) #45
Daniel Bratell
pfeldman, can you take a new look?
3 years, 4 months ago (2017-07-28 11:00:37 UTC) #48
pfeldman
3 years, 4 months ago (2017-07-31 17:28:12 UTC) #49
Looking at the URL without fragment, it clearly makes the code less readable due
to inlining. And you don't let us extract these helper functions because they
clash. Is there a doc or a decision that your project has enough priority to
force changes like this?

Powered by Google App Engine
This is Rietveld 408576698