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

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

Issue 156623005: Add transfer size paramater to didFinishLoading [3/3] (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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
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 23 matching lines...) Expand all
34 #include "core/dom/Document.h" 34 #include "core/dom/Document.h"
35 #include "core/inspector/InspectorInstrumentation.h" 35 #include "core/inspector/InspectorInstrumentation.h"
36 #include "core/loader/DocumentLoader.h" 36 #include "core/loader/DocumentLoader.h"
37 #include "core/loader/FrameLoader.h" 37 #include "core/loader/FrameLoader.h"
38 #include "core/loader/FrameLoaderClient.h" 38 #include "core/loader/FrameLoaderClient.h"
39 #include "core/loader/ProgressTracker.h" 39 #include "core/loader/ProgressTracker.h"
40 #include "core/frame/Frame.h" 40 #include "core/frame/Frame.h"
41 #include "core/page/Page.h" 41 #include "core/page/Page.h"
42 #include "core/frame/Settings.h" 42 #include "core/frame/Settings.h"
43 #include "platform/weborigin/SecurityPolicy.h" 43 #include "platform/weborigin/SecurityPolicy.h"
44 #include "public/platform/WebURLLoaderClient.h"
44 45
45 namespace WebCore { 46 namespace WebCore {
46 47
47 static const char defaultAcceptHeader[] = "text/html,application/xhtml+xml,appli cation/xml;q=0.9,image/webp,*/*;q=0.8"; 48 static const char defaultAcceptHeader[] = "text/html,application/xhtml+xml,appli cation/xml;q=0.9,image/webp,*/*;q=0.8";
48 49
49 FrameFetchContext::FrameFetchContext(Frame* frame) 50 FrameFetchContext::FrameFetchContext(Frame* frame)
50 : m_frame(frame) 51 : m_frame(frame)
51 { 52 {
52 } 53 }
53 54
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 InspectorInstrumentation::didReceiveData(m_frame, identifier, data, dataLeng th, encodedDataLength); 173 InspectorInstrumentation::didReceiveData(m_frame, identifier, data, dataLeng th, encodedDataLength);
173 } 174 }
174 175
175 void FrameFetchContext::dispatchDidDownloadData(DocumentLoader*, unsigned long i dentifier, int dataLength, int encodedDataLength) 176 void FrameFetchContext::dispatchDidDownloadData(DocumentLoader*, unsigned long i dentifier, int dataLength, int encodedDataLength)
176 { 177 {
177 if (Page* page = m_frame->page()) 178 if (Page* page = m_frame->page())
178 page->progress().incrementProgress(identifier, 0, dataLength); 179 page->progress().incrementProgress(identifier, 0, dataLength);
179 InspectorInstrumentation::didReceiveData(m_frame, identifier, 0, dataLength, encodedDataLength); 180 InspectorInstrumentation::didReceiveData(m_frame, identifier, 0, dataLength, encodedDataLength);
180 } 181 }
181 182
182 void FrameFetchContext::dispatchDidFinishLoading(DocumentLoader* loader, unsigne d long identifier, double finishTime) 183 void FrameFetchContext::dispatchDidFinishLoading(DocumentLoader* loader, unsigne d long identifier, double finishTime, int64_t encodedDataLength)
183 { 184 {
184 if (Page* page = m_frame->page()) 185 if (Page* page = m_frame->page())
185 page->progress().completeProgress(identifier); 186 page->progress().completeProgress(identifier);
186 m_frame->loader().client()->dispatchDidFinishLoading(loader, identifier); 187 m_frame->loader().client()->dispatchDidFinishLoading(loader, identifier);
187 188
188 InspectorInstrumentation::didFinishLoading(m_frame, identifier, ensureLoader (loader), finishTime); 189 InspectorInstrumentation::didFinishLoading(m_frame, identifier, ensureLoader (loader), finishTime, encodedDataLength);
189 } 190 }
190 191
191 void FrameFetchContext::dispatchDidFail(DocumentLoader* loader, unsigned long id entifier, const ResourceError& error) 192 void FrameFetchContext::dispatchDidFail(DocumentLoader* loader, unsigned long id entifier, const ResourceError& error)
192 { 193 {
193 if (Page* page = m_frame->page()) 194 if (Page* page = m_frame->page())
194 page->progress().completeProgress(identifier); 195 page->progress().completeProgress(identifier);
195 InspectorInstrumentation::didFailLoading(m_frame, identifier, ensureLoader(l oader), error); 196 InspectorInstrumentation::didFailLoading(m_frame, identifier, ensureLoader(l oader), error);
196 } 197 }
197 198
198 void FrameFetchContext::sendRemainingDelegateMessages(DocumentLoader* loader, un signed long identifier, const ResourceResponse& response, int dataLength) 199 void FrameFetchContext::sendRemainingDelegateMessages(DocumentLoader* loader, un signed long identifier, const ResourceResponse& response, int dataLength)
199 { 200 {
200 if (!response.isNull()) 201 if (!response.isNull())
201 dispatchDidReceiveResponse(ensureLoader(loader), identifier, response); 202 dispatchDidReceiveResponse(ensureLoader(loader), identifier, response);
202 203
203 if (dataLength > 0) 204 if (dataLength > 0)
204 dispatchDidReceiveData(ensureLoader(loader), identifier, 0, dataLength, 0); 205 dispatchDidReceiveData(ensureLoader(loader), identifier, 0, dataLength, 0);
205 206
206 dispatchDidFinishLoading(ensureLoader(loader), identifier, 0); 207 dispatchDidFinishLoading(ensureLoader(loader), identifier, 0, blink::WebURLL oaderClient::kUnknownEncodedDataLength);
vsevik 2014/02/07 09:37:08 0, we have loaded from memory cache.
eustas 2014/02/10 12:36:02 Done.
207 } 208 }
208 209
209 } // namespace WebCore 210 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698