OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 | 302 |
303 bool FrameFetchContext::shouldLoadNewResource(Resource::Type type) const | 303 bool FrameFetchContext::shouldLoadNewResource(Resource::Type type) const |
304 { | 304 { |
305 if (!m_documentLoader) | 305 if (!m_documentLoader) |
306 return true; | 306 return true; |
307 if (type == Resource::MainResource) | 307 if (type == Resource::MainResource) |
308 return m_documentLoader == frame()->loader().provisionalDocumentLoader()
; | 308 return m_documentLoader == frame()->loader().provisionalDocumentLoader()
; |
309 return m_documentLoader == frame()->loader().documentLoader(); | 309 return m_documentLoader == frame()->loader().documentLoader(); |
310 } | 310 } |
311 | 311 |
312 void FrameFetchContext::willStartLoadingResource(ResourceRequest& request, Fetch
ResourceType type) | 312 void FrameFetchContext::willStartLoadingResource(ResourceRequest& request) |
313 { | 313 { |
314 if (!m_documentLoader) | 314 if (m_documentLoader) |
315 return; | 315 m_documentLoader->applicationCacheHost()->willStartLoadingResource(reque
st); |
316 if (type == FetchMainResource) | |
317 m_documentLoader->applicationCacheHost()->willStartLoadingMainResource(r
equest); | |
318 m_documentLoader->applicationCacheHost()->willStartLoadingResource(request); | |
319 } | 316 } |
320 | 317 |
321 void FrameFetchContext::didLoadResource() | 318 void FrameFetchContext::didLoadResource() |
322 { | 319 { |
323 frame()->loader().checkCompleted(); | 320 frame()->loader().checkCompleted(); |
324 } | 321 } |
325 | 322 |
326 void FrameFetchContext::addResourceTiming(const ResourceTimingInfo& info) | 323 void FrameFetchContext::addResourceTiming(const ResourceTimingInfo& info) |
327 { | 324 { |
328 Document* initiatorDocument = m_document && info.isMainResource() ? m_docume
nt->parentDocument() : m_document.get(); | 325 Document* initiatorDocument = m_document && info.isMainResource() ? m_docume
nt->parentDocument() : m_document.get(); |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
745 } | 742 } |
746 | 743 |
747 DEFINE_TRACE(FrameFetchContext) | 744 DEFINE_TRACE(FrameFetchContext) |
748 { | 745 { |
749 visitor->trace(m_document); | 746 visitor->trace(m_document); |
750 visitor->trace(m_documentLoader); | 747 visitor->trace(m_documentLoader); |
751 FetchContext::trace(visitor); | 748 FetchContext::trace(visitor); |
752 } | 749 } |
753 | 750 |
754 } // namespace blink | 751 } // namespace blink |
OLD | NEW |