[Webkit-unassigned] [Bug 48506] Move DeviceOrientationClientMock from LayoutTestController to WebViewHost

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Oct 28 06:41:29 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=48506





--- Comment #3 from John Knottenbelt <jknotten at chromium.org>  2010-10-28 06:41:30 PST ---
(From update of attachment 72178)
View in context: https://bugs.webkit.org/attachment.cgi?id=72178&action=review

>> WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp:1110
>> +    PassOwnPtr<WebDeviceOrientationClientMock> deviceOrientationClientMock = m_deviceOrientationClientMock.release();
> 
> Should this be a PassOwnPtr? I'm always confused by these smart pointers, but since release() returns a raw pointer, isn't that what we should use? Steve would know this better than me, I think..

PassOwnPtr will take ownership of the mock, and set the member variable m_deviceOrientationClientMock to 0. The reason for doing this is because the destructor will be invoked and we don't actually want the mock to be destroyed and reallocated because the WebView() still exists, meaning that the DeviceOrientationController still have a pointer back to the current (Web)DeviceOrientationControllerMock. This means that the address of the DeviceOrientationControllerMock should stay the same. 

I need to talk to Kent Tamura about whether the placement destruction / new is necessary, but in the meantime this should do the trick.

If it is important to reset the state of the mock between tests (the tests run fine without), we should add a reset() method to the mock and call it at the end of this method.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list