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

Issue 11885021: Don't derive from ChromeURLDataManager::DataSource, and instead have these classes implement a dele… (Closed)

Created:
7 years, 11 months ago by jam
Modified:
7 years, 11 months ago
Reviewers:
James Hawkins
CC:
chromium-reviews, dbeam+watch-options_chromium.org, dbeam+watch-ntp_chromium.org, vsevik, nkostylev+watch_chromium.org, yurys, joi+watch-content_chromium.org, Aaron Boodman, rginda+watch_chromium.org, darin-cc_chromium.org, pfeldman, oshima+watch_chromium.org, estade+watch_chromium.org, chromium-apps-reviews_chromium.org, stevenjb+watch_chromium.org, davemoore+watch_chromium.org, pedrosimonetti+watch_chromium.org
Visibility:
Public.

Description

Don't derive from ChromeURLDataManager::DataSource, and instead have these classes implement a delegate interface instead. Also make ChromeURLDataManager::DataSource not a nested class so that it can be forward declared. This is in preparation for hiding the URLDataSource implementation. BUG=169170 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=176711

Patch Set 1 #

Total comments: 1

Patch Set 2 : #

Patch Set 3 : fix WebUISourcesTest unittest #

Total comments: 10

Patch Set 4 : nits #

Total comments: 12

Patch Set 5 : nits #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+706 lines, -483 lines) Patch
M chrome/browser/chrome_browser_main.cc View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/chromeos/extensions/file_browser_private_api.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/extensions/wallpaper_private_api.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/api/bookmark_manager_private/bookmark_manager_private_api.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/extension_service.cc View 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/managed_mode/managed_mode_interstitial.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/printing/cloud_print/cloud_print_setup_source.h View 1 2 3 1 chunk +7 lines, -7 lines 0 comments Download
M chrome/browser/printing/cloud_print/cloud_print_setup_source.cc View 6 chunks +12 lines, -6 lines 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_blocking_page.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/webui/about_ui.h View 1 2 3 2 chunks +8 lines, -5 lines 0 comments Download
M chrome/browser/ui/webui/about_ui.cc View 1 2 3 4 16 chunks +45 lines, -35 lines 2 comments Download
M chrome/browser/ui/webui/bookmarks_ui.h View 1 2 3 2 chunks +5 lines, -4 lines 0 comments Download
M chrome/browser/ui/webui/bookmarks_ui.cc View 1 2 3 2 chunks +9 lines, -4 lines 2 comments Download
M chrome/browser/ui/webui/chrome_url_data_manager.h View 1 2 5 chunks +98 lines, -121 lines 0 comments Download
M chrome/browser/ui/webui/chrome_url_data_manager.cc View 1 2 3 4 10 chunks +28 lines, -30 lines 0 comments Download
M chrome/browser/ui/webui/chrome_url_data_manager_backend.h View 1 2 3 2 chunks +10 lines, -2 lines 0 comments Download
M chrome/browser/ui/webui/chrome_url_data_manager_backend.cc View 1 5 chunks +28 lines, -13 lines 0 comments Download
M chrome/browser/ui/webui/chrome_web_ui_data_source.h View 1 2 3 4 3 chunks +9 lines, -4 lines 0 comments Download
M chrome/browser/ui/webui/chrome_web_ui_data_source.cc View 1 2 4 chunks +13 lines, -11 lines 0 comments Download
M chrome/browser/ui/webui/chromeos/login/oobe_ui.cc View 1 2 3 6 chunks +13 lines, -8 lines 0 comments Download
M chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc View 1 2 3 6 chunks +13 lines, -8 lines 0 comments Download
M chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc View 1 2 3 4 chunks +12 lines, -7 lines 0 comments Download
M chrome/browser/ui/webui/chromeos/register_page_ui.cc View 1 2 3 5 chunks +11 lines, -7 lines 0 comments Download
M chrome/browser/ui/webui/chromeos/sim_unlock_ui.cc View 1 2 3 5 chunks +12 lines, -7 lines 0 comments Download
M chrome/browser/ui/webui/chromeos/system_info_ui.cc View 1 2 3 5 chunks +12 lines, -7 lines 0 comments Download
M chrome/browser/ui/webui/devtools_ui.cc View 1 2 3 5 chunks +15 lines, -11 lines 0 comments Download
M chrome/browser/ui/webui/extensions/extension_icon_source.h View 1 2 3 3 chunks +6 lines, -5 lines 0 comments Download
M chrome/browser/ui/webui/extensions/extension_icon_source.cc View 7 chunks +11 lines, -6 lines 0 comments Download
M chrome/browser/ui/webui/favicon_source.h View 1 2 3 3 chunks +4 lines, -13 lines 0 comments Download
M chrome/browser/ui/webui/favicon_source.cc View 5 chunks +12 lines, -19 lines 0 comments Download
M chrome/browser/ui/webui/fileicon_source.h View 1 2 3 2 chunks +4 lines, -5 lines 0 comments Download
M chrome/browser/ui/webui/fileicon_source.cc View 5 chunks +9 lines, -5 lines 0 comments Download
M chrome/browser/ui/webui/fileicon_source_unittest.cc View 1 2 chunks +1 line, -2 lines 0 comments Download
M chrome/browser/ui/webui/ntp/new_tab_ui.h View 1 2 3 3 chunks +8 lines, -6 lines 0 comments Download
M chrome/browser/ui/webui/ntp/new_tab_ui.cc View 3 chunks +7 lines, -4 lines 0 comments Download
M chrome/browser/ui/webui/ntp/ntp_resource_cache.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/webui/ntp/ntp_resource_cache_android.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/webui/ntp/thumbnail_source.h View 1 2 3 2 chunks +4 lines, -6 lines 0 comments Download
M chrome/browser/ui/webui/ntp/thumbnail_source.cc View 1 2 3 4 2 chunks +10 lines, -6 lines 0 comments Download
M chrome/browser/ui/webui/options/chromeos/user_image_source.h View 1 2 3 2 chunks +4 lines, -5 lines 0 comments Download
M chrome/browser/ui/webui/options/chromeos/user_image_source.cc View 3 chunks +9 lines, -4 lines 0 comments Download
M chrome/browser/ui/webui/options/chromeos/wallpaper_source.h View 1 2 3 2 chunks +7 lines, -4 lines 0 comments Download
M chrome/browser/ui/webui/options/chromeos/wallpaper_source.cc View 1 7 chunks +15 lines, -10 lines 0 comments Download
M chrome/browser/ui/webui/options/options_ui.cc View 1 2 3 4 chunks +11 lines, -7 lines 0 comments Download
M chrome/browser/ui/webui/profiler_ui.cc View 1 2 3 3 chunks +9 lines, -5 lines 0 comments Download
M chrome/browser/ui/webui/screenshot_source.h View 1 2 3 3 chunks +5 lines, -5 lines 0 comments Download
M chrome/browser/ui/webui/screenshot_source.cc View 4 chunks +8 lines, -3 lines 0 comments Download
M chrome/browser/ui/webui/session_favicon_source.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/webui/session_favicon_source.cc View 2 chunks +7 lines, -4 lines 0 comments Download
M chrome/browser/ui/webui/shared_resources_data_source.h View 1 2 3 1 chunk +5 lines, -3 lines 0 comments Download
M chrome/browser/ui/webui/shared_resources_data_source.cc View 2 chunks +6 lines, -3 lines 0 comments Download
M chrome/browser/ui/webui/theme_source.h View 1 2 3 2 chunks +6 lines, -7 lines 0 comments Download
M chrome/browser/ui/webui/theme_source.cc View 6 chunks +19 lines, -13 lines 0 comments Download
M chrome/browser/ui/webui/theme_source_unittest.cc View 1 2 7 chunks +28 lines, -21 lines 0 comments Download
M chrome/browser/ui/webui/web_ui_browsertest.cc View 2 chunks +8 lines, -4 lines 0 comments Download
M content/content_browser.gypi View 1 chunk +2 lines, -0 lines 0 comments Download
A content/public/browser/url_data_source_delegate.h View 1 2 3 4 1 chunk +80 lines, -0 lines 0 comments Download
A content/public/browser/url_data_source_delegate.cc View 1 chunk +31 lines, -0 lines 0 comments Download

