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

Issue 319633007: Move WebScreenOrientationClient to WebFrameClient. (Closed)

Created:
6 years, 6 months ago by mlamouri (slow - plz ping)
Modified:
6 years, 6 months ago
CC:
blink-reviews, jamesr, dglazkov+blink, abarth-chromium, oilpan-reviews
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Move WebScreenOrientationClient to WebFrameClient. Requested by jam@, because of WebViewClient being doomed to a painful death. BUG=162827 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=175923

Patch Set 1 #

Total comments: 2

Patch Set 2 : rebase #

Total comments: 1

Patch Set 3 : fix oilpan build #

Total comments: 6

Patch Set 4 : on top of cl 323873007 #

Patch Set 5 : don't send the events multiple times #

Total comments: 2

Patch Set 6 : magic #

Patch Set 7 : update comment #

Patch Set 8 : m_client null check #

Unified diffs Side-by-side diffs Delta from patch set Stats (+51 lines, -48 lines) Patch
M LayoutTests/screen_orientation/page-visibility.html View 1 2 3 4 2 chunks +11 lines, -0 lines 0 comments Download
M Source/modules/screen_orientation/ScreenOrientation.h View 2 chunks +0 lines, -2 lines 0 comments Download
M Source/modules/screen_orientation/ScreenOrientation.cpp View 5 chunks +6 lines, -14 lines 0 comments Download
M Source/modules/screen_orientation/ScreenOrientationController.h View 1 2 3 3 chunks +6 lines, -5 lines 0 comments Download
M Source/modules/screen_orientation/ScreenOrientationController.cpp View 1 2 3 4 5 3 chunks +17 lines, -15 lines 0 comments Download
M Source/web/WebLocalFrameImpl.cpp View 1 2 3 4 5 6 7 2 chunks +3 lines, -0 lines 0 comments Download
M Source/web/WebViewImpl.cpp View 1 2 3 2 chunks +0 lines, -3 lines 0 comments Download
M public/platform/WebScreenOrientationClient.h View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M public/web/WebFrameClient.h View 1 2 3 2 chunks +7 lines, -0 lines 0 comments Download
M public/web/WebViewClient.h View 1 2 chunks +0 lines, -8 lines 0 comments Download

Messages

