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

Side by Side Diff: Source/core/loader/FrameFetchContext.cpp

Issue 215533004: Revert of Make start/stop loading notifications per-frame (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/loader/EmptyClients.h ('k') | Source/core/loader/FrameLoader.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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 InspectorInstrumentation::willSendRequest(m_frame, identifier, ensureLoader( loader), request, redirectResponse, initiatorInfo); 152 InspectorInstrumentation::willSendRequest(m_frame, identifier, ensureLoader( loader), request, redirectResponse, initiatorInfo);
153 } 153 }
154 154
155 void FrameFetchContext::dispatchDidLoadResourceFromMemoryCache(const ResourceReq uest& request, const ResourceResponse& response) 155 void FrameFetchContext::dispatchDidLoadResourceFromMemoryCache(const ResourceReq uest& request, const ResourceResponse& response)
156 { 156 {
157 m_frame->loader().client()->dispatchDidLoadResourceFromMemoryCache(request, response); 157 m_frame->loader().client()->dispatchDidLoadResourceFromMemoryCache(request, response);
158 } 158 }
159 159
160 void FrameFetchContext::dispatchDidReceiveResponse(DocumentLoader* loader, unsig ned long identifier, const ResourceResponse& r, ResourceLoader* resourceLoader) 160 void FrameFetchContext::dispatchDidReceiveResponse(DocumentLoader* loader, unsig ned long identifier, const ResourceResponse& r, ResourceLoader* resourceLoader)
161 { 161 {
162 m_frame->loader().progress().incrementProgress(identifier, r); 162 if (Page* page = m_frame->page())
163 page->progress().incrementProgress(identifier, r);
163 m_frame->loader().client()->dispatchDidReceiveResponse(loader, identifier, r ); 164 m_frame->loader().client()->dispatchDidReceiveResponse(loader, identifier, r );
164 InspectorInstrumentation::didReceiveResourceResponse(m_frame, identifier, en sureLoader(loader), r, resourceLoader); 165 InspectorInstrumentation::didReceiveResourceResponse(m_frame, identifier, en sureLoader(loader), r, resourceLoader);
165 } 166 }
166 167
167 void FrameFetchContext::dispatchDidReceiveData(DocumentLoader*, unsigned long id entifier, const char* data, int dataLength, int encodedDataLength) 168 void FrameFetchContext::dispatchDidReceiveData(DocumentLoader*, unsigned long id entifier, const char* data, int dataLength, int encodedDataLength)
168 { 169 {
169 m_frame->loader().progress().incrementProgress(identifier, data, dataLength) ; 170 if (Page* page = m_frame->page())
171 page->progress().incrementProgress(identifier, data, dataLength);
170 InspectorInstrumentation::didReceiveData(m_frame, identifier, data, dataLeng th, encodedDataLength); 172 InspectorInstrumentation::didReceiveData(m_frame, identifier, data, dataLeng th, encodedDataLength);
171 } 173 }
172 174
173 void FrameFetchContext::dispatchDidDownloadData(DocumentLoader*, unsigned long i dentifier, int dataLength, int encodedDataLength) 175 void FrameFetchContext::dispatchDidDownloadData(DocumentLoader*, unsigned long i dentifier, int dataLength, int encodedDataLength)
174 { 176 {
175 m_frame->loader().progress().incrementProgress(identifier, 0, dataLength); 177 if (Page* page = m_frame->page())
178 page->progress().incrementProgress(identifier, 0, dataLength);
176 InspectorInstrumentation::didReceiveData(m_frame, identifier, 0, dataLength, encodedDataLength); 179 InspectorInstrumentation::didReceiveData(m_frame, identifier, 0, dataLength, encodedDataLength);
177 } 180 }
178 181
179 void FrameFetchContext::dispatchDidFinishLoading(DocumentLoader* loader, unsigne d long identifier, double finishTime, int64_t encodedDataLength) 182 void FrameFetchContext::dispatchDidFinishLoading(DocumentLoader* loader, unsigne d long identifier, double finishTime, int64_t encodedDataLength)
180 { 183 {
181 m_frame->loader().progress().completeProgress(identifier); 184 if (Page* page = m_frame->page())
185 page->progress().completeProgress(identifier);
182 m_frame->loader().client()->dispatchDidFinishLoading(loader, identifier); 186 m_frame->loader().client()->dispatchDidFinishLoading(loader, identifier);
183 187
184 InspectorInstrumentation::didFinishLoading(m_frame, identifier, ensureLoader (loader), finishTime, encodedDataLength); 188 InspectorInstrumentation::didFinishLoading(m_frame, identifier, ensureLoader (loader), finishTime, encodedDataLength);
185 } 189 }
186 190
187 void FrameFetchContext::dispatchDidFail(DocumentLoader* loader, unsigned long id entifier, const ResourceError& error) 191 void FrameFetchContext::dispatchDidFail(DocumentLoader* loader, unsigned long id entifier, const ResourceError& error)
188 { 192 {
189 m_frame->loader().progress().completeProgress(identifier); 193 if (Page* page = m_frame->page())
194 page->progress().completeProgress(identifier);
190 InspectorInstrumentation::didFailLoading(m_frame, identifier, error); 195 InspectorInstrumentation::didFailLoading(m_frame, identifier, error);
191 } 196 }
192 197
193 void FrameFetchContext::sendRemainingDelegateMessages(DocumentLoader* loader, un signed long identifier, const ResourceResponse& response, int dataLength) 198 void FrameFetchContext::sendRemainingDelegateMessages(DocumentLoader* loader, un signed long identifier, const ResourceResponse& response, int dataLength)
194 { 199 {
195 if (!response.isNull()) 200 if (!response.isNull())
196 dispatchDidReceiveResponse(ensureLoader(loader), identifier, response); 201 dispatchDidReceiveResponse(ensureLoader(loader), identifier, response);
197 202
198 if (dataLength > 0) 203 if (dataLength > 0)
199 dispatchDidReceiveData(ensureLoader(loader), identifier, 0, dataLength, 0); 204 dispatchDidReceiveData(ensureLoader(loader), identifier, 0, dataLength, 0);
200 205
201 dispatchDidFinishLoading(ensureLoader(loader), identifier, 0, 0); 206 dispatchDidFinishLoading(ensureLoader(loader), identifier, 0, 0);
202 } 207 }
203 208
204 } // namespace WebCore 209 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/loader/EmptyClients.h ('k') | Source/core/loader/FrameLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698