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

Issue 2124723002: Reland of "Move UndoStack from Page to Editor" (Closed)

Created:
4 years, 5 months ago by Xiaocheng
Modified:
4 years, 5 months ago
CC:
blink-reviews, chromium-reviews, gavinp+loader_chromium.org, Nate Chapin, loading-reviews_chromium.org, tyoshino+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Reland of "Move UndoStack from Page to Editor" Blink currently maintains per-page undo stacks, leading to: - Security risks. A frame can directly manipulate content of another frame by running document.execCommand('undo'), allowing Javascript to bypass frame and even origin boundaries. - Inconsistent behaviors. Without OOPIF, all changes in a page can be undone by repeatedly invoking keyboard undo (CTRL+Z); With OOPIF, only those changes in the focused frame and its same-origin frames can be undone. Redos have analogous defects. This patch changes UndoStack from per-page to per-frame, so that undos and redos are consistently resolved by the frame where script is run or which gets focused. This CL is a relanding of https://codereview.chromium.org/2110543008 with the following change: A new function |UndoStack::clear| is introduced and called in |Editor::clear|. In this way the leak reported by crbug.com/625736 is not reintroduced. BUG=349272, 549334 TEST=editing/undo/undo-iframe-location-change.html Committed: https://crrev.com/512508f0d652a006407ce66aafcd339b296a5276 Cr-Commit-Position: refs/heads/master@{#403871}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Hide UndoStack::clear in Editor::clear #

Unified diffs Side-by-side diffs Delta from patch set Stats (+42 lines, -103 lines) Patch
M third_party/WebKit/LayoutTests/editing/undo/undo-iframe-location-change.html View 2 chunks +22 lines, -43 lines 0 comments Download
D third_party/WebKit/LayoutTests/editing/undo/undo-iframe-location-change-expected.txt View 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/editing/Editor.h View 1 2 chunks +1 line, -2 lines 0 comments Download
M third_party/WebKit/Source/core/editing/Editor.cpp View 1 8 chunks +10 lines, -23 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/UndoStack.h View 3 chunks +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/UndoStack.cpp View 3 chunks +6 lines, -20 lines 0 comments Download
M third_party/WebKit/Source/core/loader/FrameLoader.cpp View 1 2 chunks +0 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/page/Page.h View 3 chunks +0 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/page/Page.cpp View 3 chunks +0 lines, -3 lines 0 comments Download

Messages

Total messages: 16 (5 generated)
Xiaocheng
PTAL. The memory leak is fixed after adding back the manual cleanup of the undo ...
4 years, 5 months ago (2016-07-05 09:28:30 UTC) #3
yosin_UTC9
https://codereview.chromium.org/2124723002/diff/1/third_party/WebKit/Source/core/editing/Editor.cpp File third_party/WebKit/Source/core/editing/Editor.cpp (right): https://codereview.chromium.org/2124723002/diff/1/third_party/WebKit/Source/core/editing/Editor.cpp#newcode1080 third_party/WebKit/Source/core/editing/Editor.cpp:1080: return m_undoStack->clear(); How about doing |m_undoStack->clear()| to move |Editor::clear()|, ...
4 years, 5 months ago (2016-07-06 01:04:51 UTC) #4
tkent
Did you resolve the flaky tests issue?
4 years, 5 months ago (2016-07-06 01:15:25 UTC) #5
Xiaocheng
PTAL at Patch 2. I didn't observe any crashes when running layout tests locally, so ...
4 years, 5 months ago (2016-07-06 04:18:33 UTC) #6
tkent
lgtm
4 years, 5 months ago (2016-07-06 04:21:00 UTC) #7
yosin_UTC9
lgtm Sorry for late response. m(_ _)m
4 years, 5 months ago (2016-07-06 08:21:28 UTC) #9
Xiaocheng
Thanks for your review!
4 years, 5 months ago (2016-07-06 08:22:12 UTC) #11
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/2124723002/20001
4 years, 5 months ago (2016-07-06 08:22:29 UTC) #12
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 5 months ago (2016-07-06 09:10:51 UTC) #13
commit-bot: I haz the power
CQ bit was unchecked.
4 years, 5 months ago (2016-07-06 09:10:57 UTC) #14
commit-bot: I haz the power
4 years, 5 months ago (2016-07-06 09:13:41 UTC) #16
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/512508f0d652a006407ce66aafcd339b296a5276
Cr-Commit-Position: refs/heads/master@{#403871}

Powered by Google App Engine
This is Rietveld 408576698