Messages

Total messages: 13 (0 generated)
jam
https://codereview.chromium.org/11885021/diff/1/content/public/browser/url_data_source_delegate.h File content/public/browser/url_data_source_delegate.h (right): https://codereview.chromium.org/11885021/diff/1/content/public/browser/url_data_source_delegate.h#newcode14 content/public/browser/url_data_source_delegate.h:14: class ChromeWebUIDataSource; most of these forward declarations and friend'ing ...
7 years, 11 months ago (2013-01-14 17:40:28 UTC) #1
James Hawkins
Is it possible to pull this part [1] into a separate CL? [1] "Also make ...
7 years, 11 months ago (2013-01-14 18:37:33 UTC) #2
jam
On 2013/01/14 18:37:33, James Hawkins wrote: > Is it possible to pull this part [1] ...
7 years, 11 months ago (2013-01-14 18:39:47 UTC) #3
James Hawkins
https://codereview.chromium.org/11885021/diff/69/chrome/browser/ui/webui/chrome_url_data_manager.h File chrome/browser/ui/webui/chrome_url_data_manager.h (right): https://codereview.chromium.org/11885021/diff/69/chrome/browser/ui/webui/chrome_url_data_manager.h#newcode119 chrome/browser/ui/webui/chrome_url_data_manager.h:119: class URLDataSource : public base::RefCountedThreadSafe< Please pull this out ...
7 years, 11 months ago (2013-01-14 18:41:21 UTC) #4
jam
On Mon, Jan 14, 2013 at 10:41 AM, <jhawkins@chromium.org> wrote: > > https://codereview.chromium.**org/11885021/diff/69/chrome/** > browser/ui/webui/chrome_url_**data_manager.h<https://codereview.chromium.org/11885021/diff/69/chrome/browser/ui/webui/chrome_url_data_manager.h> ...
7 years, 11 months ago (2013-01-14 18:45:28 UTC) #5
James Hawkins
You get the point about period at the end in webui/. I stopped marking them ...
7 years, 11 months ago (2013-01-14 18:53:54 UTC) #6
jam
https://codereview.chromium.org/11885021/diff/74/chrome/browser/ui/webui/chrome_url_data_manager_backend.h File chrome/browser/ui/webui/chrome_url_data_manager_backend.h (right): https://codereview.chromium.org/11885021/diff/74/chrome/browser/ui/webui/chrome_url_data_manager_backend.h#newcode66 chrome/browser/ui/webui/chrome_url_data_manager_backend.h:66: static void CallStartRequest(scoped_refptr<URLDataSource>, On 2013/01/14 18:53:54, James Hawkins wrote: ...
7 years, 11 months ago (2013-01-14 19:21:18 UTC) #7
James Hawkins
Linter issues. https://codereview.chromium.org/11885021/diff/10020/chrome/browser/ui/webui/about_ui.cc File chrome/browser/ui/webui/about_ui.cc (right): https://codereview.chromium.org/11885021/diff/10020/chrome/browser/ui/webui/about_ui.cc#newcode118 chrome/browser/ui/webui/about_ui.cc:118: AboutMemoryHandler(const base::WeakPtr<AboutUIHTMLSource>& source, Need to -1 space ...
7 years, 11 months ago (2013-01-14 19:24:33 UTC) #8
jam
https://codereview.chromium.org/11885021/diff/10020/chrome/browser/ui/webui/about_ui.cc File chrome/browser/ui/webui/about_ui.cc (right): https://codereview.chromium.org/11885021/diff/10020/chrome/browser/ui/webui/about_ui.cc#newcode118 chrome/browser/ui/webui/about_ui.cc:118: AboutMemoryHandler(const base::WeakPtr<AboutUIHTMLSource>& source, On 2013/01/14 19:24:33, James Hawkins wrote: ...
7 years, 11 months ago (2013-01-14 20:25:14 UTC) #9
James Hawkins
LGTM with question. In general I'm not a fan of adding NULL checks, if possible. ...
7 years, 11 months ago (2013-01-14 20:30:25 UTC) #10
jam
https://codereview.chromium.org/11885021/diff/14032/chrome/browser/ui/webui/about_ui.cc File chrome/browser/ui/webui/about_ui.cc (right): https://codereview.chromium.org/11885021/diff/14032/chrome/browser/ui/webui/about_ui.cc#newcode207 chrome/browser/ui/webui/about_ui.cc:207: if (!source_) On 2013/01/14 20:30:25, James Hawkins wrote: > ...
7 years, 11 months ago (2013-01-14 20:33:57 UTC) #11
tfarina
https://codereview.chromium.org/11885021/diff/14032/chrome/browser/ui/webui/bookmarks_ui.cc File chrome/browser/ui/webui/bookmarks_ui.cc (right): https://codereview.chromium.org/11885021/diff/14032/chrome/browser/ui/webui/bookmarks_ui.cc#newcode60 chrome/browser/ui/webui/bookmarks_ui.cc:60: } wait, something is crazy going on here. Isn't: ...
7 years, 11 months ago (2013-01-14 20:49:11 UTC) #12
jam
7 years, 11 months ago (2013-01-14 20:52:06 UTC) #13
Message was sent while issue was closed.
https://codereview.chromium.org/11885021/diff/14032/chrome/browser/ui/webui/b...
File chrome/browser/ui/webui/bookmarks_ui.cc (right):

https://codereview.chromium.org/11885021/diff/14032/chrome/browser/ui/webui/b...
chrome/browser/ui/webui/bookmarks_ui.cc:60: }
On 2013/01/14 20:49:11, tfarina wrote:
> wait, something is crazy going on here.
> 
> 
> Isn't:
> 
> ChromeURLDataManager::AddDataSource(Profile::FromWebUI(web_ui), new
> BookmarksUIHTMLSource);
> 
> The same of:
> 
> BookmarksUIHTMLSource* html_source = new BookmarksUIHTMLSource();
> Profile* profile = Profile::FromWebUI(web_ui);
> ChromeURLDataManager::AddDataSource(profile, html_source);
> 
> ?
> 
> If I'm not seeing this wrong, you are doing the same thing twice here.

ah, thanks. i had changed it while doing another change that i later undid, and
now i went back to make the formatting the same but forgot to remove this. will
commit in a followup

Powered by Google App Engine
This is Rietveld 408576698