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

Side by Side Diff: third_party/WebKit/Source/core/events/Event.cpp

Issue 2790313004: Move ScriptState::domWindow() (Closed)
Patch Set: Rebase again Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2001 Peter Kelly (pmk@post.com) 2 * Copyright (C) 2001 Peter Kelly (pmk@post.com)
3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) 3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de)
4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
5 * Copyright (C) 2003, 2005, 2006, 2008 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2005, 2006, 2008 Apple Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 Node* node = m_currentTarget->toNode(); 334 Node* node = m_currentTarget->toNode();
335 if (node && node->isSVGElement()) { 335 if (node && node->isSVGElement()) {
336 if (SVGElement* svgElement = toSVGElement(node)->correspondingElement()) 336 if (SVGElement* svgElement = toSVGElement(node)->correspondingElement())
337 return svgElement; 337 return svgElement;
338 } 338 }
339 return m_currentTarget.get(); 339 return m_currentTarget.get();
340 } 340 }
341 341
342 double Event::timeStamp(ScriptState* scriptState) const { 342 double Event::timeStamp(ScriptState* scriptState) const {
343 double timeStamp = 0; 343 double timeStamp = 0;
344 if (scriptState && scriptState->domWindow()) { 344 if (scriptState && LocalDOMWindow::from(scriptState)) {
345 Performance* performance = 345 Performance* performance =
346 DOMWindowPerformance::performance(*scriptState->domWindow()); 346 DOMWindowPerformance::performance(*LocalDOMWindow::from(scriptState));
347 double timestampSeconds = (m_platformTimeStamp - TimeTicks()).InSecondsF(); 347 double timestampSeconds = (m_platformTimeStamp - TimeTicks()).InSecondsF();
348 timeStamp = 348 timeStamp =
349 performance->monotonicTimeToDOMHighResTimeStamp(timestampSeconds); 349 performance->monotonicTimeToDOMHighResTimeStamp(timestampSeconds);
350 } 350 }
351 351
352 return timeStamp; 352 return timeStamp;
353 } 353 }
354 354
355 void Event::setCancelBubble(ScriptState* scriptState, bool cancel) { 355 void Event::setCancelBubble(ScriptState* scriptState, bool cancel) {
356 if (cancel) 356 if (cancel)
357 m_propagationStopped = true; 357 m_propagationStopped = true;
358 } 358 }
359 359
360 DEFINE_TRACE(Event) { 360 DEFINE_TRACE(Event) {
361 visitor->trace(m_currentTarget); 361 visitor->trace(m_currentTarget);
362 visitor->trace(m_target); 362 visitor->trace(m_target);
363 visitor->trace(m_underlyingEvent); 363 visitor->trace(m_underlyingEvent);
364 visitor->trace(m_eventPath); 364 visitor->trace(m_eventPath);
365 } 365 }
366 366
367 } // namespace blink 367 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698