OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2010, 2011 Apple Inc. All rights reserved. |
3 * (C) 2007 Graham Dennis (graham.dennis@gmail.com) | 3 * (C) 2007 Graham Dennis (graham.dennis@gmail.com) |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 26 matching lines...) Expand all Loading... |
37 #include "core/platform/SharedBuffer.h" | 37 #include "core/platform/SharedBuffer.h" |
38 #include "core/platform/chromium/support/WrappedResourceRequest.h" | 38 #include "core/platform/chromium/support/WrappedResourceRequest.h" |
39 #include "core/platform/chromium/support/WrappedResourceResponse.h" | 39 #include "core/platform/chromium/support/WrappedResourceResponse.h" |
40 #include "core/platform/network/ResourceError.h" | 40 #include "core/platform/network/ResourceError.h" |
41 #include "public/platform/Platform.h" | 41 #include "public/platform/Platform.h" |
42 #include "public/platform/WebData.h" | 42 #include "public/platform/WebData.h" |
43 #include "public/platform/WebURLError.h" | 43 #include "public/platform/WebURLError.h" |
44 #include "public/platform/WebURLRequest.h" | 44 #include "public/platform/WebURLRequest.h" |
45 #include "public/platform/WebURLResponse.h" | 45 #include "public/platform/WebURLResponse.h" |
46 #include "wtf/Assertions.h" | 46 #include "wtf/Assertions.h" |
| 47 #include "wtf/CurrentTime.h" |
47 | 48 |
48 namespace WebCore { | 49 namespace WebCore { |
49 | 50 |
50 ResourceLoader::RequestCountTracker::RequestCountTracker(ResourceLoaderHost* hos
t, Resource* resource) | 51 ResourceLoader::RequestCountTracker::RequestCountTracker(ResourceLoaderHost* hos
t, Resource* resource) |
51 : m_host(host) | 52 : m_host(host) |
52 , m_resource(resource) | 53 , m_resource(resource) |
53 { | 54 { |
54 m_host->incrementRequestCount(m_resource); | 55 m_host->incrementRequestCount(m_resource); |
55 } | 56 } |
56 | 57 |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 WebKit::WebData dataOut; | 409 WebKit::WebData dataOut; |
409 loader->loadSynchronously(requestIn, responseOut, errorOut, dataOut); | 410 loader->loadSynchronously(requestIn, responseOut, errorOut, dataOut); |
410 if (errorOut.reason) { | 411 if (errorOut.reason) { |
411 didFail(0, errorOut); | 412 didFail(0, errorOut); |
412 return; | 413 return; |
413 } | 414 } |
414 didReceiveResponse(0, responseOut); | 415 didReceiveResponse(0, responseOut); |
415 RefPtr<ResourceLoadInfo> resourceLoadInfo = responseOut.toResourceResponse()
.resourceLoadInfo(); | 416 RefPtr<ResourceLoadInfo> resourceLoadInfo = responseOut.toResourceResponse()
.resourceLoadInfo(); |
416 m_host->didReceiveData(m_resource, dataOut.data(), dataOut.size(), resourceL
oadInfo ? resourceLoadInfo->encodedDataLength : -1, m_options); | 417 m_host->didReceiveData(m_resource, dataOut.data(), dataOut.size(), resourceL
oadInfo ? resourceLoadInfo->encodedDataLength : -1, m_options); |
417 m_resource->setResourceBuffer(dataOut); | 418 m_resource->setResourceBuffer(dataOut); |
418 didFinishLoading(0, responseOut.responseTime()); | 419 didFinishLoading(0, monotonicallyIncreasingTime()); |
419 } | 420 } |
420 | 421 |
421 } | 422 } |
OLD | NEW |