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

Issue 155071: Do some refactoring of renderer_host.... (Closed)

Created:
11 years, 5 months ago by brettw
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com, John Grabowski, Erik does not do reviews, Paul Godavari, Ben Goodger (Google)
Visibility:
Public.

Description

Do some refactoring of renderer_host. This removes the last dependency on tab_contents from the renderer_host code and into the RenderViewHostDelegate. Some of the tests depended on tab_contents, so I moved to a new directory with the tab_contents include allowed via DEPS. Now DEPS can enforce that no additional tab_contents includes are added to renderer_host. RenderViewHost delegate is now pure virtual. After spending a while *again* figuring out why my code didn't work, only to find it was because the default implementation of a function was getting called instead of the real one, I decided to make this pure virtual. It is implemented by TabContents, which implements basically everything, and two other places that implement less. Only two lists of duplicate functions seems not too bad, although long-term it would be nice if this delegate was somehow more succinct. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=19982

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+551 lines, -1279 lines) Patch
M chrome/browser/back_forward_menu_model_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/blocked_popup_container_unittest.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/cocoa/blocked_popup_container_controller_unittest.mm View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/debugger/devtools_manager_unittest.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/dom_ui/dom_ui_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/download/download_request_manager_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/download/save_package.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/extensions/extension_host.h View 1 chunk +118 lines, -11 lines 0 comments Download
M chrome/browser/extensions/extension_host.cc View 3 chunks +34 lines, -27 lines 0 comments Download
M chrome/browser/find_backend_unittest.cc View 1 1 chunk +1 line, -1 line 0 comments Download
A chrome/browser/renderer_host/DEPS View 1 chunk +12 lines, -0 lines 0 comments Download
M chrome/browser/renderer_host/cross_site_resource_handler.cc View 4 chunks +17 lines, -16 lines 0 comments Download
M chrome/browser/renderer_host/render_view_host_delegate.h View 10 chunks +91 lines, -96 lines 1 comment Download
D chrome/browser/renderer_host/render_view_host_manager_browsertest.cc View 1 chunk +0 lines, -112 lines 0 comments Download
D chrome/browser/renderer_host/render_view_host_unittest.cc View 1 chunk +0 lines, -17 lines 0 comments Download
M chrome/browser/renderer_host/render_widget_host_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/renderer_host/resource_dispatcher_host.h View 5 chunks +7 lines, -6 lines 0 comments Download
M chrome/browser/renderer_host/resource_dispatcher_host.cc View 4 chunks +4 lines, -4 lines 0 comments Download
D chrome/browser/renderer_host/site_instance_unittest.cc View 1 chunk +0 lines, -458 lines 0 comments Download
A chrome/browser/renderer_host/test/DEPS View 1 chunk +4 lines, -0 lines 0 comments Download
A chrome/browser/renderer_host/test/README.txt View 1 chunk +4 lines, -0 lines 0 comments Download
A + chrome/browser/renderer_host/test/render_view_host_manager_browsertest.cc View 0 chunks +-1 lines, --1 lines 0 comments Download
A + chrome/browser/renderer_host/test/render_view_host_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
A + chrome/browser/renderer_host/test/site_instance_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
A + chrome/browser/renderer_host/test/test_render_view_host.h View 1 2 chunks +3 lines, -3 lines 0 comments Download
A + chrome/browser/renderer_host/test/test_render_view_host.cc View 1 chunk +1 line, -1 line 0 comments Download
D chrome/browser/renderer_host/test_render_view_host.h View 1 chunk +0 lines, -252 lines 0 comments Download
D chrome/browser/renderer_host/test_render_view_host.cc View 1 chunk +0 lines, -101 lines 0 comments Download
D chrome/browser/renderer_host/web_cache_manager_browser_test.cc View 1 chunk +0 lines, -61 lines 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sessions/tab_restore_service_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/tab_contents/interstitial_page.h View 1 chunk +122 lines, -10 lines 0 comments Download
M chrome/browser/tab_contents/interstitial_page.cc View 2 chunks +86 lines, -66 lines 0 comments Download
M chrome/browser/tab_contents/navigation_controller_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/tab_contents/render_view_host_manager_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/tab_contents/tab_contents.h View 1 6 chunks +7 lines, -9 lines 0 comments Download
M chrome/browser/tab_contents/tab_contents.cc View 5 chunks +16 lines, -5 lines 0 comments Download
M chrome/browser/tab_contents/test_web_contents.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/tab_contents/thumbnail_generator_unittest.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/tab_contents/web_contents_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/tabs/tab_strip_model_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/chrome.gyp View 3 chunks +7 lines, -7 lines 0 comments Download
M chrome/test/browser_with_test_window_test.h View 1 chunk +1 line, -1 line 0 comments Download
A + chrome\browser\renderer_host\test\web_cache_manager_browsertest.cc View 0 chunks +-1 lines, --1 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
brettw
11 years, 5 months ago (2009-07-04 16:26:05 UTC) #1
Aaron Boodman
http://codereview.chromium.org/155071/diff/1025/124 File chrome/browser/renderer_host/render_view_host_delegate.h (left): http://codereview.chromium.org/155071/diff/1025/124#oldcode169 Line 169: virtual void RenderViewCreated(RenderViewHost* render_view_host) { } Why change ...
11 years, 5 months ago (2009-07-04 16:42:25 UTC) #2
brettw
RenderViewHostDelegate is an interface, and I just don't think interfaces should provide default implementations "for ...
11 years, 5 months ago (2009-07-04 17:14:26 UTC) #3
brettw
In general you'll only copy and paste the empty implementation, which won't have any bugs. ...
11 years, 5 months ago (2009-07-04 18:14:15 UTC) #4
Ben Goodger (Google)
OK
11 years, 5 months ago (2009-07-06 02:59:09 UTC) #5
brettw
I chatted with the people in my office who convinced me Aaron is right. I'll ...
11 years, 5 months ago (2009-07-06 16:10:19 UTC) #6
darin (slow to review)
11 years, 5 months ago (2009-07-06 18:33:46 UTC) #7
On 2009/07/06 16:10:19, brettw wrote:
> I chatted with the people in my office who convinced me Aaron is right. I'll
> make them empty again.

I've been struggling with this issue myself as far as the WebKit API is
concerned.  I have in the past similarly lost a lot of time debugging an issue
caused by a subclass failing to override a base class method (slight typo,
etc.).  However, in the case of WebKit API, default implementations can help
maintain backwards compatibility as the API evolves.  That benefit doesn't
really apply within Chromium code.  What was the argument that convinced you?

Powered by Google App Engine
This is Rietveld 408576698