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

Issue 1169223002: [Extensions] Clean up the handling of ExtensionHostMsg_Request (Closed)

Created:
5 years, 6 months ago by Devlin
Modified:
5 years, 6 months ago
CC:
chromium-reviews, extensions-reviews_chromium.org, jennb, sadrul, benjhayden+dwatch_chromium.org, tfarina, Dmitry Titov, dcheng, noyau+watch_chromium.org, jianli, kalyank, chromium-apps-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Extensions] Clean up the handling of ExtensionHostMsg_Request ExtensionHostMsg_Request is sent when an extension calls an API function. Before this patch, this IPC would be sent to one of 11 different call sites, all of which then routed it to the ExtensionFunctionDispatcher - and all of which have to implement ExtensionFunctionDispatcher::Delegate. Instead, have ExtensionWebContentsObserver handle the IPC, since it is created (or should be) for all extension web contents. This also lets us eliminate many (though not all) of the ExtensionFunctionDispatcher::Delegate implementations (I will try to clean more up in a later patch). The size of this patch is due to a number of yaks that needed shaving along the way - in particular, around GuestView. BUG=498017 BUG=405246 Committed: https://crrev.com/cb2ec659ab8741962f3391970a5fff512ebb6509 Cr-Commit-Position: refs/heads/master@{#333843}

Patch Set 1 : #

Patch Set 2 : #

Patch Set 3 : Latest master #

Total comments: 17

Patch Set 4 : Ben's #

Patch Set 5 : Latest master #

