| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 | 132 |
| 133 PingLoader::PingLoader(LocalFrame* frame, ResourceRequest& request, const FetchI
nitiatorInfo& initiatorInfo, StoredCredentials credentialsAllowed) | 133 PingLoader::PingLoader(LocalFrame* frame, ResourceRequest& request, const FetchI
nitiatorInfo& initiatorInfo, StoredCredentials credentialsAllowed) |
| 134 : LocalFrameLifecycleObserver(frame) | 134 : LocalFrameLifecycleObserver(frame) |
| 135 , m_timeout(this, &PingLoader::timeout) | 135 , m_timeout(this, &PingLoader::timeout) |
| 136 , m_url(request.url()) | 136 , m_url(request.url()) |
| 137 , m_identifier(createUniqueIdentifier()) | 137 , m_identifier(createUniqueIdentifier()) |
| 138 , m_keepAlive(this) | 138 , m_keepAlive(this) |
| 139 { | 139 { |
| 140 frame->loader().client()->didDispatchPingLoader(request.url()); | 140 frame->loader().client()->didDispatchPingLoader(request.url()); |
| 141 frame->document()->fetcher()->context().willStartLoadingResource(m_identifie
r, request, Resource::Image); | 141 frame->document()->fetcher()->context().willStartLoadingResource(m_identifie
r, request, Resource::Image); |
| 142 frame->document()->fetcher()->context().prepareRequest(m_identifier, request
, ResourceResponse()); |
| 142 frame->document()->fetcher()->context().dispatchWillSendRequest(m_identifier
, request, ResourceResponse(), initiatorInfo); | 143 frame->document()->fetcher()->context().dispatchWillSendRequest(m_identifier
, request, ResourceResponse(), initiatorInfo); |
| 143 | 144 |
| 144 m_loader = wrapUnique(Platform::current()->createURLLoader()); | 145 m_loader = wrapUnique(Platform::current()->createURLLoader()); |
| 145 ASSERT(m_loader); | 146 ASSERT(m_loader); |
| 146 WrappedResourceRequest wrappedRequest(request); | 147 WrappedResourceRequest wrappedRequest(request); |
| 147 wrappedRequest.setAllowStoredCredentials(credentialsAllowed == AllowStoredCr
edentials); | 148 wrappedRequest.setAllowStoredCredentials(credentialsAllowed == AllowStoredCr
edentials); |
| 148 m_loader->loadAsynchronously(wrappedRequest, this); | 149 m_loader->loadAsynchronously(wrappedRequest, this); |
| 149 | 150 |
| 150 // If the server never responds, FrameLoader won't be able to cancel this lo
ad and | 151 // If the server never responds, FrameLoader won't be able to cancel this lo
ad and |
| 151 // we'll sit here waiting forever. Set a very generous timeout, just in case
. | 152 // we'll sit here waiting forever. Set a very generous timeout, just in case
. |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 InspectorInstrumentation::didFailLoading(frame, m_identifier, ResourceError:
:cancelledError(m_url)); | 221 InspectorInstrumentation::didFailLoading(frame, m_identifier, ResourceError:
:cancelledError(m_url)); |
| 221 frame->console().didFailLoading(m_identifier, ResourceError::cancelledError(
m_url)); | 222 frame->console().didFailLoading(m_identifier, ResourceError::cancelledError(
m_url)); |
| 222 } | 223 } |
| 223 | 224 |
| 224 DEFINE_TRACE(PingLoader) | 225 DEFINE_TRACE(PingLoader) |
| 225 { | 226 { |
| 226 LocalFrameLifecycleObserver::trace(visitor); | 227 LocalFrameLifecycleObserver::trace(visitor); |
| 227 } | 228 } |
| 228 | 229 |
| 229 } // namespace blink | 230 } // namespace blink |
| OLD | NEW |