| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 void ApplicationCacheHost::setApplicationCache(ApplicationCache* domApplicationC
ache) | 177 void ApplicationCacheHost::setApplicationCache(ApplicationCache* domApplicationC
ache) |
| 178 { | 178 { |
| 179 ASSERT(!m_domApplicationCache || !domApplicationCache); | 179 ASSERT(!m_domApplicationCache || !domApplicationCache); |
| 180 m_domApplicationCache = domApplicationCache; | 180 m_domApplicationCache = domApplicationCache; |
| 181 } | 181 } |
| 182 | 182 |
| 183 void ApplicationCacheHost::detachFromDocumentLoader() | 183 void ApplicationCacheHost::detachFromDocumentLoader() |
| 184 { | 184 { |
| 185 // Detach from the owning DocumentLoader and let go of WebApplicationCacheHo
st. | 185 // Detach from the owning DocumentLoader and let go of WebApplicationCacheHo
st. |
| 186 setApplicationCache(nullptr); | 186 setApplicationCache(nullptr); |
| 187 m_host.clear(); | 187 m_host.reset(); |
| 188 m_documentLoader = nullptr; | 188 m_documentLoader = nullptr; |
| 189 } | 189 } |
| 190 | 190 |
| 191 void ApplicationCacheHost::notifyApplicationCache(EventID id, int progressTotal,
int progressDone, WebApplicationCacheHost::ErrorReason errorReason, const Strin
g& errorURL, int errorStatus, const String& errorMessage) | 191 void ApplicationCacheHost::notifyApplicationCache(EventID id, int progressTotal,
int progressDone, WebApplicationCacheHost::ErrorReason errorReason, const Strin
g& errorURL, int errorStatus, const String& errorMessage) |
| 192 { | 192 { |
| 193 if (id != PROGRESS_EVENT) | 193 if (id != PROGRESS_EVENT) |
| 194 InspectorInstrumentation::updateApplicationCacheStatus(m_documentLoader-
>frame()); | 194 InspectorInstrumentation::updateApplicationCacheStatus(m_documentLoader-
>frame()); |
| 195 | 195 |
| 196 if (m_defersEvents) { | 196 if (m_defersEvents) { |
| 197 // Event dispatching is deferred until document.onload has fired. | 197 // Event dispatching is deferred until document.onload has fired. |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 notifyApplicationCache(ERROR_EVENT, 0, 0, reason, url.string(), status, mess
age); | 303 notifyApplicationCache(ERROR_EVENT, 0, 0, reason, url.string(), status, mess
age); |
| 304 } | 304 } |
| 305 | 305 |
| 306 DEFINE_TRACE(ApplicationCacheHost) | 306 DEFINE_TRACE(ApplicationCacheHost) |
| 307 { | 307 { |
| 308 visitor->trace(m_domApplicationCache); | 308 visitor->trace(m_domApplicationCache); |
| 309 visitor->trace(m_documentLoader); | 309 visitor->trace(m_documentLoader); |
| 310 } | 310 } |
| 311 | 311 |
| 312 } // namespace blink | 312 } // namespace blink |
| OLD | NEW |