Extension requests (i.e., API calls) include the "source tab id" in the message params [1]. However, since this message is routed through a render frame, we shouldn't need to include the tab id - the browser should know it. What's more, the current source tab id is retrieved from the request sender [2], which only has it set for messaging calls [3]... which is all very wrong. [1] https://chromium.googlesource.com/chromium/src/+/ff516ab47c3fe130da26006e0f677ee5a78a9f19/extensions/common/extension_messages.h#104 [2] https://chromium.googlesource.com/chromium/src/+/ff516ab47c3fe130da26006e0f677ee5a78a9f19/extensions/renderer/request_sender.cc#114 [3] https://chromium.googlesource.com/chromium/src/+/ff516ab47c3fe130da26006e0f677ee5a78a9f19/extensions/renderer/dispatcher.cc#1039
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/ae224f1bfe3875919fa6c79130a31affb6e01f2f commit ae224f1bfe3875919fa6c79130a31affb6e01f2f Author: rdevlin.cronin <rdevlin.cronin@chromium.org> Date: Wed Nov 23 02:58:08 2016 [Extensions] Remove ChromeExtensionFunctionDetails::GetOriginWebContents Remove the ChromeExtensionFunctionDetails::GetOriginWebContents() method. There are a few problems with this function: - Like GetAssociatedWebContents(), it is unclear and unpredictable (see also crbug.com/461394 ). It's not obvious what the returned result will be, and it's very likely *not* what the caller is expecting from the title or function comment. - It uses ExtensionFunction::source_tab_id, which needs to be removed. Remove the function and implement the necessary pieces directly in the previous callers. BUG= 667584 Review-Url: https://codereview.chromium.org/2521363002 Cr-Commit-Position: refs/heads/master@{#434097} [modify] https://crrev.com/ae224f1bfe3875919fa6c79130a31affb6e01f2f/chrome/browser/extensions/api/media_galleries/media_galleries_api.cc [modify] https://crrev.com/ae224f1bfe3875919fa6c79130a31affb6e01f2f/chrome/browser/extensions/chrome_extension_function_details.cc [modify] https://crrev.com/ae224f1bfe3875919fa6c79130a31affb6e01f2f/chrome/browser/extensions/chrome_extension_function_details.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/5eb66dfa480bed01684c4ae1e44599e613e9d5a6 commit 5eb66dfa480bed01684c4ae1e44599e613e9d5a6 Author: rdevlin.cronin <rdevlin.cronin@chromium.org> Date: Mon Nov 28 18:04:54 2016 [Extensions] Remove the source_tab_id property on API request messages ExtensionHostMsg_Request_Params includes a "source_tab_id", but this shouldn't be necessary. The browser can determine the tab id from which RFH sent the request. Remove the property. BUG= 667584 Review-Url: https://codereview.chromium.org/2522763005 Cr-Commit-Position: refs/heads/master@{#434688} [modify] https://crrev.com/5eb66dfa480bed01684c4ae1e44599e613e9d5a6/extensions/browser/extension_function.cc [modify] https://crrev.com/5eb66dfa480bed01684c4ae1e44599e613e9d5a6/extensions/browser/extension_function.h [modify] https://crrev.com/5eb66dfa480bed01684c4ae1e44599e613e9d5a6/extensions/browser/extension_function_dispatcher.cc [modify] https://crrev.com/5eb66dfa480bed01684c4ae1e44599e613e9d5a6/extensions/common/extension_messages.h [modify] https://crrev.com/5eb66dfa480bed01684c4ae1e44599e613e9d5a6/extensions/renderer/native_extension_bindings_system.cc [modify] https://crrev.com/5eb66dfa480bed01684c4ae1e44599e613e9d5a6/extensions/renderer/native_extension_bindings_system_unittest.cc [modify] https://crrev.com/5eb66dfa480bed01684c4ae1e44599e613e9d5a6/extensions/renderer/request_sender.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/34f2af6b36662f9fed5bccae0460901493e2a608 commit 34f2af6b36662f9fed5bccae0460901493e2a608 Author: rdevlin.cronin <rdevlin.cronin@chromium.org> Date: Thu Dec 01 02:59:47 2016 [Extensions] Remove source/opener tab id from extension ports The message parameter source_tab_id is no longer used; remove it. By extension, also remove the opener_tab_id_ property from ExtensionMessagePorts. BUG= 667584 Review-Url: https://codereview.chromium.org/2540533002 Cr-Commit-Position: refs/heads/master@{#435538} [modify] https://crrev.com/34f2af6b36662f9fed5bccae0460901493e2a608/chrome/browser/extensions/api/messaging/extension_message_port.cc [modify] https://crrev.com/34f2af6b36662f9fed5bccae0460901493e2a608/chrome/browser/extensions/api/messaging/extension_message_port.h [modify] https://crrev.com/34f2af6b36662f9fed5bccae0460901493e2a608/extensions/common/extension_messages.h [modify] https://crrev.com/34f2af6b36662f9fed5bccae0460901493e2a608/extensions/renderer/dispatcher.cc [modify] https://crrev.com/34f2af6b36662f9fed5bccae0460901493e2a608/extensions/renderer/dispatcher.h [modify] https://crrev.com/34f2af6b36662f9fed5bccae0460901493e2a608/extensions/renderer/extension_frame_helper.cc [modify] https://crrev.com/34f2af6b36662f9fed5bccae0460901493e2a608/extensions/renderer/extension_frame_helper.h
Comment 1 by bugdroid1@chromium.org
, Nov 23 2016