Unified diffs Side-by-side diffs Delta from patch set Stats (+258 lines, -629 lines) Patch
M apps/custom_launcher_page_contents.h View 3 chunks +1 line, -17 lines 0 comments Download
M apps/custom_launcher_page_contents.cc View 2 chunks +0 lines, -30 lines 0 comments Download
M chrome/browser/extensions/api/bookmark_manager_private/bookmark_manager_private_api.cc View 2 chunks +2 lines, -4 lines 0 comments Download
M chrome/browser/extensions/api/bookmarks/bookmarks_api.cc View 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/extensions/api/chrome_extensions_api_client.h View 1 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/chrome_extensions_api_client.cc View 1 4 chunks +34 lines, -8 lines 0 comments Download
M chrome/browser/extensions/api/downloads/downloads_api.cc View 1 2 3 3 chunks +3 lines, -4 lines 0 comments Download
M chrome/browser/extensions/api/tabs/ash_panel_contents.h View 3 chunks +2 lines, -16 lines 0 comments Download
M chrome/browser/extensions/api/tabs/ash_panel_contents.cc View 4 chunks +4 lines, -30 lines 0 comments Download
M chrome/browser/extensions/api/tabs/tabs_api.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/api/tabs/windows_util.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/chrome_extension_function.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/extensions/chrome_extension_function_details.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/extensions/chrome_extension_web_contents_observer.h View 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/extensions/chrome_extensions_browser_client.h View 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/extensions/chrome_extensions_browser_client.cc View 2 chunks +7 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_function_test_utils.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/extensions/tab_helper.h View 1 2 3 4 2 chunks +0 lines, -4 lines 0 comments Download
M chrome/browser/extensions/tab_helper.cc View 1 2 3 4 6 chunks +8 lines, -7 lines 0 comments Download
M chrome/browser/guest_view/extension_options/chrome_extension_options_guest_delegate.h View 1 1 chunk +0 lines, -2 lines 0 comments Download
M chrome/browser/guest_view/extension_options/chrome_extension_options_guest_delegate.cc View 1 2 chunks +0 lines, -6 lines 0 comments Download
D chrome/browser/guest_view/extension_view/chrome_extension_view_guest_delegate.h View 1 1 chunk +0 lines, -27 lines 0 comments Download
D chrome/browser/guest_view/extension_view/chrome_extension_view_guest_delegate.cc View 1 1 chunk +0 lines, -25 lines 0 comments Download
M chrome/browser/guest_view/mime_handler_view/chrome_mime_handler_view_guest_delegate.h View 1 1 chunk +1 line, -4 lines 0 comments Download
M chrome/browser/guest_view/mime_handler_view/chrome_mime_handler_view_guest_delegate.cc View 1 1 chunk +1 line, -36 lines 0 comments Download
M chrome/browser/guest_view/web_view/chrome_web_view_guest_delegate.h View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/guest_view/web_view/chrome_web_view_guest_delegate.cc View 1 2 2 chunks +0 lines, -30 lines 0 comments Download
M chrome/browser/ui/ash/ash_keyboard_controller_proxy.h View 3 chunks +1 line, -12 lines 0 comments Download
M chrome/browser/ui/ash/ash_keyboard_controller_proxy.cc View 1 2 3 4 4 chunks +0 lines, -30 lines 0 comments Download
M chrome/browser/ui/panels/panel_host.h View 2 chunks +0 lines, -5 lines 0 comments Download
M chrome/browser/ui/panels/panel_host.cc View 3 chunks +2 lines, -18 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 1 chunk +0 lines, -2 lines 0 comments Download
M extensions/browser/api/extensions_api_client.h View 1 3 chunks +5 lines, -7 lines 0 comments Download
M extensions/browser/api/extensions_api_client.cc View 1 2 chunks +4 lines, -6 lines 0 comments Download
M extensions/browser/api/mime_handler_private/mime_handler_private_unittest.cc View 1 chunk +1 line, -0 lines 0 comments Download
M extensions/browser/api_test_utils.cc View 4 chunks +3 lines, -17 lines 0 comments Download
M extensions/browser/app_window/app_window.h View 4 chunks +8 lines, -0 lines 0 comments Download
M extensions/browser/app_window/app_window.cc View 3 chunks +12 lines, -0 lines 0 comments Download
M extensions/browser/app_window/app_window_contents.h View 3 chunks +2 lines, -9 lines 0 comments Download
M extensions/browser/app_window/app_window_contents.cc View 3 chunks +4 lines, -18 lines 0 comments Download
M extensions/browser/app_window/test_app_window_contents.h View 1 chunk +1 line, -0 lines 0 comments Download
M extensions/browser/app_window/test_app_window_contents.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M extensions/browser/extension_function.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M extensions/browser/extension_function_dispatcher.h View 1 2 3 2 chunks +11 lines, -6 lines 0 comments Download
M extensions/browser/extension_function_dispatcher.cc View 1 2 3 4 3 chunks +20 lines, -6 lines 0 comments Download
M extensions/browser/extension_host.h View 2 chunks +0 lines, -3 lines 0 comments Download
M extensions/browser/extension_host.cc View 5 chunks +4 lines, -6 lines 0 comments Download
M extensions/browser/extension_web_contents_observer.h View 4 chunks +21 lines, -1 line 0 comments Download
M extensions/browser/extension_web_contents_observer.cc View 3 chunks +30 lines, -1 line 0 comments Download
M extensions/browser/extensions_browser_client.h View 2 chunks +5 lines, -0 lines 0 comments Download
M extensions/browser/guest_view/app_view/app_view_guest.h View 5 chunks +1 line, -13 lines 0 comments Download
M extensions/browser/guest_view/app_view/app_view_guest.cc View 1 3 chunks +1 line, -24 lines 0 comments Download
M extensions/browser/guest_view/extension_options/extension_options_guest.h View 4 chunks +1 line, -10 lines 0 comments Download
M extensions/browser/guest_view/extension_options/extension_options_guest.cc View 1 4 chunks +1 line, -25 lines 0 comments Download
M extensions/browser/guest_view/extension_options/extension_options_guest_delegate.h View 1 1 chunk +0 lines, -3 lines 0 comments Download
M extensions/browser/guest_view/extension_view/extension_view_guest.h View 1 3 chunks +1 line, -9 lines 0 comments Download
M extensions/browser/guest_view/extension_view/extension_view_guest.cc View 1 3 chunks +2 lines, -25 lines 0 comments Download
D extensions/browser/guest_view/extension_view/extension_view_guest_delegate.h View 1 1 chunk +0 lines, -34 lines 0 comments Download
D extensions/browser/guest_view/extension_view/extension_view_guest_delegate.cc View 1 1 chunk +0 lines, -17 lines 0 comments Download
M extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h View 4 chunks +2 lines, -11 lines 0 comments Download
M extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc View 1 3 chunks +1 line, -29 lines 0 comments Download
M extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest_delegate.h View 1 1 chunk +1 line, -4 lines 0 comments Download
M extensions/browser/guest_view/web_view/web_view_guest.h View 1 2 3 4 1 chunk +0 lines, -2 lines 0 comments Download
M extensions/browser/guest_view/web_view/web_view_guest.cc View 1 2 3 4 2 chunks +2 lines, -7 lines 0 comments Download
M extensions/browser/guest_view/web_view/web_view_guest_delegate.h View 1 2 1 chunk +0 lines, -3 lines 0 comments Download
M extensions/browser/test_extensions_browser_client.h View 1 chunk +2 lines, -0 lines 0 comments Download
M extensions/browser/test_extensions_browser_client.cc View 1 chunk +6 lines, -0 lines 0 comments Download
M extensions/extensions.gypi View 1 2 3 4 1 chunk +0 lines, -2 lines 0 comments Download
M extensions/shell/browser/shell_app_delegate.cc View 2 chunks +2 lines, -0 lines 0 comments Download
M extensions/shell/browser/shell_extensions_api_client.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M extensions/shell/browser/shell_extensions_api_client.cc View 1 1 chunk +6 lines, -0 lines 0 comments Download
M extensions/shell/browser/shell_extensions_browser_client.h View 1 chunk +2 lines, -0 lines 0 comments Download
M extensions/shell/browser/shell_extensions_browser_client.cc View 2 chunks +7 lines, -0 lines 0 comments Download

