Commit 6e652df9 authored by akling@apple.com's avatar akling@apple.com

Move DocumentTiming inside ENABLE(WEB_TIMING) guards.

<https://webkit.org/b/120281>

Reviewed by Anders Carlsson.

Looks like this struct is only used by other ENABLE(WEB_TIMING) code, so don't bother
filling it in if we're not building like that.

* dom/Document.cpp:
(WebCore::Document::setReadyState):
(WebCore::Document::finishedParsing):
* dom/Document.h:
* dom/DocumentTiming.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154597 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent c1a2b0f0
2013-08-26 Andreas Kling <akling@apple.com>
Move DocumentTiming inside ENABLE(WEB_TIMING) guards.
<https://webkit.org/b/120281>
Reviewed by Anders Carlsson.
Looks like this struct is only used by other ENABLE(WEB_TIMING) code, so don't bother
filling it in if we're not building like that.
* dom/Document.cpp:
(WebCore::Document::setReadyState):
(WebCore::Document::finishedParsing):
* dom/Document.h:
* dom/DocumentTiming.h:
2013-08-26 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Fix compile warning in WebKitDOMCustom
......@@ -1199,6 +1199,7 @@ void Document::setReadyState(ReadyState readyState)
if (readyState == m_readyState)
return;
#if ENABLE(WEB_TIMING)
switch (readyState) {
case Loading:
if (!m_documentTiming.domLoading)
......@@ -1213,6 +1214,7 @@ void Document::setReadyState(ReadyState readyState)
m_documentTiming.domComplete = monotonicallyIncreasingTime();
break;
}
#endif
m_readyState = readyState;
dispatchEvent(Event::create(eventNames().readystatechangeEvent, false, false));
......@@ -4396,11 +4398,18 @@ void Document::finishedParsing()
ASSERT(!scriptableDocumentParser() || !m_parser->isParsing());
ASSERT(!scriptableDocumentParser() || m_readyState != Loading);
setParsing(false);
#if ENABLE(WEB_TIMING)
if (!m_documentTiming.domContentLoadedEventStart)
m_documentTiming.domContentLoadedEventStart = monotonicallyIncreasingTime();
#endif
dispatchEvent(Event::create(eventNames().DOMContentLoadedEvent, true, false));
#if ENABLE(WEB_TIMING)
if (!m_documentTiming.domContentLoadedEventEnd)
m_documentTiming.domContentLoadedEventEnd = monotonicallyIncreasingTime();
#endif
if (RefPtr<Frame> f = frame()) {
// FrameLoader::finishedParsing() might end up calling Document::implicitClose() if all
......
......@@ -1074,7 +1074,9 @@ public:
PassRefPtr<Touch> createTouch(DOMWindow*, EventTarget*, int identifier, int pageX, int pageY, int screenX, int screenY, int radiusX, int radiusY, float rotationAngle, float force, ExceptionCode&) const;
#endif
#if ENABLE(WEB_TIMING)
const DocumentTiming* timing() const { return &m_documentTiming; }
#endif
#if ENABLE(REQUEST_ANIMATION_FRAME)
int requestAnimationFrame(PassRefPtr<RequestAnimationFrameCallback>);
......@@ -1494,7 +1496,10 @@ private:
bool m_directionSetOnDocumentElement;
bool m_writingModeSetOnDocumentElement;
#if ENABLE(WEB_TIMING)
DocumentTiming m_documentTiming;
#endif
RefPtr<MediaQueryMatcher> m_mediaQueryMatcher;
bool m_writeRecursionIsTooDeep;
unsigned m_writeRecursionDepth;
......
......@@ -26,6 +26,8 @@
#ifndef DocumentTiming_h
#define DocumentTiming_h
#if ENABLE(WEB_TIMING)
namespace WebCore {
struct DocumentTiming {
......@@ -48,3 +50,5 @@ struct DocumentTiming {
}
#endif
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment