| 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 | 118 |
| 119 // Leak the ping loader, since it will kill itself as soon as it receives a
response. | 119 // Leak the ping loader, since it will kill itself as soon as it receives a
response. |
| 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 unsigned long identifier = createUniqueIdentifier(); | 127 unsigned long identifier = createUniqueIdentifier(); |
| 128 m_handle = ResourceHandle::create(frame->loader()->networkingContext(), requ
est, this, false, false, credentialsAllowed); | 128 m_handle = ResourceHandle::create(request, this, false, false, credentialsAl
lowed); |
| 129 | 129 |
| 130 InspectorInstrumentation::continueAfterPingLoader(frame, identifier, frame->
loader()->activeDocumentLoader(), request, ResourceResponse()); | 130 InspectorInstrumentation::continueAfterPingLoader(frame, identifier, frame->
loader()->activeDocumentLoader(), request, ResourceResponse()); |
| 131 | 131 |
| 132 // If the server never responds, FrameLoader won't be able to cancel this lo
ad and | 132 // If the server never responds, FrameLoader won't be able to cancel this lo
ad and |
| 133 // we'll sit here waiting forever. Set a very generous timeout, just in case
. | 133 // we'll sit here waiting forever. Set a very generous timeout, just in case
. |
| 134 m_timeout.startOneShot(60000); | 134 m_timeout.startOneShot(60000); |
| 135 } | 135 } |
| 136 | 136 |
| 137 PingLoader::~PingLoader() | 137 PingLoader::~PingLoader() |
| 138 { | 138 { |
| 139 if (m_handle) | 139 if (m_handle) |
| 140 m_handle->cancel(); | 140 m_handle->cancel(); |
| 141 } | 141 } |
| 142 | 142 |
| 143 } | 143 } |
| OLD | NEW |