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

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

Issue 1511583002: Client Side Speed Index Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 #include "core/inspector/InspectorInstrumentation.h" 61 #include "core/inspector/InspectorInstrumentation.h"
62 #include "core/loader/DocumentLoader.h" 62 #include "core/loader/DocumentLoader.h"
63 #include "core/loader/FrameLoaderClient.h" 63 #include "core/loader/FrameLoaderClient.h"
64 #include "core/loader/SinkDocument.h" 64 #include "core/loader/SinkDocument.h"
65 #include "core/loader/appcache/ApplicationCache.h" 65 #include "core/loader/appcache/ApplicationCache.h"
66 #include "core/page/ChromeClient.h" 66 #include "core/page/ChromeClient.h"
67 #include "core/page/CreateWindow.h" 67 #include "core/page/CreateWindow.h"
68 #include "core/page/Page.h" 68 #include "core/page/Page.h"
69 #include "core/page/WindowFeatures.h" 69 #include "core/page/WindowFeatures.h"
70 #include "core/page/scrolling/ScrollingCoordinator.h" 70 #include "core/page/scrolling/ScrollingCoordinator.h"
71 #include "core/paint/PaintTiming.h"
71 #include "platform/EventDispatchForbiddenScope.h" 72 #include "platform/EventDispatchForbiddenScope.h"
72 #include "public/platform/Platform.h" 73 #include "public/platform/Platform.h"
73 #include "public/platform/WebFrameScheduler.h" 74 #include "public/platform/WebFrameScheduler.h"
74 #include "public/platform/WebScreenInfo.h" 75 #include "public/platform/WebScreenInfo.h"
75 76
76 namespace blink { 77 namespace blink {
77 78
78 LocalDOMWindow::WindowFrameObserver::WindowFrameObserver(LocalDOMWindow* window, LocalFrame& frame) 79 LocalDOMWindow::WindowFrameObserver::WindowFrameObserver(LocalDOMWindow* window, LocalFrame& frame)
79 : LocalFrameLifecycleObserver(&frame) 80 : LocalFrameLifecycleObserver(&frame)
80 , m_window(window) 81 , m_window(window)
(...skipping 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after
1376 1377
1377 void LocalDOMWindow::dispatchLoadEvent() 1378 void LocalDOMWindow::dispatchLoadEvent()
1378 { 1379 {
1379 RefPtrWillBeRawPtr<Event> loadEvent(Event::create(EventTypeNames::load)); 1380 RefPtrWillBeRawPtr<Event> loadEvent(Event::create(EventTypeNames::load));
1380 if (frame() && frame()->loader().documentLoader() && !frame()->loader().docu mentLoader()->timing().loadEventStart()) { 1381 if (frame() && frame()->loader().documentLoader() && !frame()->loader().docu mentLoader()->timing().loadEventStart()) {
1381 // The DocumentLoader (and thus its DocumentLoadTiming) might get destro yed while dispatching 1382 // The DocumentLoader (and thus its DocumentLoadTiming) might get destro yed while dispatching
1382 // the event, so protect it to prevent writing the end time into freed m emory. 1383 // the event, so protect it to prevent writing the end time into freed m emory.
1383 RefPtrWillBeRawPtr<DocumentLoader> documentLoader = frame()->loader().do cumentLoader(); 1384 RefPtrWillBeRawPtr<DocumentLoader> documentLoader = frame()->loader().do cumentLoader();
1384 DocumentLoadTiming& timing = documentLoader->timing(); 1385 DocumentLoadTiming& timing = documentLoader->timing();
1385 timing.markLoadEventStart(); 1386 timing.markLoadEventStart();
1387 if (frame()->isMainFrame()) {
1388 PaintTiming paintTiming = PaintTiming::from(*frame()->document());
1389 paintTiming.speedIndex(timing.navigationStart());
1390 }
1386 dispatchEvent(loadEvent, document()); 1391 dispatchEvent(loadEvent, document());
1387 timing.markLoadEventEnd(); 1392 timing.markLoadEventEnd();
1388 } else { 1393 } else {
1389 dispatchEvent(loadEvent, document()); 1394 dispatchEvent(loadEvent, document());
1390 } 1395 }
1391 1396
1392 // For load events, send a separate load event to the enclosing frame only. 1397 // For load events, send a separate load event to the enclosing frame only.
1393 // This is a DOM extension and is independent of bubbling/capturing rules of 1398 // This is a DOM extension and is independent of bubbling/capturing rules of
1394 // the DOM. 1399 // the DOM.
1395 FrameOwner* owner = frame() ? frame()->owner() : nullptr; 1400 FrameOwner* owner = frame() ? frame()->owner() : nullptr;
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
1533 { 1538 {
1534 // If the LocalDOMWindow still has a frame reference, that frame must point 1539 // If the LocalDOMWindow still has a frame reference, that frame must point
1535 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation 1540 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation
1536 // where script execution leaks between different LocalDOMWindows. 1541 // where script execution leaks between different LocalDOMWindows.
1537 if (m_frameObserver->frame()) 1542 if (m_frameObserver->frame())
1538 ASSERT_WITH_SECURITY_IMPLICATION(m_frameObserver->frame()->domWindow() = = this); 1543 ASSERT_WITH_SECURITY_IMPLICATION(m_frameObserver->frame()->domWindow() = = this);
1539 return m_frameObserver->frame(); 1544 return m_frameObserver->frame();
1540 } 1545 }
1541 1546
1542 } // namespace blink 1547 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698