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

Issue 1221663009: Expose API to store and load data usage stats from UI task runner. (Closed)

Created:
5 years, 5 months ago by Not at Google. Contact bengr
Modified:
5 years, 5 months ago
CC:
android-webview-reviews_chromium.org, cbentzel+watch_chromium.org, chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@Breakdown
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Expose API to store and load data usage stats from UI task runner. Initialize and hookup DB task runner and DB objects. |DataReductionProxyService| exposes APIs on UI task runner to read and modify data usage stats. Initialize webview with a dummy store where load and store are no-ops. BUG=482442 Committed: https://crrev.com/2ac5656adb9cb3e68127cdc118756de2879454f5 Cr-Commit-Position: refs/heads/master@{#338914}

Patch Set 1 #

Patch Set 2 : Clean up #

Patch Set 3 : Add #includes #

Patch Set 4 : Remove unnecessary #includes #

Patch Set 5 : Pass scoped_ptr correctly #

Patch Set 6 : Add missing Pass. #

Total comments: 13

Patch Set 7 : Addressed code review comments #

Patch Set 8 : Sync to head #

Patch Set 9 : Improved a commnet #

Patch Set 10 : Fix lifecycle of settings in test. #

Patch Set 11 : Sync to head #

Total comments: 6

Patch Set 12 : Create compression stats inside DRPService #

Patch Set 13 : Fix webview #

Total comments: 2

Patch Set 14 : Add DCHECK #

Unified diffs Side-by-side diffs Delta from patch set Stats (+190 lines, -62 lines) Patch
M android_webview/browser/aw_browser_context.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +12 lines, -4 lines 0 comments Download
M chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h View 1 2 3 4 5 6 7 8 2 chunks +6 lines, -2 lines 0 comments Download
M chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +8 lines, -7 lines 0 comments Download
M chrome/browser/profiles/profile_impl_io_data.cc View 1 2 chunks +13 lines, -4 lines 0 comments Download
M chrome/browser/renderer_context_menu/render_view_context_menu_unittest.cc View 1 2 3 4 5 6 7 8 9 10 5 chunks +19 lines, -0 lines 0 comments Download
M components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats.h View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +12 lines, -5 lines 0 comments Download
M components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +9 lines, -4 lines 0 comments Download
M components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +19 lines, -5 lines 0 comments Download
M components/data_reduction_proxy/core/browser/data_reduction_proxy_service.h View 1 2 3 4 5 6 7 8 9 10 11 5 chunks +20 lines, -6 lines 0 comments Download
M components/data_reduction_proxy/core/browser/data_reduction_proxy_service.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +41 lines, -5 lines 0 comments Download
M components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.h View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +7 lines, -4 lines 0 comments Download
M components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.cc View 1 2 3 4 5 6 7 8 9 10 11 7 chunks +24 lines, -16 lines 0 comments Download

Messages