Messages

Total messages: 20 (7 generated)
Devlin
Hey Ben - Sorry for the size. On the upside, it really is a nice ...
5 years, 6 months ago (2015-06-09 22:18:02 UTC) #4
Devlin
patch failure... sad day. Patch set 1 has a green try, and not much has ...
5 years, 6 months ago (2015-06-09 22:26:43 UTC) #5
Devlin
+Fady guest_view/ +Sky for ui/
5 years, 6 months ago (2015-06-10 18:32:35 UTC) #7
not at google - send to devlin
Looks great to me, this is a huge cleanup. I doubt I'll have many more ...
5 years, 6 months ago (2015-06-10 18:37:49 UTC) #8
sky
LGTM
5 years, 6 months ago (2015-06-10 19:43:01 UTC) #9
not at google - send to devlin
Finished. 1 main comment, apologies if missing something obvious in the SupportsUserData machinations. https://codereview.chromium.org/1169223002/diff/80001/chrome/browser/extensions/chrome_extension_function_details.cc File ...
5 years, 6 months ago (2015-06-10 20:48:13 UTC) #10
Fady Samuel
https://codereview.chromium.org/1169223002/diff/80001/chrome/browser/guest_view/web_view/chrome_web_view_guest_delegate.cc File chrome/browser/guest_view/web_view/chrome_web_view_guest_delegate.cc (left): https://codereview.chromium.org/1169223002/diff/80001/chrome/browser/guest_view/web_view/chrome_web_view_guest_delegate.cc#oldcode89 chrome/browser/guest_view/web_view/chrome_web_view_guest_delegate.cc:89: } Wow, have you moved all of this into ...
5 years, 6 months ago (2015-06-10 20:51:18 UTC) #11
Devlin
https://codereview.chromium.org/1169223002/diff/80001/chrome/browser/extensions/api/downloads/downloads_api.cc File chrome/browser/extensions/api/downloads/downloads_api.cc (right): https://codereview.chromium.org/1169223002/diff/80001/chrome/browser/extensions/api/downloads/downloads_api.cc#newcode1248 chrome/browser/extensions/api/downloads/downloads_api.cc:1248: dispatcher()->GetVisibleWebContents(); On 2015/06/10 18:37:49, kalman wrote: > I think ...
5 years, 6 months ago (2015-06-10 20:59:20 UTC) #12
not at google - send to devlin
lgtm https://codereview.chromium.org/1169223002/diff/80001/chrome/browser/extensions/tab_helper.cc File chrome/browser/extensions/tab_helper.cc (right): https://codereview.chromium.org/1169223002/diff/80001/chrome/browser/extensions/tab_helper.cc#newcode111 chrome/browser/extensions/tab_helper.cc:111: set_delegate(this); On 2015/06/10 20:59:20, Devlin wrote: > On ...
5 years, 6 months ago (2015-06-10 21:37:07 UTC) #13
Fady Samuel
Thanks for clarifying your change offline, Devlin! LGTM
5 years, 6 months ago (2015-06-10 21:37:44 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1169223002/140001
5 years, 6 months ago (2015-06-10 22:06:21 UTC) #18
commit-bot: I haz the power
Committed patchset #5 (id:140001)
5 years, 6 months ago (2015-06-10 23:32:49 UTC) #19
commit-bot: I haz the power
5 years, 6 months ago (2015-06-10 23:34:02 UTC) #20
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/cb2ec659ab8741962f3391970a5fff512ebb6509
Cr-Commit-Position: refs/heads/master@{#333843}

Powered by Google App Engine
This is Rietveld 408576698