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

Issue 2748603002: Add a lifecycle state machine for Page (Closed)

Created:
3 years, 9 months ago by sashab
Modified:
3 years, 9 months ago
Reviewers:
dcheng
CC:
blink-reviews, chromium-reviews
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Add a lifecycle state machine for Frame This CL adds a linear state machine to the Frame to ensure that it follows an orderly progression through its state machine. The plan is to use this state machine to make an isAttached() method which can check this state, and later make page(), client(), host() etc return references that DCHECK on the correct state. Also removed m_isDetaching and replaced it with checks on the lifecycle. Based on abarth's CL for adding a state machine for Document in: https://chromiumcodereview.appspot.com/25036004 BUG=700783 Review-Url: https://codereview.chromium.org/2748603002 Cr-Commit-Position: refs/heads/master@{#459710} Committed: https://chromium.googlesource.com/chromium/src/+/382a2483590ea3a82082d78c36b1f10a65ac7501

Patch Set 1 #

Patch Set 2 : Added missing files #

Total comments: 8

Patch Set 3 : Moved PageLifecycle to FrameLifecycle #

Total comments: 13

Patch Set 4 : Review feedback #

Patch Set 5 : Allowed movement from Detached back to the same state. #

Total comments: 7

Patch Set 6 : Review feedback #

Patch Set 7 : Added check to detach() call in Page #

Total comments: 2

Patch Set 8 : Added TODO to fix temp if statement #

Patch Set 9 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+88 lines, -10 lines) Patch
M third_party/WebKit/Source/core/frame/BUILD.gn View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/Frame.h View 1 2 3 4 3 chunks +7 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/frame/Frame.cpp View 1 2 3 4 5 2 chunks +6 lines, -2 lines 0 comments Download
A third_party/WebKit/Source/core/frame/FrameLifecycle.h View 1 2 3 1 chunk +33 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/core/frame/FrameLifecycle.cpp View 1 2 3 4 1 chunk +29 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/LocalFrame.cpp View 1 2 3 4 5 2 chunks +3 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/frame/RemoteFrame.cpp View 1 2 3 4 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/loader/FrameLoader.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/page/Page.cpp View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -1 line 0 comments Download
M third_party/WebKit/Source/web/WebFrame.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 61 (44 generated)
sashab
Hi daniel, just playing around with ideas at the moment, have some questions for you ...
3 years, 9 months ago (2017-03-13 03:01:52 UTC) #7
sashab
Ping dcheng, elliott feel free to comment too
3 years, 9 months ago (2017-03-14 03:54:59 UTC) #11
dcheng
Sorry for the slow review, I was OOO on Friday and Monday. My main question ...
3 years, 9 months ago (2017-03-14 05:55:45 UTC) #12
esprehn
Yeah I think this is meant to be FrameLifecycle instead. We might want a PageLifecycle ...
3 years, 9 months ago (2017-03-14 05:56:33 UTC) #13
sashab
Thanks elliott & daniel - you are absolutely right, I meant for this to be ...
3 years, 9 months ago (2017-03-16 01:01:04 UTC) #17
dcheng
https://codereview.chromium.org/2748603002/diff/40001/third_party/WebKit/Source/core/frame/Frame.cpp File third_party/WebKit/Source/core/frame/Frame.cpp (right): https://codereview.chromium.org/2748603002/diff/40001/third_party/WebKit/Source/core/frame/Frame.cpp#newcode61 third_party/WebKit/Source/core/frame/Frame.cpp:61: m_lifecycle.advanceTo(FrameLifecycle::Disposed); My personal opinion is this is unnecessary: accessing ...
3 years, 9 months ago (2017-03-16 05:52:29 UTC) #20
sashab
Thanks dcheng, ptal https://codereview.chromium.org/2748603002/diff/40001/third_party/WebKit/Source/core/frame/Frame.cpp File third_party/WebKit/Source/core/frame/Frame.cpp (right): https://codereview.chromium.org/2748603002/diff/40001/third_party/WebKit/Source/core/frame/Frame.cpp#newcode61 third_party/WebKit/Source/core/frame/Frame.cpp:61: m_lifecycle.advanceTo(FrameLifecycle::Disposed); On 2017/03/16 at 05:52:28, dcheng ...
3 years, 9 months ago (2017-03-17 06:55:54 UTC) #27
sashab
dcheng@ ptal, trybots should pass now. Needed to add logic to allow Detached state to ...
3 years, 9 months ago (2017-03-22 03:05:28 UTC) #32
dcheng
https://codereview.chromium.org/2748603002/diff/80001/third_party/WebKit/Source/core/frame/Frame.cpp File third_party/WebKit/Source/core/frame/Frame.cpp (right): https://codereview.chromium.org/2748603002/diff/80001/third_party/WebKit/Source/core/frame/Frame.cpp#newcode61 third_party/WebKit/Source/core/frame/Frame.cpp:61: ASSERT(!m_owner); Shall we assert that the the lifecycle is ...
3 years, 9 months ago (2017-03-22 23:44:10 UTC) #36
sashab
Thanks daniel; ptal. Had to add a check in Page, see comment. https://codereview.chromium.org/2748603002/diff/80001/third_party/WebKit/Source/core/frame/Frame.cpp File third_party/WebKit/Source/core/frame/Frame.cpp ...
3 years, 9 months ago (2017-03-24 02:28:30 UTC) #43
dcheng
https://codereview.chromium.org/2748603002/diff/120001/third_party/WebKit/Source/core/page/Page.cpp File third_party/WebKit/Source/core/page/Page.cpp (right): https://codereview.chromium.org/2748603002/diff/120001/third_party/WebKit/Source/core/page/Page.cpp#newcode645 third_party/WebKit/Source/core/page/Page.cpp:645: if (mainFrame->isAttached()) On 2017/03/24 02:28:30, sashab wrote: > Had ...
3 years, 9 months ago (2017-03-24 04:56:36 UTC) #46
sashab
Added TODO, will fix in follow-up patch.
3 years, 9 months ago (2017-03-24 04:59:33 UTC) #47
dcheng
LGTM
3 years, 9 months ago (2017-03-24 05:00:35 UTC) #50
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2748603002/140001
3 years, 9 months ago (2017-03-24 05:04:46 UTC) #53
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/415810)
3 years, 9 months ago (2017-03-24 06:15:31 UTC) #55
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2748603002/160001
3 years, 9 months ago (2017-03-27 05:15:52 UTC) #58
commit-bot: I haz the power
3 years, 9 months ago (2017-03-27 07:00:26 UTC) #61
Message was sent while issue was closed.
Committed patchset #9 (id:160001) as
https://chromium.googlesource.com/chromium/src/+/382a2483590ea3a82082d78c36b1...

Powered by Google App Engine
This is Rietveld 408576698