Total messages: 18 (3 generated)
Not at Google. Contact bengr
This change was originally part of https://codereview.chromium.org/1173343009/ but was split to make the cls more ...
5 years, 5 months ago (2015-07-10 20:25:59 UTC) #2
jochen (gone - plz use gerrit)
lgtm
5 years, 5 months ago (2015-07-13 11:08:48 UTC) #3
jeremyim
https://codereview.chromium.org/1221663009/diff/100001/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h File chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h (right): https://codereview.chromium.org/1221663009/diff/100001/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h#newcode61 chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h:61: // request context getter, and task runner. Update comment ...
5 years, 5 months ago (2015-07-13 20:19:41 UTC) #4
Not at Google. Contact bengr
https://codereview.chromium.org/1221663009/diff/100001/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h File chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h (right): https://codereview.chromium.org/1221663009/diff/100001/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h#newcode61 chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h:61: // request context getter, and task runner. On 2015/07/13 ...
5 years, 5 months ago (2015-07-14 16:41:31 UTC) #5
jeremyim
https://codereview.chromium.org/1221663009/diff/100001/chrome/browser/renderer_context_menu/render_view_context_menu_unittest.cc File chrome/browser/renderer_context_menu/render_view_context_menu_unittest.cc (right): https://codereview.chromium.org/1221663009/diff/100001/chrome/browser/renderer_context_menu/render_view_context_menu_unittest.cc#newcode396 chrome/browser/renderer_context_menu/render_view_context_menu_unittest.cc:396: base::ThreadTaskRunnerHandle::Get()); On 2015/07/14 16:41:30, kundaji wrote: > On 2015/07/13 ...
5 years, 5 months ago (2015-07-14 22:39:54 UTC) #6
jeremyim
https://codereview.chromium.org/1221663009/diff/200001/android_webview/browser/aw_browser_context.cc File android_webview/browser/aw_browser_context.cc (right): https://codereview.chromium.org/1221663009/diff/200001/android_webview/browser/aw_browser_context.cc#newcode399 android_webview/browser/aw_browser_context.cc:399: base::SequencedWorkerPool::SKIP_ON_SHUTDOWN); This shouldn't be necessary, as drp_service_ already has ...
5 years, 5 months ago (2015-07-14 23:06:04 UTC) #7
Not at Google. Contact bengr
https://codereview.chromium.org/1221663009/diff/100001/chrome/browser/renderer_context_menu/render_view_context_menu_unittest.cc File chrome/browser/renderer_context_menu/render_view_context_menu_unittest.cc (right): https://codereview.chromium.org/1221663009/diff/100001/chrome/browser/renderer_context_menu/render_view_context_menu_unittest.cc#newcode396 chrome/browser/renderer_context_menu/render_view_context_menu_unittest.cc:396: base::ThreadTaskRunnerHandle::Get()); On 2015/07/14 22:39:54, jeremyim wrote: > On 2015/07/14 ...
5 years, 5 months ago (2015-07-15 00:08:17 UTC) #8
jeremyim
https://codereview.chromium.org/1221663009/diff/240001/components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats.cc File components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats.cc (right): https://codereview.chromium.org/1221663009/diff/240001/components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats.cc#newcode375 components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats.cc:375: : service_(service), It would be nice if we could ...
5 years, 5 months ago (2015-07-15 00:36:18 UTC) #9
Not at Google. Contact bengr
https://codereview.chromium.org/1221663009/diff/240001/components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats.cc File components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats.cc (right): https://codereview.chromium.org/1221663009/diff/240001/components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats.cc#newcode375 components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats.cc:375: : service_(service), On 2015/07/15 00:36:18, jeremyim wrote: > It ...
5 years, 5 months ago (2015-07-15 17:46:54 UTC) #10
jeremyim
lgtm
5 years, 5 months ago (2015-07-15 20:10:10 UTC) #11
sgurun-gerrit only
On 2015/07/15 20:10:10, jeremyim wrote: > lgtm lgtm
5 years, 5 months ago (2015-07-15 20:37:54 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1221663009/260001
5 years, 5 months ago (2015-07-15 20:40:26 UTC) #15
commit-bot: I haz the power
Committed patchset #14 (id:260001)
5 years, 5 months ago (2015-07-15 21:06:51 UTC) #16
commit-bot: I haz the power
Patchset 14 (id:??) landed as https://crrev.com/2ac5656adb9cb3e68127cdc118756de2879454f5 Cr-Commit-Position: refs/heads/master@{#338914}
5 years, 5 months ago (2015-07-15 21:08:56 UTC) #17
Not at Google. Contact bengr
5 years, 5 months ago (2015-07-15 22:34:09 UTC) #18
Message was sent while issue was closed.
https://codereview.chromium.org/1221663009/diff/100001/chrome/browser/rendere...
File chrome/browser/renderer_context_menu/render_view_context_menu_unittest.cc
(right):

https://codereview.chromium.org/1221663009/diff/100001/chrome/browser/rendere...
chrome/browser/renderer_context_menu/render_view_context_menu_unittest.cc:396:
base::ThreadTaskRunnerHandle::Get());
On 2015/07/15 00:08:17, kundaji wrote:
> On 2015/07/14 22:39:54, jeremyim wrote:
> > On 2015/07/14 16:41:30, kundaji wrote:
> > > On 2015/07/13 20:19:40, jeremyim wrote:
> > > > It would be nice (but not necessary) if more of the boilerplate could be
> > > removed
> > > > (possibly by having drp_test_context_ expose a method to initialize an
> > > external
> > > > settings object).
> > > 
> > > It seems confusing to have 2 settings objects, so I am hesitant to put
code
> in
> > > drp_test_context_ that encourages this.
> > > 
> > > Also, the DRPChromeSettings::InitDRPSettings is only called from this
test,
> so
> > > doesn't get us any reduction in total code lines.
> > > 
> > > Ideally, the builder would take an external DRPChromeSettings object.
> > 
> > I'm not looking for reduction in total code lines; I'm looking for a way
that
> > changes in the way DRP classes are hooked up don't bleed into test code
> > (especially outside of the DRP component) and require updates elsewhere.
> > 
> > Having the builder take an external DRPChromeSettings seems like a great
idea;
> > it might have solved the previous issues you had trying to get the test to
> work.
> > =)
> 
> Sounds good. I'll do this in a separate cl.

Jeremy: I investigated this further. Moving initialization of DRPChromeSettings
to DRPTestContext will add a dependency (in DRPTestContext) on the following
files:
       
'../chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc',
       
'../chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h',
        '../chrome/common/pref_names.cc',
        '../chrome/common/pref_names.h',
        '../chrome/browser/browser_process.cc',
        '../chrome/browser/browser_process.h',
        '../chrome/browser/metrics/chrome_metrics_service_accessor.cc',
        '../chrome/browser/metrics/chrome_metrics_service_accessor.h',
        '../chrome/browser/profiles/profile.cc',
        '../chrome/browser/profiles/profile.h',
        '../chrome/browser/profiles/profile_manager.cc',
        '../chrome/browser/profiles/profile_manager.h',
        '../chrome/common/pref_names.cc',
        '../chrome/common/pref_names.h',
With this in mind, I don't think this is a good idea. What do you think?

Powered by Google App Engine
This is Rietveld 408576698