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

Unified Diff: Source/core/loader/PingLoader.cpp

Issue 1311433008: Migrate PingLoader to be a LocalFrameLifecycleObserver. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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
« Source/core/loader/PingLoader.h ('K') | « Source/core/loader/PingLoader.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/PingLoader.cpp
diff --git a/Source/core/loader/PingLoader.cpp b/Source/core/loader/PingLoader.cpp
index d0b669fb8c9efd825ac6e7746173d420ee0568e4..5e81d0177c21b3e1d649346fd708cc603ebbdb52 100644
--- a/Source/core/loader/PingLoader.cpp
+++ b/Source/core/loader/PingLoader.cpp
@@ -134,7 +134,7 @@ void PingLoader::start(LocalFrame* frame, ResourceRequest& request, const FetchI
}
PingLoader::PingLoader(LocalFrame* frame, ResourceRequest& request, const FetchInitiatorInfo& initiatorInfo, StoredCredentials credentialsAllowed)
- : PageLifecycleObserver(frame->page())
+ : LocalFrameLifecycleObserver(frame)
ncarter (slow) 2015/08/31 23:37:38 Note that we could potentially use frame->localFra
, m_timeout(this, &PingLoader::timeout)
, m_url(request.url())
, m_identifier(createUniqueIdentifier())
@@ -172,61 +172,60 @@ void PingLoader::dispose()
void PingLoader::didReceiveResponse(WebURLLoader*, const WebURLResponse& response)
{
- if (Page* page = this->page()) {
+ if (LocalFrame* frame = this->frame()) {
TRACE_EVENT_INSTANT1("devtools.timeline", "ResourceFinish", TRACE_EVENT_SCOPE_THREAD, "data", InspectorResourceFinishEvent::data(m_identifier, 0, true));
const ResourceResponse& resourceResponse = response.toResourceResponse();
- InspectorInstrumentation::didReceiveResourceResponse(page->deprecatedLocalMainFrame(), m_identifier, 0, resourceResponse, 0);
- didFailLoading(page);
+ InspectorInstrumentation::didReceiveResourceResponse(frame, m_identifier, 0, resourceResponse, 0);
+ didFailLoading(frame);
}
dispose();
}
void PingLoader::didReceiveData(WebURLLoader*, const char*, int, int)
{
- if (Page* page = this->page()) {
+ if (LocalFrame* frame = this->frame()) {
TRACE_EVENT_INSTANT1("devtools.timeline", "ResourceFinish", TRACE_EVENT_SCOPE_THREAD, "data", InspectorResourceFinishEvent::data(m_identifier, 0, true));
- didFailLoading(page);
+ didFailLoading(frame);
}
dispose();
}
void PingLoader::didFinishLoading(WebURLLoader*, double, int64_t)
{
- if (Page* page = this->page()) {
+ if (LocalFrame* frame = this->frame()) {
TRACE_EVENT_INSTANT1("devtools.timeline", "ResourceFinish", TRACE_EVENT_SCOPE_THREAD, "data", InspectorResourceFinishEvent::data(m_identifier, 0, true));
- didFailLoading(page);
+ didFailLoading(frame);
}
dispose();
}
void PingLoader::didFail(WebURLLoader*, const WebURLError& resourceError)
{
- if (Page* page = this->page()) {
+ if (LocalFrame* frame = this->frame()) {
TRACE_EVENT_INSTANT1("devtools.timeline", "ResourceFinish", TRACE_EVENT_SCOPE_THREAD, "data", InspectorResourceFinishEvent::data(m_identifier, 0, true));
- didFailLoading(page);
+ didFailLoading(frame);
}
dispose();
}
void PingLoader::timeout(Timer<PingLoader>*)
{
- if (Page* page = this->page()) {
+ if (LocalFrame* frame = this->frame()) {
TRACE_EVENT_INSTANT1("devtools.timeline", "ResourceFinish", TRACE_EVENT_SCOPE_THREAD, "data", InspectorResourceFinishEvent::data(m_identifier, 0, true));
- didFailLoading(page);
+ didFailLoading(frame);
}
dispose();
}
-void PingLoader::didFailLoading(Page* page)
+void PingLoader::didFailLoading(LocalFrame* frame)
{
- LocalFrame* frame = page->deprecatedLocalMainFrame();
InspectorInstrumentation::didFailLoading(frame, m_identifier, ResourceError::cancelledError(m_url));
frame->console().didFailLoading(m_identifier, ResourceError::cancelledError(m_url));
}
DEFINE_TRACE(PingLoader)
{
- PageLifecycleObserver::trace(visitor);
+ LocalFrameLifecycleObserver::trace(visitor);
}
} // namespace blink
« Source/core/loader/PingLoader.h ('K') | « Source/core/loader/PingLoader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698