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

Unified Diff: Source/core/loader/NavigationAction.cpp

Issue 206453010: NavigationAction should not retain Event. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/loader/NavigationAction.h ('k') | Source/web/WebDataSourceImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/NavigationAction.cpp
diff --git a/Source/core/loader/NavigationAction.cpp b/Source/core/loader/NavigationAction.cpp
index b27828e2be1eb7baaf6a7dff4718b97c6c414e92..07853724c189272c751862915711b47e2dc55640 100644
--- a/Source/core/loader/NavigationAction.cpp
+++ b/Source/core/loader/NavigationAction.cpp
@@ -55,16 +55,21 @@ NavigationAction::NavigationAction()
}
NavigationAction::NavigationAction(const ResourceRequest& resourceRequest, FrameLoadType frameLoadType,
- bool isFormSubmission, PassRefPtr<Event> event)
+ bool isFormSubmission, PassRefPtr<Event> passEvent)
: m_resourceRequest(resourceRequest)
- , m_type(navigationType(frameLoadType, isFormSubmission || resourceRequest.httpBody(), event))
- , m_event(event)
{
+ RefPtr<Event> event = passEvent;
+ m_type = navigationType(frameLoadType, isFormSubmission || resourceRequest.httpBody(), event);
+ m_eventTimeStamp = event ? event->timeStamp() : 0;
+
const MouseEvent* mouseEvent = 0;
- if (m_type == NavigationTypeLinkClicked && m_event->isMouseEvent())
- mouseEvent = toMouseEvent(m_event.get());
- else if (m_type == NavigationTypeFormSubmitted && m_event && m_event->underlyingEvent() && m_event->underlyingEvent()->isMouseEvent())
- mouseEvent = toMouseEvent(m_event->underlyingEvent());
+ if (m_type == NavigationTypeLinkClicked) {
+ ASSERT(event);
+ if (event->isMouseEvent())
+ mouseEvent = toMouseEvent(event.get());
+ } else if (m_type == NavigationTypeFormSubmitted && event && event->underlyingEvent() && event->underlyingEvent()->isMouseEvent()) {
+ mouseEvent = toMouseEvent(event->underlyingEvent());
+ }
if (!mouseEvent || !navigationPolicyFromMouseEvent(mouseEvent->button(), mouseEvent->ctrlKey(), mouseEvent->shiftKey(), mouseEvent->altKey(), mouseEvent->metaKey(), &m_policy))
m_policy = NavigationPolicyCurrentTab;
« no previous file with comments | « Source/core/loader/NavigationAction.h ('k') | Source/web/WebDataSourceImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698