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

Side by Side Diff: third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp

Issue 2472583003: Navigation Timing Level 2 (Closed)
Patch Set: fixed layout tests failure Created 4 years 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) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 #include "core/inspector/InspectorTraceEvents.h" 69 #include "core/inspector/InspectorTraceEvents.h"
70 #include "core/loader/DocumentLoader.h" 70 #include "core/loader/DocumentLoader.h"
71 #include "core/loader/FrameLoaderClient.h" 71 #include "core/loader/FrameLoaderClient.h"
72 #include "core/loader/SinkDocument.h" 72 #include "core/loader/SinkDocument.h"
73 #include "core/loader/appcache/ApplicationCache.h" 73 #include "core/loader/appcache/ApplicationCache.h"
74 #include "core/page/ChromeClient.h" 74 #include "core/page/ChromeClient.h"
75 #include "core/page/CreateWindow.h" 75 #include "core/page/CreateWindow.h"
76 #include "core/page/Page.h" 76 #include "core/page/Page.h"
77 #include "core/page/WindowFeatures.h" 77 #include "core/page/WindowFeatures.h"
78 #include "core/page/scrolling/ScrollingCoordinator.h" 78 #include "core/page/scrolling/ScrollingCoordinator.h"
79 #include "core/timing/DOMWindowPerformance.h"
80 #include "core/timing/Performance.h"
79 #include "platform/EventDispatchForbiddenScope.h" 81 #include "platform/EventDispatchForbiddenScope.h"
80 #include "platform/weborigin/SecurityOrigin.h" 82 #include "platform/weborigin/SecurityOrigin.h"
81 #include "platform/weborigin/Suborigin.h" 83 #include "platform/weborigin/Suborigin.h"
82 #include "public/platform/Platform.h" 84 #include "public/platform/Platform.h"
83 #include "public/platform/WebFrameScheduler.h" 85 #include "public/platform/WebFrameScheduler.h"
84 #include "public/platform/WebScreenInfo.h" 86 #include "public/platform/WebScreenInfo.h"
85 #include <memory> 87 #include <memory>
86 88
87 namespace blink { 89 namespace blink {
88 90
(...skipping 1308 matching lines...) Expand 10 before | Expand all | Expand 10 after
1397 // If fetcher->countPreloads() is not empty here, it's full of link 1399 // If fetcher->countPreloads() is not empty here, it's full of link
1398 // preloads, as speculatove preloads were cleared at DCL. 1400 // preloads, as speculatove preloads were cleared at DCL.
1399 if (frame() && documentLoader == frame()->loader().documentLoader() && 1401 if (frame() && documentLoader == frame()->loader().documentLoader() &&
1400 documentLoader->fetcher()->countPreloads()) 1402 documentLoader->fetcher()->countPreloads())
1401 m_unusedPreloadsTimer.startOneShot(unusedPreloadTimeoutInSeconds, 1403 m_unusedPreloadsTimer.startOneShot(unusedPreloadTimeoutInSeconds,
1402 BLINK_FROM_HERE); 1404 BLINK_FROM_HERE);
1403 } else { 1405 } else {
1404 dispatchEvent(loadEvent, document()); 1406 dispatchEvent(loadEvent, document());
1405 } 1407 }
1406 1408
1409 if (frame()) {
1410 Performance* performance = DOMWindowPerformance::performance(*this);
1411 DCHECK(performance);
1412 performance->addNavigationTiming(frame());
1413 }
1414
1407 // For load events, send a separate load event to the enclosing frame only. 1415 // For load events, send a separate load event to the enclosing frame only.
1408 // This is a DOM extension and is independent of bubbling/capturing rules of 1416 // This is a DOM extension and is independent of bubbling/capturing rules of
1409 // the DOM. 1417 // the DOM.
1410 FrameOwner* owner = frame() ? frame()->owner() : nullptr; 1418 FrameOwner* owner = frame() ? frame()->owner() : nullptr;
1411 if (owner) 1419 if (owner)
1412 owner->dispatchLoad(); 1420 owner->dispatchLoad();
1413 1421
1414 TRACE_EVENT_INSTANT1("devtools.timeline", "MarkLoad", 1422 TRACE_EVENT_INSTANT1("devtools.timeline", "MarkLoad",
1415 TRACE_EVENT_SCOPE_THREAD, "data", 1423 TRACE_EVENT_SCOPE_THREAD, "data",
1416 InspectorMarkLoadEvent::data(frame())); 1424 InspectorMarkLoadEvent::data(frame()));
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
1554 1562
1555 LocalFrame* LocalDOMWindow::frame() const { 1563 LocalFrame* LocalDOMWindow::frame() const {
1556 // If the LocalDOMWindow still has a frame reference, that frame must point 1564 // If the LocalDOMWindow still has a frame reference, that frame must point
1557 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation 1565 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation
1558 // where script execution leaks between different LocalDOMWindows. 1566 // where script execution leaks between different LocalDOMWindows.
1559 SECURITY_DCHECK(!m_frame || m_frame->domWindow() == this); 1567 SECURITY_DCHECK(!m_frame || m_frame->domWindow() == this);
1560 return m_frame; 1568 return m_frame;
1561 } 1569 }
1562 1570
1563 } // namespace blink 1571 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/core_idl_files.gni ('k') | third_party/WebKit/Source/core/timing/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698