| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |