| OLD | NEW |
| 1 /* | 1 /* |
| 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) | 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) |
| 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) | 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) |
| 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) | 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) |
| 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
rights reserved. | 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
rights reserved. |
| 6 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ | 6 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ |
| 7 | 7 |
| 8 This library is free software; you can redistribute it and/or | 8 This library is free software; you can redistribute it and/or |
| 9 modify it under the terms of the GNU Library General Public | 9 modify it under the terms of the GNU Library General Public |
| 10 License as published by the Free Software Foundation; either | 10 License as published by the Free Software Foundation; either |
| (...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 612 return false; | 612 return false; |
| 613 } | 613 } |
| 614 return true; | 614 return true; |
| 615 } | 615 } |
| 616 | 616 |
| 617 bool ResourceFetcher::isControlledByServiceWorker() const | 617 bool ResourceFetcher::isControlledByServiceWorker() const |
| 618 { | 618 { |
| 619 LocalFrame* localFrame = frame(); | 619 LocalFrame* localFrame = frame(); |
| 620 if (!localFrame) | 620 if (!localFrame) |
| 621 return false; | 621 return false; |
| 622 if (!m_documentLoader) | 622 ASSERT(m_documentLoader || localFrame->loader().documentLoader()); |
| 623 return false; | 623 if (m_documentLoader) |
| 624 return localFrame->loader().client()->isControlledByServiceWorker(*m_documen
tLoader); | 624 return localFrame->loader().client()->isControlledByServiceWorker(*m_doc
umentLoader); |
| 625 // m_documentLoader is null while loading resources from the imported HTML. |
| 626 // In such cases whether the request is controlled by ServiceWorker or not |
| 627 // is determined by the document loader of the frame. |
| 628 return localFrame->loader().client()->isControlledByServiceWorker(*localFram
e->loader().documentLoader()); |
| 625 } | 629 } |
| 626 | 630 |
| 627 bool ResourceFetcher::shouldLoadNewResource(Resource::Type type) const | 631 bool ResourceFetcher::shouldLoadNewResource(Resource::Type type) const |
| 628 { | 632 { |
| 629 if (!frame()) | 633 if (!frame()) |
| 630 return false; | 634 return false; |
| 631 if (!m_documentLoader) | 635 if (!m_documentLoader) |
| 632 return true; | 636 return true; |
| 633 if (type == Resource::MainResource) | 637 if (type == Resource::MainResource) |
| 634 return m_documentLoader == frame()->loader().provisionalDocumentLoader()
; | 638 return m_documentLoader == frame()->loader().provisionalDocumentLoader()
; |
| (...skipping 909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1544 | 1548 |
| 1545 void ResourceFetcher::trace(Visitor* visitor) | 1549 void ResourceFetcher::trace(Visitor* visitor) |
| 1546 { | 1550 { |
| 1547 visitor->trace(m_document); | 1551 visitor->trace(m_document); |
| 1548 visitor->trace(m_loaders); | 1552 visitor->trace(m_loaders); |
| 1549 visitor->trace(m_multipartLoaders); | 1553 visitor->trace(m_multipartLoaders); |
| 1550 ResourceLoaderHost::trace(visitor); | 1554 ResourceLoaderHost::trace(visitor); |
| 1551 } | 1555 } |
| 1552 | 1556 |
| 1553 } | 1557 } |
| OLD | NEW |