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

Issue 1966283002: Remove port lifetime management from renderer (Closed)

Created:
4 years, 7 months ago by robwu
Modified:
4 years, 7 months ago
Reviewers:
Devlin, dcheng
CC:
chromium-apps-reviews_chromium.org, chromium-reviews, extensions-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Remove port lifetime management from renderer - Remove port tracking logic from the renderer because it is handled by the browser since https://codereview.chromium.org/1413543005/. - Store the source tab id on the port in the browser to remove the need for tracking the tab ID in the renderer (originally introduced with https://codereview.chromium.org/145463002). - Remove redundant onDestroy_ from messaging.js (because the event listeners are already removed as a part of the event's destroy_()). - In the browser process, ask the renderer whether a newly created opener port exists because the originating frame might have navigated since the request to create a port. BUG=475536 Committed: https://crrev.com/d1db9f61a6000339514472fe0d69c02e9917571c Cr-Commit-Position: refs/heads/master@{#395861}

Patch Set 1 #

Patch Set 2 : Simplify: Assume that opener port is open, only send reply if closed #

Total comments: 24

Patch Set 3 : Devlin's nits up to #10 #

Total comments: 2

Patch Set 4 : Devlin's nits up to #12 #

Total comments: 1

Patch Set 5 : Use MakeUnique instead of WrapUnique #

Unified diffs Side-by-side diffs Delta from patch set Stats (+165 lines, -225 lines) Patch
M chrome/browser/extensions/api/messaging/extension_message_port.h View 1 2 2 chunks +11 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/messaging/extension_message_port.cc View 1 2 3 4 5 chunks +18 lines, -3 lines 0 comments Download
M chrome/browser/extensions/api/messaging/message_service.cc View 1 1 chunk +2 lines, -1 line 0 comments Download
M extensions/common/extension_messages.h View 1 2 2 chunks +7 lines, -1 line 0 comments Download
M extensions/renderer/dispatcher.h View 3 chunks +3 lines, -6 lines 0 comments Download
M extensions/renderer/dispatcher.cc View 4 chunks +7 lines, -18 lines 0 comments Download
M extensions/renderer/extension_frame_helper.h View 1 2 2 chunks +2 lines, -0 lines 0 comments Download
M extensions/renderer/extension_frame_helper.cc View 1 2 3 chunks +8 lines, -0 lines 0 comments Download
M extensions/renderer/messaging_bindings.h View 1 2 2 chunks +7 lines, -3 lines 0 comments Download
M extensions/renderer/messaging_bindings.cc View 1 2 3 5 chunks +76 lines, -163 lines 0 comments Download
M extensions/renderer/resources/messaging.js View 1 2 10 chunks +24 lines, -30 lines 0 comments Download

Messages

Total messages: 23 (12 generated)
robwu
4 years, 7 months ago (2016-05-12 23:08:48 UTC) #8
Devlin
On 2016/05/12 23:08:48, robwu wrote: Sorry for the delay on this, Rob. I'll make sure ...
4 years, 7 months ago (2016-05-17 00:14:58 UTC) #9
Devlin
Nice! https://codereview.chromium.org/1966283002/diff/100001/chrome/browser/extensions/api/messaging/extension_message_port.h File chrome/browser/extensions/api/messaging/extension_message_port.h (right): https://codereview.chromium.org/1966283002/diff/100001/chrome/browser/extensions/api/messaging/extension_message_port.h#newcode44 chrome/browser/extensions/api/messaging/extension_message_port.h:44: // Check whether the port exists in the ...
4 years, 7 months ago (2016-05-17 19:50:30 UTC) #10
robwu
https://codereview.chromium.org/1966283002/diff/100001/chrome/browser/extensions/api/messaging/extension_message_port.h File chrome/browser/extensions/api/messaging/extension_message_port.h (right): https://codereview.chromium.org/1966283002/diff/100001/chrome/browser/extensions/api/messaging/extension_message_port.h#newcode44 chrome/browser/extensions/api/messaging/extension_message_port.h:44: // Check whether the port exists in the frames. ...
4 years, 7 months ago (2016-05-17 22:47:51 UTC) #11
Devlin
lgtm https://codereview.chromium.org/1966283002/diff/120001/chrome/browser/extensions/api/messaging/extension_message_port.cc File chrome/browser/extensions/api/messaging/extension_message_port.cc (right): https://codereview.chromium.org/1966283002/diff/120001/chrome/browser/extensions/api/messaging/extension_message_port.cc#newcode170 chrome/browser/extensions/api/messaging/extension_message_port.cc:170: new ExtensionMsg_ValidateMessagePort(MSG_ROUTING_NONE, port_id_))); It's probably worth duplicating the ...
4 years, 7 months ago (2016-05-18 17:55:09 UTC) #12
robwu
+dcheng Please review/stamp extensions/common/extension_messages.h
4 years, 7 months ago (2016-05-18 19:44:10 UTC) #14
robwu
On 2016/05/18 19:44:10, robwu wrote: > +dcheng Please review/stamp extensions/common/extension_messages.h Ping again?
4 years, 7 months ago (2016-05-24 22:37:55 UTC) #15
dcheng
ipc lgtm https://codereview.chromium.org/1966283002/diff/140001/chrome/browser/extensions/api/messaging/extension_message_port.cc File chrome/browser/extensions/api/messaging/extension_message_port.cc (right): https://codereview.chromium.org/1966283002/diff/140001/chrome/browser/extensions/api/messaging/extension_message_port.cc#newcode170 chrome/browser/extensions/api/messaging/extension_message_port.cc:170: SendToPort(base::WrapUnique( base::MakeUnique<ExtensionMsg_ValidateMessagePort>(MSG_ROUTING_NONE, port_id_)
4 years, 7 months ago (2016-05-24 23:49:15 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1966283002/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1966283002/160001
4 years, 7 months ago (2016-05-25 08:58:28 UTC) #19
commit-bot: I haz the power
Committed patchset #5 (id:160001)
4 years, 7 months ago (2016-05-25 11:03:23 UTC) #21
commit-bot: I haz the power
4 years, 7 months ago (2016-05-25 11:04:49 UTC) #23
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/d1db9f61a6000339514472fe0d69c02e9917571c
Cr-Commit-Position: refs/heads/master@{#395861}

Powered by Google App Engine
This is Rietveld 408576698