Total messages: 36 (0 generated)
mlamouri (slow - plz ping)
6 years, 6 months ago (2014-06-09 17:23:57 UTC) #1
mlamouri (slow - plz ping)
6 years, 6 months ago (2014-06-09 17:24:43 UTC) #2
Inactive
https://codereview.chromium.org/319633007/diff/1/Source/modules/screen_orientation/ScreenOrientationController.cpp File Source/modules/screen_orientation/ScreenOrientationController.cpp (left): https://codereview.chromium.org/319633007/diff/1/Source/modules/screen_orientation/ScreenOrientationController.cpp#oldcode80 Source/modules/screen_orientation/ScreenOrientationController.cpp:80: LocalFrame* mainFrame = page()->mainFrame(); Why don't we keep doing ...
6 years, 6 months ago (2014-06-09 17:29:29 UTC) #3
mlamouri (slow - plz ping)
https://codereview.chromium.org/319633007/diff/1/Source/modules/screen_orientation/ScreenOrientationController.cpp File Source/modules/screen_orientation/ScreenOrientationController.cpp (left): https://codereview.chromium.org/319633007/diff/1/Source/modules/screen_orientation/ScreenOrientationController.cpp#oldcode80 Source/modules/screen_orientation/ScreenOrientationController.cpp:80: LocalFrame* mainFrame = page()->mainFrame(); On 2014/06/09 17:29:29, Chris Dumez ...
6 years, 6 months ago (2014-06-09 17:31:51 UTC) #4
jabdelmalek
+oilpan-reviews https://codereview.chromium.org/319633007/diff/20001/Source/modules/screen_orientation/ScreenOrientationController.h File Source/modules/screen_orientation/ScreenOrientationController.h (right): https://codereview.chromium.org/319633007/diff/20001/Source/modules/screen_orientation/ScreenOrientationController.h#newcode22 Source/modules/screen_orientation/ScreenOrientationController.h:22: class ScreenOrientationController FINAL : public NoBaseWillBeGarbageCollectedFinalized<ScreenOrientationController>, public WillBeHeapSupplement<LocalFrame>, ...
6 years, 6 months ago (2014-06-09 18:19:30 UTC) #5
mlamouri (slow - plz ping)
I've updated the CL to fix oilpan build. PTAL.
6 years, 6 months ago (2014-06-09 19:43:29 UTC) #6
sof
https://codereview.chromium.org/319633007/diff/40001/Source/modules/screen_orientation/ScreenOrientationController.cpp File Source/modules/screen_orientation/ScreenOrientationController.cpp (right): https://codereview.chromium.org/319633007/diff/40001/Source/modules/screen_orientation/ScreenOrientationController.cpp#newcode28 Source/modules/screen_orientation/ScreenOrientationController.cpp:28: Supplement<LocalFrame>::provideTo(frame, supplementName(), adoptPtr(controller)); This is not going to work, ...
6 years, 6 months ago (2014-06-09 21:18:58 UTC) #7
zerny-chromium
CL https://codereview.chromium.org/323873007/ makes LocalFrame HeapSupplementable again using a persistent/GC-root. This means that all of the ...
6 years, 6 months ago (2014-06-10 11:43:42 UTC) #8
mlamouri (slow - plz ping)
Ok, so basically with https://codereview.chromium.org/323873007/ Supplement<LocalFrame> will be oilpan-compatible. I've reverted the changes from rev ...
6 years, 6 months ago (2014-06-10 13:43:22 UTC) #9
mlamouri (slow - plz ping)
Chris, I've fixed the issue you pointed regarding the events. And added a test for ...
6 years, 6 months ago (2014-06-10 14:15:18 UTC) #10
Inactive
lgtm with nit. https://codereview.chromium.org/319633007/diff/80001/Source/modules/screen_orientation/ScreenOrientationController.cpp File Source/modules/screen_orientation/ScreenOrientationController.cpp (right): https://codereview.chromium.org/319633007/diff/80001/Source/modules/screen_orientation/ScreenOrientationController.cpp#newcode86 Source/modules/screen_orientation/ScreenOrientationController.cpp:86: if (m_frame.localFrameRoot() == &m_frame && oldOrientation ...
6 years, 6 months ago (2014-06-10 14:48:48 UTC) #11
mlamouri (slow - plz ping)
https://codereview.chromium.org/319633007/diff/80001/Source/modules/screen_orientation/ScreenOrientationController.cpp File Source/modules/screen_orientation/ScreenOrientationController.cpp (right): https://codereview.chromium.org/319633007/diff/80001/Source/modules/screen_orientation/ScreenOrientationController.cpp#newcode86 Source/modules/screen_orientation/ScreenOrientationController.cpp:86: if (m_frame.localFrameRoot() == &m_frame && oldOrientation != orientation()) On ...
6 years, 6 months ago (2014-06-10 16:27:24 UTC) #12
jamesr
The comment in https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/public/platform/WebScreenOrientationClient.h&q=WebScreenOrientationClient&sq=package:chromium&type=cs refers to WebView, but that's not correct any more - can ...
6 years, 6 months ago (2014-06-10 18:07:14 UTC) #13
zerny-chromium
On 2014/06/10 13:43:22, Mounir Lamouri wrote: > Ok, so basically with https://codereview.chromium.org/323873007/ > Supplement<LocalFrame> will ...
6 years, 6 months ago (2014-06-10 19:48:59 UTC) #14
mlamouri (slow - plz ping)
On 2014/06/10 18:07:14, jamesr wrote: > The comment in > https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/public/platform/WebScreenOrientationClient.h&q=WebScreenOrientationClient&sq=package:chromium&type=cs > refers to WebView, ...
6 years, 6 months ago (2014-06-10 19:59:35 UTC) #15
mlamouri (slow - plz ping)
The CQ bit was checked by mlamouri@chromium.org
6 years, 6 months ago (2014-06-10 20:00:48 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mlamouri@chromium.org/319633007/120001
6 years, 6 months ago (2014-06-10 20:01:43 UTC) #17
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: linux_blink_dbg on tryserver.blink ...
6 years, 6 months ago (2014-06-10 20:55:04 UTC) #18
mlamouri (slow - plz ping)
The CQ bit was checked by mlamouri@chromium.org
6 years, 6 months ago (2014-06-10 21:03:28 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mlamouri@chromium.org/319633007/140001
6 years, 6 months ago (2014-06-10 21:03:31 UTC) #20
commit-bot: I haz the power
Change committed as 175923
6 years, 6 months ago (2014-06-10 22:10:52 UTC) #21
haraken
LGTM in terms of oilpan.
6 years, 6 months ago (2014-06-11 00:50:55 UTC) #22
sof
seeing some new flaky oilpan crashers for the past 12 hours, http://test-results.appspot.com/dashboards/flakiness_dashboard.html#group=%40ToT%20Blink&tests=screen_orientation%2Fpage-visibility.html%2Cfast%2Fevents%2Fpage-visibility-iframe-move-test.html any chance they're ...
6 years, 6 months ago (2014-06-11 16:05:39 UTC) #23
haraken
On 2014/06/11 16:05:39, sof wrote: > seeing some new flaky oilpan crashers for the past ...
6 years, 6 months ago (2014-06-11 16:12:44 UTC) #24
mlamouri (slow - plz ping)
On 2014/06/11 16:12:44, haraken wrote: > ^^^ The crash is happening when ScreenOrientationController accessed > ...
6 years, 6 months ago (2014-06-11 16:27:45 UTC) #25
sof
On 2014/06/11 16:27:45, Mounir Lamouri wrote: > On 2014/06/11 16:12:44, haraken wrote: > > ^^^ ...
6 years, 6 months ago (2014-06-11 20:37:56 UTC) #26
haraken
On 2014/06/11 20:37:56, sof wrote: > On 2014/06/11 16:27:45, Mounir Lamouri wrote: > > On ...
6 years, 6 months ago (2014-06-12 01:02:29 UTC) #27
sof
On 2014/06/12 01:02:29, haraken wrote: > On 2014/06/11 20:37:56, sof wrote: > > On 2014/06/11 ...
6 years, 6 months ago (2014-06-12 05:44:33 UTC) #28
haraken
On 2014/06/12 05:44:33, sof wrote: > On 2014/06/12 01:02:29, haraken wrote: > > On 2014/06/11 ...
6 years, 6 months ago (2014-06-12 05:57:20 UTC) #29
Mads Ager (chromium)
On 2014/06/11 16:12:44, haraken wrote: > On 2014/06/11 16:05:39, sof wrote: > > seeing some ...
6 years, 6 months ago (2014-06-12 06:28:39 UTC) #30
haraken
On 2014/06/12 06:28:39, Mads Ager (chromium) wrote: > On 2014/06/11 16:12:44, haraken wrote: > > ...
6 years, 6 months ago (2014-06-12 07:13:32 UTC) #31
sof
On 2014/06/12 07:13:32, haraken wrote: > On 2014/06/12 06:28:39, Mads Ager (chromium) wrote: > > ...
6 years, 6 months ago (2014-06-12 07:16:15 UTC) #32
Mads Ager (chromium)
On 2014/06/12 07:16:15, sof wrote: > On 2014/06/12 07:13:32, haraken wrote: > > On 2014/06/12 ...
6 years, 6 months ago (2014-06-12 08:31:00 UTC) #33
Mads Ager (chromium)
On 2014/06/12 08:31:00, Mads Ager (chromium) wrote: > On 2014/06/12 07:16:15, sof wrote: > > ...
6 years, 6 months ago (2014-06-12 08:41:50 UTC) #34
zerny-chromium
On 2014/06/12 08:41:50, Mads Ager (chromium) wrote: > On 2014/06/12 08:31:00, Mads Ager (chromium) wrote: ...
6 years, 6 months ago (2014-06-12 08:54:46 UTC) #35
zerny-chromium
6 years, 6 months ago (2014-06-12 11:34:04 UTC) #36
Message was sent while issue was closed.
On 2014/06/12 08:54:46, zerny-chromium wrote:
> On 2014/06/12 08:41:50, Mads Ager (chromium) wrote:
> > On 2014/06/12 08:31:00, Mads Ager (chromium) wrote:
> > > On 2014/06/12 07:16:15, sof wrote:
> > > > On 2014/06/12 07:13:32, haraken wrote:
> > > > > On 2014/06/12 06:28:39, Mads Ager (chromium) wrote:
> > > > > > On 2014/06/11 16:12:44, haraken wrote:
> > > > > > > On 2014/06/11 16:05:39, sof wrote:
> > > > > > > > seeing some new flaky oilpan crashers for the past 12 hours,
> > > > > > > > 
> > > > > > > >  
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
http://test-results.appspot.com/dashboards/flakiness_dashboard.html#group=%40...
> > > > > > > > 
> > > > > > > > any chance they're due to this? (Missing view() null check in
> > > > > > > > ScreenOrientationController::orientation(), perhaps?)
> > > > > > > 
> > > > > > > Thanks for looking into this. As far as I see the stack trace, it
> > seems
> > > > that
> > > > > > > m_frame is gone.
> > > > > > > 
> > > > > > > Thread 0 (crashed)
> > > > > > >  0 
> > > > > >
> > >
content_shell!google_breakpad::ExceptionHandler::SimulateSignalDelivery(int)
> > > > > > > [exception_handler.cc : 440 + 0x0]
> > > > > > >     rax = 0x000000000abe2040   rdx = 0x0000000000000007
> > > > > > >     rcx = 0x00000fffee031000   rbx = 0x00000fffee03104c
> > > > > > >     rsi = 0x0000000000000000   rdi = 0x00007fff70188320
> > > > > > >     rbp = 0x00007fff701887b0   rsp = 0x00007fff70188260
> > > > > > >      r8 = 0x0000000000000080    r9 = 0x0101010101010101
> > > > > > >     r10 = 0x0000000000547057   r11 = 0x000000000abe6590
> > > > > > >     r12 = 0x00007fff70188320   r13 = 0x00007fff70188260
> > > > > > >     r14 = 0x000060c00008a1c0   r15 = 0x00007fff70188280
> > > > > > >     rip = 0x00000000052b8b80
> > > > > > >     Found by: given as instruction pointer in context
> > > > > > >  1  content_shell!~ScopedInErrorReport [asan_report.cc : 570 +
0x9]
> > > > > > >     rbx = 0x00007fff701890c0   rbp = 0x000000000784fc1e
> > > > > > >     rsp = 0x00007fff701887c0   r12 = 0x0000000007850ad4
> > > > > > >     r13 = 0x00007fff701890c0   r14 = 0x0000000007850ae1
> > > > > > >     r15 = 0x0000000007847ed0   rip = 0x0000000000537f38
> > > > > > >     Found by: call frame info
> > > > > > >  2  content_shell!__asan_report_error [asan_report.cc : 891 + 0x5]
> > > > > > >     rbx = 0x00007fff701890c0   rbp = 0x000000000784fc1e
> > > > > > >     rsp = 0x00007fff701887d0   r12 = 0x0000000007850ad4
> > > > > > >     r13 = 0x00007fff701890c0   r14 = 0x0000000007850ae1
> > > > > > >     r15 = 0x0000000007847ed0   rip = 0x0000000000537ab1
> > > > > > >     Found by: call frame info
> > > > > > >  3  content_shell!__asan_report_load8 [asan_rtl.cc : 369 + 0x1c]
> > > > > > >     rbx = 0x00007fd7600d2510   rbp = 0x00007fff70189120
> > > > > > >     rsp = 0x00007fff70189110   r12 = 0x000060700009b630
> > > > > > >     r13 = 0x00007fff70189240   r14 = 0x00000ffaec01a4a2
> > > > > > >     r15 = 0x00007fd7600d2504   rip = 0x00000000005386b7
> > > > > > >     Found by: call frame info
> > > > > > >  4  content_shell!WebCore::LocalFrame::view() const [RefPtr.h : 56
+
> > > 0x5]
> > > > > > >     rbx = 0x00007fd7600d2510   rbp = 0x00007fff70189130
> > > > > > >     rsp = 0x00007fff70189130   r12 = 0x000060700009b630
> > > > > > >     r13 = 0x00007fff70189240   r14 = 0x00000ffaec01a4a2
> > > > > > >     r15 = 0x00007fd7600d2504   rip = 0x0000000001ff22d5
> > > > > > >     Found by: call frame info
> > > > > > >  5 
> content_shell!WebCore::ScreenOrientationController::orientation()
> > > > const
> > > > > > > [ScreenOrientationController.cpp : 104 + 0x1d]
> > > > > > >     rbx = 0x00007fd7600d2510   rbp = 0x00007fff70189150
> > > > > > >     rsp = 0x00007fff70189140   r12 = 0x000060700009b630
> > > > > > >     r13 = 0x00007fff70189240   r14 = 0x00000ffaec01a4a2
> > > > > > >     r15 = 0x00007fd7600d2504   rip = 0x0000000003b8c341
> > > > > > >     Found by: call frame info
> > > > > > > 
> > > > > > > ^^^ The crash is happening when ScreenOrientationController
accessed
> > > > > > > m_frame.view(), not when ScreenOrientationController used the
view()
> > > value
> > > > > > > somewhere.
> > > > > > 
> > > > > > Haraken, what is the rest of this stack trace? Where is this access
to
> > > > > > ScreenOrientationController::orientation comming from? Is it coming
> from
> > > > > > pageVisibilityChanged? Since these objects don't die together we
> > probably
> > > > have
> > > > > > to explicitly propagate a notification with Oilpan. Maybe we can
> > propagate
> > > a
> > > > > > notification so that this orientation access never happens?
> > > > > 
> > > > > Just right now the flakiness dashboard is not working and I cannot get
a
> > > crash
> > > > > log...
> > > > > 
> > > > >
> > > >
> > >
> >
>
http://test-results.appspot.com/dashboards/flakiness_dashboard.html#group=%40...
> > > > 
> > > >
> > >
> >
>
https://storage.googleapis.com/chromium-layout-test-archives/WebKit_Win_Oilpa...
> > > 
> > > Reproduction steps that work for me:
> > > 
> > > gdb --args ./out/Debug/content_shell --single-process --no-sandbox
> > > --dump-render-tree -
> > > 
> > > wait for it to print READY and then paste in:
> > > 
> > > fast/dom/DeviceMotion/page-visibility.html
> > > fast/dom/DeviceMotion/page-visibility.html
> > > fast/dom/DeviceOrientation/page-visibility.html
> > > fast/events/page-visibility-iframe-propagation-test.html
> > > jquery/manipulation.html
> > > screen_orientation/page-visibility.html
> > > 
> > > That leads to:
> > > 
> > > WebCore::Widget::parent (this=0xcdcdcdcdcdcdcdcd)
> > >     at ../../third_party/WebKit/Source/platform/Widget.h:96
> > > 96	    Widget* parent() const { return m_parent; }
> > > (gdb) where
> > > #0  WebCore::Widget::parent (this=0xcdcdcdcdcdcdcdcd)
> > >     at ../../third_party/WebKit/Source/platform/Widget.h:96
> > > #1  0x00007ffff6ada4ad in WebCore::Widget::root (this=0xcdcdcdcdcdcdcdcd)
> > >     at ../../third_party/WebKit/Source/platform/Widget.cpp:60
> > > #2  0x00007ffff6acb360 in WebCore::toHostWindow
(widget=0xcdcdcdcdcdcdcdcd)
> > >     at ../../third_party/WebKit/Source/platform/PlatformScreen.cpp:45
> > > #3  0x00007ffff6acb5f5 in WebCore::screenOrientationType (
> > >     widget=0xcdcdcdcdcdcdcdcd)
> > >     at ../../third_party/WebKit/Source/platform/PlatformScreen.cpp:101
> > > #4  0x00007fffeb6f4b52 in
WebCore::ScreenOrientationController::orientation
> (
> > >     this=0x7fffc6efb4a8)
> > > 
> > > So it would seem that the widget has been deallocated at this point. I'll
> keep
> > > digging but thought I would post the reproduction steps.
> > 
> > Right, so what is happening is that the frame is dead but that does not kill
> the
> > supplements because they are in the heap. Therefore, the
> > ScreenOrientationController supplement is still regsitered as a page
lifecycle
> > observer with oilpan and therefore we get this notification with a dead
frame
> > only in the oilpan build. With oilpan we need to explicitly unregister the
> > ScreenOrientationController as a page life-cycle observer when the
LocalFrame
> is
> > going down.
> 
> That looks very much like the problem. I'll upload a fix for this shortly.

Fix CL at: https://codereview.chromium.org/335573004/

Powered by Google App Engine
This is Rietveld 408576698