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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 if (!isApplicationCacheEnabled()) | 81 if (!isApplicationCacheEnabled()) |
82 return; | 82 return; |
83 | 83 |
84 ASSERT(m_documentLoader->frame()); | 84 ASSERT(m_documentLoader->frame()); |
85 LocalFrame& frame = *m_documentLoader->frame(); | 85 LocalFrame& frame = *m_documentLoader->frame(); |
86 m_host = frame.loader().client()->createApplicationCacheHost(this); | 86 m_host = frame.loader().client()->createApplicationCacheHost(this); |
87 if (m_host) { | 87 if (m_host) { |
88 WrappedResourceRequest wrapped(request); | 88 WrappedResourceRequest wrapped(request); |
89 | 89 |
90 const WebApplicationCacheHost* spawningHost = 0; | 90 const WebApplicationCacheHost* spawningHost = 0; |
91 LocalFrame* spawningFrame = frame.tree().parent(); | 91 Frame* spawningFrame = frame.tree().parent(); |
92 if (!spawningFrame) | 92 if (!spawningFrame || !spawningFrame->isLocalFrame()) |
93 spawningFrame = frame.loader().opener(); | 93 spawningFrame = frame.loader().opener(); |
94 if (!spawningFrame) | 94 if (!spawningFrame || !spawningFrame->isLocalFrame()) |
95 spawningFrame = &frame; | 95 spawningFrame = &frame; |
96 if (DocumentLoader* spawningDocLoader = spawningFrame->loader().document
Loader()) | 96 if (DocumentLoader* spawningDocLoader = toLocalFrame(spawningFrame)->loa
der().documentLoader()) |
97 spawningHost = spawningDocLoader->applicationCacheHost() ? spawningD
ocLoader->applicationCacheHost()->m_host.get() : 0; | 97 spawningHost = spawningDocLoader->applicationCacheHost() ? spawningD
ocLoader->applicationCacheHost()->m_host.get() : 0; |
98 | 98 |
99 m_host->willStartMainResourceRequest(wrapped, spawningHost); | 99 m_host->willStartMainResourceRequest(wrapped, spawningHost); |
100 } | 100 } |
101 | 101 |
102 // NOTE: The semantics of this method, and others in this interface, are sub
tly different | 102 // NOTE: The semantics of this method, and others in this interface, are sub
tly different |
103 // than the method names would suggest. For example, in this method never re
turns an appcached | 103 // than the method names would suggest. For example, in this method never re
turns an appcached |
104 // response in the SubstituteData out argument, instead we return the appcac
hed response thru | 104 // response in the SubstituteData out argument, instead we return the appcac
hed response thru |
105 // the usual resource loading pipeline. | 105 // the usual resource loading pipeline. |
106 } | 106 } |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 { | 271 { |
272 notifyApplicationCache(PROGRESS_EVENT, progressTotal, progressDone, blink::W
ebApplicationCacheHost::UnknownError, String(), 0, String()); | 272 notifyApplicationCache(PROGRESS_EVENT, progressTotal, progressDone, blink::W
ebApplicationCacheHost::UnknownError, String(), 0, String()); |
273 } | 273 } |
274 | 274 |
275 void ApplicationCacheHost::notifyErrorEventListener(blink::WebApplicationCacheHo
st::ErrorReason reason, const blink::WebURL& url, int status, const blink::WebSt
ring& message) | 275 void ApplicationCacheHost::notifyErrorEventListener(blink::WebApplicationCacheHo
st::ErrorReason reason, const blink::WebURL& url, int status, const blink::WebSt
ring& message) |
276 { | 276 { |
277 notifyApplicationCache(ERROR_EVENT, 0, 0, reason, url.string(), status, mess
age); | 277 notifyApplicationCache(ERROR_EVENT, 0, 0, reason, url.string(), status, mess
age); |
278 } | 278 } |
279 | 279 |
280 } // namespace WebCore | 280 } // namespace WebCore |
OLD | NEW |