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

Unified Diff: third_party/WebKit/Source/core/timing/PerformanceNavigationTiming.cpp

Issue 2774543003: Fix PerformanceNavigationTiming accessor behavior after document detach. (Closed)
Patch Set: sync Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/timing/PerformanceNavigationTiming.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/timing/PerformanceNavigationTiming.cpp
diff --git a/third_party/WebKit/Source/core/timing/PerformanceNavigationTiming.cpp b/third_party/WebKit/Source/core/timing/PerformanceNavigationTiming.cpp
index f9df40ffb2c628cfc4a517144742edaa0b4a32d4..43f9de0702627401f04a8bb513f600152682cfa3 100644
--- a/third_party/WebKit/Source/core/timing/PerformanceNavigationTiming.cpp
+++ b/third_party/WebKit/Source/core/timing/PerformanceNavigationTiming.cpp
@@ -23,9 +23,9 @@ PerformanceNavigationTiming::PerformanceNavigationTiming(
"navigation",
0.0,
0.0),
+ ContextClient(frame),
m_timeOrigin(timeOrigin),
- m_resourceTimingInfo(info),
- m_frame(frame) {
+ m_resourceTimingInfo(info) {
DCHECK(frame);
DCHECK(info);
}
@@ -33,7 +33,7 @@ PerformanceNavigationTiming::PerformanceNavigationTiming(
PerformanceNavigationTiming::~PerformanceNavigationTiming() {}
DEFINE_TRACE(PerformanceNavigationTiming) {
- visitor->trace(m_frame);
+ ContextClient::trace(visitor);
PerformanceEntry::trace(visitor);
}
@@ -46,11 +46,15 @@ DocumentLoadTiming* PerformanceNavigationTiming::documentLoadTiming() const {
}
DocumentLoader* PerformanceNavigationTiming::documentLoader() const {
- return m_frame->loader().documentLoader();
+ if (!frame())
+ return nullptr;
+ return frame()->loader().documentLoader();
}
const DocumentTiming* PerformanceNavigationTiming::documentTiming() const {
- Document* document = m_frame->document();
+ if (!frame())
+ return nullptr;
+ Document* document = frame()->document();
if (!document)
return nullptr;
@@ -86,7 +90,7 @@ AtomicString PerformanceNavigationTiming::initiatorType() const {
}
bool PerformanceNavigationTiming::getAllowRedirectDetails() const {
- ExecutionContext* context = m_frame->document();
+ ExecutionContext* context = frame() ? frame()->document() : nullptr;
SecurityOrigin* securityOrigin = nullptr;
if (context)
securityOrigin = context->getSecurityOrigin();
@@ -173,8 +177,9 @@ DOMHighResTimeStamp PerformanceNavigationTiming::loadEventEnd() const {
AtomicString PerformanceNavigationTiming::type() const {
DocumentLoader* loader = documentLoader();
- DCHECK(loader);
- Document* document = m_frame->document();
+ if (!loader)
+ return "navigate";
+ Document* document = frame() ? frame()->document(): nullptr;
switch (PerformanceBase::getNavigationType(loader->getNavigationType(),
document)) {
case NavigationType::Prerender:
« no previous file with comments | « third_party/WebKit/Source/core/timing/PerformanceNavigationTiming.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698