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

Issue 1093103003: [cleanup, battery] Don't include unneeded headers.

Created:
5 years, 8 months ago by riju_
Modified:
3 years, 6 months ago
Reviewers:
timvolodine
CC:
blink-reviews, mlamouri+watch-blink_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Removing some unneeded headers and using forward declarations where possible in the battery module. https://www.chromium.org/developers/coding-style/cpp-dos-and-donts#TOC-Don-t-include-unneeded-headers BUG=none

Patch Set 1 #

Patch Set 2 : Rebase #

Total comments: 5

Patch Set 3 : Fix tim's comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+5 lines, -4 lines) Patch
M third_party/WebKit/Source/modules/battery/BatteryDispatcher.h View 1 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/battery/BatteryManager.h View 1 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/battery/NavigatorBattery.h View 1 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/battery/NavigatorBattery.cpp View 1 2 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 27 (19 generated)
riju_
tim@ : I was doing a similar work for battery as for motion|Orientation in https://codereview.chromium.org/1079983003/ ...
5 years, 8 months ago (2015-04-24 13:33:45 UTC) #2
timvolodine
On 2015/04/24 13:33:45, riju_ wrote: > tim@ : I was doing a similar work for ...
5 years, 8 months ago (2015-04-24 14:24:35 UTC) #3
riju_
Tim@ : Just saw that this was lying in my list. The move part is ...
3 years, 6 months ago (2017-06-02 12:23:40 UTC) #13
timvolodine
On 2017/06/02 12:23:40, riju_ wrote: > Tim@ : Just saw that this was lying in ...
3 years, 6 months ago (2017-06-08 20:29:36 UTC) #14
riju_
On 2017/06/08 20:29:36, timvolodine wrote: > On 2017/06/02 12:23:40, riju_ wrote: > > Tim@ : ...
3 years, 6 months ago (2017-06-09 08:22:47 UTC) #15
timvolodine
Two comments below. Also, maybe expand the description of the issue a bit to describe ...
3 years, 6 months ago (2017-06-09 12:06:19 UTC) #16
riju_
Thanks Tim, description updated now, other answers inline. https://codereview.chromium.org/1093103003/diff/40001/third_party/WebKit/Source/modules/battery/BatteryManager.h File third_party/WebKit/Source/modules/battery/BatteryManager.h (left): https://codereview.chromium.org/1093103003/diff/40001/third_party/WebKit/Source/modules/battery/BatteryManager.h#oldcode8 third_party/WebKit/Source/modules/battery/BatteryManager.h:8: #include ...
3 years, 6 months ago (2017-06-09 13:36:14 UTC) #20
timvolodine
3 years, 6 months ago (2017-06-09 14:00:14 UTC) #21
https://codereview.chromium.org/1093103003/diff/40001/third_party/WebKit/Sour...
File third_party/WebKit/Source/modules/battery/NavigatorBattery.h (right):

https://codereview.chromium.org/1093103003/diff/40001/third_party/WebKit/Sour...
third_party/WebKit/Source/modules/battery/NavigatorBattery.h:16: class
ScriptState;
On 2017/06/09 13:36:11, riju_ wrote:
> On 2017/06/09 12:06:19, timvolodine wrote:
> > Probably need to include ScriptPromise and ScriptState in
NavigatorBattery.cc?
> 
> NavigatorBattery.cpp is including BatteryManager.h, which includes
> ScriptPromiseProperty, which includes ScriptPromise.
> ScriptPromise includes ScriptValue.h, which includes ScriptState.h

I think we generally avoid relying on transitive includes (because
implementations can change which will cause potential breakage in files that
depend on their includes).

https://google.github.io/styleguide/cppguide.html#Names_and_Order_of_Includes

Powered by Google App Engine
This is Rietveld 408576698