| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 PingLoader* leakedPingLoader = pingLoader.leakPtr(); | 120 PingLoader* leakedPingLoader = pingLoader.leakPtr(); |
| 121 UNUSED_PARAM(leakedPingLoader); | 121 UNUSED_PARAM(leakedPingLoader); |
| 122 } | 122 } |
| 123 | 123 |
| 124 PingLoader::PingLoader(Frame* frame, ResourceRequest& request, StoredCredentials
credentialsAllowed) | 124 PingLoader::PingLoader(Frame* frame, ResourceRequest& request, StoredCredentials
credentialsAllowed) |
| 125 : m_timeout(this, &PingLoader::timeout) | 125 : m_timeout(this, &PingLoader::timeout) |
| 126 { | 126 { |
| 127 frame->loader().client()->didDispatchPingLoader(request.url()); | 127 frame->loader().client()->didDispatchPingLoader(request.url()); |
| 128 | 128 |
| 129 unsigned long identifier = createUniqueIdentifier(); | 129 unsigned long identifier = createUniqueIdentifier(); |
| 130 m_loader = adoptPtr(WebKit::Platform::current()->createURLLoader()); | 130 m_loader = adoptPtr(blink::Platform::current()->createURLLoader()); |
| 131 ASSERT(m_loader); | 131 ASSERT(m_loader); |
| 132 WebKit::WrappedResourceRequest wrappedRequest(request); | 132 blink::WrappedResourceRequest wrappedRequest(request); |
| 133 wrappedRequest.setAllowStoredCredentials(credentialsAllowed == AllowStoredCr
edentials); | 133 wrappedRequest.setAllowStoredCredentials(credentialsAllowed == AllowStoredCr
edentials); |
| 134 m_loader->loadAsynchronously(wrappedRequest, this); | 134 m_loader->loadAsynchronously(wrappedRequest, this); |
| 135 | 135 |
| 136 InspectorInstrumentation::continueAfterPingLoader(frame, identifier, frame->
loader().activeDocumentLoader(), request, ResourceResponse()); | 136 InspectorInstrumentation::continueAfterPingLoader(frame, identifier, frame->
loader().activeDocumentLoader(), request, ResourceResponse()); |
| 137 | 137 |
| 138 // If the server never responds, FrameLoader won't be able to cancel this lo
ad and | 138 // If the server never responds, FrameLoader won't be able to cancel this lo
ad and |
| 139 // we'll sit here waiting forever. Set a very generous timeout, just in case
. | 139 // we'll sit here waiting forever. Set a very generous timeout, just in case
. |
| 140 m_timeout.startOneShot(60000); | 140 m_timeout.startOneShot(60000); |
| 141 } | 141 } |
| 142 | 142 |
| 143 PingLoader::~PingLoader() | 143 PingLoader::~PingLoader() |
| 144 { | 144 { |
| 145 if (m_loader) | 145 if (m_loader) |
| 146 m_loader->cancel(); | 146 m_loader->cancel(); |
| 147 } | 147 } |
| 148 | 148 |
| 149 } | 149 } |
| OLD | NEW |