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

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

Issue 2511313002: transferSize implementation (Closed)
Patch Set: Created 4 years, 1 month 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"
81 #include "platform/EventDispatchForbiddenScope.h" 79 #include "platform/EventDispatchForbiddenScope.h"
82 #include "platform/weborigin/SecurityOrigin.h" 80 #include "platform/weborigin/SecurityOrigin.h"
83 #include "platform/weborigin/Suborigin.h" 81 #include "platform/weborigin/Suborigin.h"
84 #include "public/platform/Platform.h" 82 #include "public/platform/Platform.h"
85 #include "public/platform/WebFrameScheduler.h" 83 #include "public/platform/WebFrameScheduler.h"
86 #include "public/platform/WebScreenInfo.h" 84 #include "public/platform/WebScreenInfo.h"
87 #include <memory> 85 #include <memory>
88 86
89 namespace blink { 87 namespace blink {
90 88
(...skipping 1306 matching lines...) Expand 10 before | Expand all | Expand 10 after
1397 // If fetcher->countPreloads() is not empty here, it's full of link 1395 // If fetcher->countPreloads() is not empty here, it's full of link
1398 // preloads, as speculatove preloads were cleared at DCL. 1396 // preloads, as speculatove preloads were cleared at DCL.
1399 if (frame() && documentLoader == frame()->loader().documentLoader() && 1397 if (frame() && documentLoader == frame()->loader().documentLoader() &&
1400 documentLoader->fetcher()->countPreloads()) 1398 documentLoader->fetcher()->countPreloads())
1401 m_unusedPreloadsTimer.startOneShot(unusedPreloadTimeoutInSeconds, 1399 m_unusedPreloadsTimer.startOneShot(unusedPreloadTimeoutInSeconds,
1402 BLINK_FROM_HERE); 1400 BLINK_FROM_HERE);
1403 } else { 1401 } else {
1404 dispatchEvent(loadEvent, document()); 1402 dispatchEvent(loadEvent, document());
1405 } 1403 }
1406 1404
1407 if (frame()) {
1408 Performance* performance = DOMWindowPerformance::performance(*this);
1409 DCHECK(performance);
1410 performance->addNavigationTiming(frame());
1411 }
1412
1413 // For load events, send a separate load event to the enclosing frame only. 1405 // For load events, send a separate load event to the enclosing frame only.
1414 // This is a DOM extension and is independent of bubbling/capturing rules of 1406 // This is a DOM extension and is independent of bubbling/capturing rules of
1415 // the DOM. 1407 // the DOM.
1416 FrameOwner* owner = frame() ? frame()->owner() : nullptr; 1408 FrameOwner* owner = frame() ? frame()->owner() : nullptr;
1417 if (owner) 1409 if (owner)
1418 owner->dispatchLoad(); 1410 owner->dispatchLoad();
1419 1411
1420 TRACE_EVENT_INSTANT1("devtools.timeline", "MarkLoad", 1412 TRACE_EVENT_INSTANT1("devtools.timeline", "MarkLoad",
1421 TRACE_EVENT_SCOPE_THREAD, "data", 1413 TRACE_EVENT_SCOPE_THREAD, "data",
1422 InspectorMarkLoadEvent::data(frame())); 1414 InspectorMarkLoadEvent::data(frame()));
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
1560 1552
1561 LocalFrame* LocalDOMWindow::frame() const { 1553 LocalFrame* LocalDOMWindow::frame() const {
1562 // If the LocalDOMWindow still has a frame reference, that frame must point 1554 // If the LocalDOMWindow still has a frame reference, that frame must point
1563 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation 1555 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation
1564 // where script execution leaks between different LocalDOMWindows. 1556 // where script execution leaks between different LocalDOMWindows.
1565 SECURITY_DCHECK(!m_frame || m_frame->domWindow() == this); 1557 SECURITY_DCHECK(!m_frame || m_frame->domWindow() == this);
1566 return m_frame; 1558 return m_frame;
1567 } 1559 }
1568 1560
1569 } // namespace blink 1561 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698