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

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

Issue 216083002: Revert of 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 if (Page* page = m_frame->page()) 162 m_frame->loader().progress().incrementProgress(identifier, r);
163 page->progress().incrementProgress(identifier, r);
164 m_frame->loader().client()->dispatchDidReceiveResponse(loader, identifier, r ); 163 m_frame->loader().client()->dispatchDidReceiveResponse(loader, identifier, r );
165 InspectorInstrumentation::didReceiveResourceResponse(m_frame, identifier, en sureLoader(loader), r, resourceLoader); 164 InspectorInstrumentation::didReceiveResourceResponse(m_frame, identifier, en sureLoader(loader), r, resourceLoader);
166 } 165 }
167 166
168 void FrameFetchContext::dispatchDidReceiveData(DocumentLoader*, unsigned long id entifier, const char* data, int dataLength, int encodedDataLength) 167 void FrameFetchContext::dispatchDidReceiveData(DocumentLoader*, unsigned long id entifier, const char* data, int dataLength, int encodedDataLength)
169 { 168 {
170 if (Page* page = m_frame->page()) 169 m_frame->loader().progress().incrementProgress(identifier, data, dataLength) ;
171 page->progress().incrementProgress(identifier, data, dataLength);
172 InspectorInstrumentation::didReceiveData(m_frame, identifier, data, dataLeng th, encodedDataLength); 170 InspectorInstrumentation::didReceiveData(m_frame, identifier, data, dataLeng th, encodedDataLength);
173 } 171 }
174 172
175 void FrameFetchContext::dispatchDidDownloadData(DocumentLoader*, unsigned long i dentifier, int dataLength, int encodedDataLength) 173 void FrameFetchContext::dispatchDidDownloadData(DocumentLoader*, unsigned long i dentifier, int dataLength, int encodedDataLength)
176 { 174 {
177 if (Page* page = m_frame->page()) 175 m_frame->loader().progress().incrementProgress(identifier, 0, dataLength);
178 page->progress().incrementProgress(identifier, 0, dataLength);
179 InspectorInstrumentation::didReceiveData(m_frame, identifier, 0, dataLength, encodedDataLength); 176 InspectorInstrumentation::didReceiveData(m_frame, identifier, 0, dataLength, encodedDataLength);
180 } 177 }
181 178
182 void FrameFetchContext::dispatchDidFinishLoading(DocumentLoader* loader, unsigne d long identifier, double finishTime, int64_t encodedDataLength) 179 void FrameFetchContext::dispatchDidFinishLoading(DocumentLoader* loader, unsigne d long identifier, double finishTime, int64_t encodedDataLength)
183 { 180 {
184 if (Page* page = m_frame->page()) 181 m_frame->loader().progress().completeProgress(identifier);
185 page->progress().completeProgress(identifier);
186 m_frame->loader().client()->dispatchDidFinishLoading(loader, identifier); 182 m_frame->loader().client()->dispatchDidFinishLoading(loader, identifier);
187 183
188 InspectorInstrumentation::didFinishLoading(m_frame, identifier, ensureLoader (loader), finishTime, encodedDataLength); 184 InspectorInstrumentation::didFinishLoading(m_frame, identifier, ensureLoader (loader), finishTime, encodedDataLength);
189 } 185 }
190 186
191 void FrameFetchContext::dispatchDidFail(DocumentLoader* loader, unsigned long id entifier, const ResourceError& error) 187 void FrameFetchContext::dispatchDidFail(DocumentLoader* loader, unsigned long id entifier, const ResourceError& error)
192 { 188 {
193 if (Page* page = m_frame->page()) 189 m_frame->loader().progress().completeProgress(identifier);
194 page->progress().completeProgress(identifier);
195 InspectorInstrumentation::didFailLoading(m_frame, identifier, error); 190 InspectorInstrumentation::didFailLoading(m_frame, identifier, error);
196 } 191 }
197 192
198 void FrameFetchContext::sendRemainingDelegateMessages(DocumentLoader* loader, un signed long identifier, const ResourceResponse& response, int dataLength) 193 void FrameFetchContext::sendRemainingDelegateMessages(DocumentLoader* loader, un signed long identifier, const ResourceResponse& response, int dataLength)
199 { 194 {
200 if (!response.isNull()) 195 if (!response.isNull())
201 dispatchDidReceiveResponse(ensureLoader(loader), identifier, response); 196 dispatchDidReceiveResponse(ensureLoader(loader), identifier, response);
202 197
203 if (dataLength > 0) 198 if (dataLength > 0)
204 dispatchDidReceiveData(ensureLoader(loader), identifier, 0, dataLength, 0); 199 dispatchDidReceiveData(ensureLoader(loader), identifier, 0, dataLength, 0);
205 200
206 dispatchDidFinishLoading(ensureLoader(loader), identifier, 0, 0); 201 dispatchDidFinishLoading(ensureLoader(loader), identifier, 0, 0);
207 } 202 }
208 203
209 } // namespace WebCore 204 } // 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