New issue
Advanced search Search tips

Issue 616593 link

Starred by 1 user

Issue metadata

Status: Started
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 2
Type: Bug



Sign in to add a comment

ExtensionFunctions must respond exactly once

Project Member Reported by rdevlin....@chromium.org, Jun 1 2016

Issue description

ExtensionFunctions should respond exactly once.

If they never respond, it results in
a) a leak in the renderer
b) never calling back into the extension
c) general confusion

If they respond more than once, it results in breaking assumptions on the renderer and browser side, in addition to the question of which response was correct.

Instead, each function should respond exactly once.
 
Components: Platform>Extensions
Labels: -Pri-3 OS-Chrome OS-Mac OS-Windows Pri-2
Project Member

Comment 2 by bugdroid1@chromium.org, Jun 3 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7d873db838bd65a60ac84a236a4845f18d0dc895

commit 7d873db838bd65a60ac84a236a4845f18d0dc895
Author: rdevlin.cronin <rdevlin.cronin@chromium.org>
Date: Fri Jun 03 02:41:29 2016

[Extensions] DCHECK that ExtensionFunctions respond (and only once)

If an ExtensionFunction never responds, it means that there's a leak on
the renderer side where we never clean up after the request, not to
mention the fact that the extension calling the API is left hanging.
DCHECK() that every extension function responds. Conversely, if the
function responds twice, we send multiple IPCs and have to reserialize
all the response values, in addition to the fact that it meant the
function likely responded before work was done or with an incomplete
response.

Most of this involves changes to test or private code, but there are a
few places where this affects real APIs.

One significant change apart from general cleanup is to add a boolean
to the NOTIFICATION_EXTENSION_TEST_MESSAGE details allowing the
receiver to indicate whether or not they will respond. If no receiver
indicates they will respond, the function returns immediately.

BUG=616593
TBR=stevenjb@chromium.org (c/b/chromeos, c/b/ui/webui/chromeos)
TBR=atwilson@chromium.org (c/b/policy)
TBR=raymes@chromium.org (c/t/ppapi)

Review-Url: https://codereview.chromium.org/2017113002
Cr-Commit-Position: refs/heads/master@{#397594}

[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/chrome/browser/apps/app_window_interactive_uitest.cc
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/chrome/browser/chromeos/extensions/echo_private_api.cc
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/chrome/browser/chromeos/extensions/input_method_apitest_chromeos.cc
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/chrome/browser/chromeos/extensions/wallpaper_private_api.cc
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/chrome/browser/chromeos/extensions/wallpaper_private_api.h
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/chrome/browser/chromeos/extensions/wallpaper_private_api_unittest.cc
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/chrome/browser/chromeos/file_manager/file_manager_browsertest_base.cc
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/chrome/browser/extensions/api/activity_log_private/activity_log_private_api.cc
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/chrome/browser/extensions/api/activity_log_private/activity_log_private_api.h
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_apitest.cc
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/chrome/browser/extensions/api/bookmark_manager_private/bookmark_manager_private_api.cc
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/chrome/browser/extensions/api/bookmark_manager_private/bookmark_manager_private_api.h
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/chrome/browser/extensions/api/declarative_content/set_icon_apitest.cc
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/chrome/browser/extensions/api/downloads/downloads_api.cc
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/chrome/browser/extensions/api/extension_action/browser_action_interactive_test.cc
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/chrome/browser/extensions/api/hotword_private/hotword_private_apitest.cc
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/chrome/browser/extensions/api/identity/identity_apitest.cc
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/chrome/browser/extensions/api/networking_private/networking_private_chromeos_apitest.cc
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/chrome/browser/extensions/api/screenlock_private/screenlock_private_apitest.cc
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/chrome/browser/extensions/api/sync_file_system/sync_file_system_apitest.cc
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/chrome/browser/extensions/api/web_request/web_request_apitest.cc
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/chrome/browser/extensions/api/web_view/chrome_web_view_internal_api.cc
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/chrome/browser/extensions/api/web_view/chrome_web_view_internal_api.h
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/chrome/browser/extensions/extension_messages_apitest.cc
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/chrome/browser/extensions/lazy_background_page_apitest.cc
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/chrome/browser/policy/cloud/component_cloud_policy_browsertest.cc
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/chrome/browser/ui/webui/chromeos/bluetooth_pairing_ui_browsertest-inl.h
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/chrome/test/data/extensions/api_test/browser_action/open_popup/open_popup_fails.js
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/chrome/test/data/extensions/api_test/browser_action/open_popup/open_popup_succeeds.js
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/chrome/test/data/extensions/api_test/hotword_private/audioHistory/test.js
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/chrome/test/data/extensions/api_test/socket/api/background.js
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/chrome/test/ppapi/ppapi_browsertest.cc
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/extensions/browser/api/bluetooth/bluetooth_private_api.cc
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/extensions/browser/api/bluetooth/bluetooth_private_api.h
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/extensions/browser/api/bluetooth_socket/bluetooth_socket_api.cc
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/extensions/browser/api/guest_view/app_view/app_view_guest_internal_api.cc
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/extensions/browser/api/guest_view/app_view/app_view_guest_internal_api.h
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/extensions/browser/api/guest_view/web_view/web_view_internal_api.cc
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/extensions/browser/api/guest_view/web_view/web_view_internal_api.h
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/extensions/browser/api/socket/tcp_socket.cc
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/extensions/browser/api/socket/udp_socket.cc
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/extensions/browser/api/sockets_udp/udp_socket_event_dispatcher.cc
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/extensions/browser/api/test/test_api.cc
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/extensions/browser/api/test/test_api.h
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/extensions/browser/api_test_utils.cc
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/extensions/browser/extension_function.cc
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/extensions/browser/extension_function.h
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/extensions/browser/extension_function_dispatcher.cc
[modify] https://crrev.com/7d873db838bd65a60ac84a236a4845f18d0dc895/extensions/test/extension_test_message_listener.cc

Cc: -asargent@chromium.org

Sign in to add a comment