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

Issue 6542003: Refactor WebResourceService class, making it more generic. Move all the prom... (Closed)

Created:
9 years, 10 months ago by Zhenyao Mo
Modified:
9 years, 7 months ago
Reviewers:
Miranda Callahan
CC:
chromium-reviews, Paweł Hajdan Jr., Ken Russell (switch to Gerrit), Vangelis Kokkevis
Visibility:
Public.

Description

Refactor WebResourceService class, making it more generic. Move all the promo-related code into a new PromoResourceService class that inherits WebResourceService. This refactoring will allow us to re-use WebResourceService class for GPU Blacklist updates purpose. This CL tries to minimize the code change and adds no new logic. BUG=68802 TEST=unittest,promo functions working fine as before. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=75403

Patch Set 1 #

Patch Set 2 : clean up the includes #

Patch Set 3 : Fixing an issue in test #

Total comments: 6

Patch Set 4 : For the records #

Unified diffs Side-by-side diffs Delta from patch set Stats (+809 lines, -703 lines) Patch
M chrome/browser/dom_ui/new_tab_ui.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/dom_ui/ntp_resource_cache.cc View 4 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/dom_ui/tips_handler.cc View 1 5 chunks +9 lines, -8 lines 0 comments Download
M chrome/browser/profiles/profile.h View 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/profiles/profile.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/profiles/profile_impl.h View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/profiles/profile_impl.cc View 2 chunks +5 lines, -5 lines 0 comments Download
M chrome/browser/profiles/profile_manager.cc View 1 chunk +1 line, -1 line 0 comments Download
A chrome/browser/web_resource/promo_resource_service.h View 1 1 chunk +149 lines, -0 lines 0 comments Download
A chrome/browser/web_resource/promo_resource_service.cc View 1 2 3 1 chunk +358 lines, -0 lines 0 comments Download
A chrome/browser/web_resource/promo_resource_service_unittest.cc View 1 1 chunk +173 lines, -0 lines 0 comments Download
M chrome/browser/web_resource/web_resource_service.h View 1 2 3 5 chunks +37 lines, -137 lines 0 comments Download
M chrome/browser/web_resource/web_resource_service.cc View 1 9 chunks +51 lines, -355 lines 0 comments Download
D chrome/browser/web_resource/web_resource_service_unittest.cc View 1 chunk +0 lines, -173 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 chunk +1 line, -1 line 0 comments Download
M chrome/common/notification_type.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/common/pref_names.h View 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/common/pref_names.cc View 1 chunk +7 lines, -7 lines 0 comments Download
M chrome/test/testing_profile.h View 1 2 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 3 (0 generated)
Zhenyao Mo
Please review. Miranda, could you tell me how to tell the promo service is working ...
9 years, 10 months ago (2011-02-18 00:56:01 UTC) #1
Miranda Callahan
LGTM with fixes; I patched it in and it fetches the promo just as before. ...
9 years, 10 months ago (2011-02-18 16:59:43 UTC) #2
Zhenyao Mo
9 years, 10 months ago (2011-02-18 17:32:09 UTC) #3
Thank you very much for providing the information and help and reviewing this CL
quickly.  I really appreciate it!

http://codereview.chromium.org/6542003/diff/7006/chrome/browser/web_resource/...
File chrome/browser/web_resource/web_resource_service.h (right):

http://codereview.chromium.org/6542003/diff/7006/chrome/browser/web_resource/...
chrome/browser/web_resource/web_resource_service.h:27: int start_fetch_delay =
5000,  // 5 seconds
On 2011/02/18 16:59:43, Miranda Callahan wrote:
> The Google C++ Style Guide doesn't allow default parameters like this -- just
> pass them in, or change them to defaults and add setters if you think most
> classes will just use these values.

I removed the defaults.  Instead, I added back your original defined constant
values to the promo_resource_service.cc and use them to construct the base
class.

http://codereview.chromium.org/6542003/diff/7006/chrome/browser/web_resource/...
chrome/browser/web_resource/web_resource_service.h:67: // Data are associated
with a user's profile.
On 2011/02/18 16:59:43, Miranda Callahan wrote:
> Remove comment altogether; it's clear what a Profile is.

Done.

http://codereview.chromium.org/6542003/diff/7006/chrome/browser/web_resource/...
chrome/browser/web_resource/web_resource_service.h:84: // URL hosts the web
resource.
On 2011/02/18 16:59:43, Miranda Callahan wrote:
> "URL that hosts the web resource."

Done.

Powered by Google App Engine
This is Rietveld 408576698