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

Side by Side Diff: third_party/WebKit/Source/core/timing/PerformanceBase.cpp

Issue 2761113002: Move getNavigationType logic from PerformanceBase to PerformanceNavigationTiming. (Closed)
Patch Set: sync to HEAD Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * Copyright (C) 2012 Intel Inc. All rights reserved. 3 * Copyright (C) 2012 Intel Inc. All rights reserved.
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 are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 m_userTiming(nullptr), 73 m_userTiming(nullptr),
74 m_timeOrigin(timeOrigin), 74 m_timeOrigin(timeOrigin),
75 m_observerFilterOptions(PerformanceEntry::Invalid), 75 m_observerFilterOptions(PerformanceEntry::Invalid),
76 m_deliverObservationsTimer( 76 m_deliverObservationsTimer(
77 std::move(taskRunner), 77 std::move(taskRunner),
78 this, 78 this,
79 &PerformanceBase::deliverObservationsTimerFired) {} 79 &PerformanceBase::deliverObservationsTimerFired) {}
80 80
81 PerformanceBase::~PerformanceBase() {} 81 PerformanceBase::~PerformanceBase() {}
82 82
83 PerformanceNavigationTiming::NavigationType PerformanceBase::getNavigationType(
84 NavigationType type,
85 const Document* document) {
86 if (document &&
87 document->pageVisibilityState() == PageVisibilityStatePrerender) {
88 return PerformanceNavigationTiming::NavigationType::Prerender;
89 }
90 switch (type) {
91 case NavigationTypeReload:
92 return PerformanceNavigationTiming::NavigationType::Reload;
93 case NavigationTypeBackForward:
94 return PerformanceNavigationTiming::NavigationType::BackForward;
95 case NavigationTypeLinkClicked:
96 case NavigationTypeFormSubmitted:
97 case NavigationTypeFormResubmitted:
98 case NavigationTypeOther:
99 return PerformanceNavigationTiming::NavigationType::Navigate;
100 }
101 NOTREACHED();
102 return PerformanceNavigationTiming::NavigationType::Navigate;
103 }
104
105 const AtomicString& PerformanceBase::interfaceName() const { 83 const AtomicString& PerformanceBase::interfaceName() const {
106 return EventTargetNames::Performance; 84 return EventTargetNames::Performance;
107 } 85 }
108 86
109 PerformanceTiming* PerformanceBase::timing() const { 87 PerformanceTiming* PerformanceBase::timing() const {
110 return nullptr; 88 return nullptr;
111 } 89 }
112 90
113 PerformanceEntryVector PerformanceBase::getEntries() { 91 PerformanceEntryVector PerformanceBase::getEntries() {
114 PerformanceEntryVector entries; 92 PerformanceEntryVector entries;
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 visitor->trace(m_resourceTimingBuffer); 533 visitor->trace(m_resourceTimingBuffer);
556 visitor->trace(m_navigationTiming); 534 visitor->trace(m_navigationTiming);
557 visitor->trace(m_userTiming); 535 visitor->trace(m_userTiming);
558 visitor->trace(m_observers); 536 visitor->trace(m_observers);
559 visitor->trace(m_activeObservers); 537 visitor->trace(m_activeObservers);
560 visitor->trace(m_suspendedObservers); 538 visitor->trace(m_suspendedObservers);
561 EventTargetWithInlineData::trace(visitor); 539 EventTargetWithInlineData::trace(visitor);
562 } 540 }
563 541
564 } // namespace blink 542 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/timing/PerformanceBase.h ('k') | third_party/WebKit/Source/core/timing/PerformanceBaseTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698