Chromium Code Reviews| 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 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 if (!m_documentLoader) |
| 623 return false; | 623 return false; |
| 624 return localFrame->loader().client()->isControlledByServiceWorker(*m_documen tLoader); | 624 return localFrame->loader().client()->isControlledByServiceWorker(*m_documen tLoader); |
| 625 } | 625 } |
| 626 | 626 |
| 627 int64_t ResourceFetcher::serviceWorkerID() const | |
| 628 { | |
| 629 LocalFrame* localFrame = frame(); | |
| 630 if (!localFrame) | |
| 631 return -1; | |
|
Mike West
2014/10/28 08:09:24
Why are you using -1 as the invalid value? Why not
nhiroki
2014/10/28 08:34:01
This seviceWorkerID is corresponding to the Servic
| |
| 632 if (m_documentLoader) | |
| 633 return localFrame->loader().client()->serviceWorkerID(*m_documentLoader) ; | |
| 634 // m_documentLoader is null while loading resources from the imported HTML. | |
| 635 // In such cases a service worker ID could be retrieved from the document | |
| 636 // loader of the frame. | |
| 637 ASSERT(localFrame->loader().documentLoader()); | |
| 638 return localFrame->loader().client()->serviceWorkerID(*localFrame->loader(). documentLoader()); | |
| 639 } | |
| 640 | |
| 627 bool ResourceFetcher::shouldLoadNewResource(Resource::Type type) const | 641 bool ResourceFetcher::shouldLoadNewResource(Resource::Type type) const |
| 628 { | 642 { |
| 629 if (!frame()) | 643 if (!frame()) |
| 630 return false; | 644 return false; |
| 631 if (!m_documentLoader) | 645 if (!m_documentLoader) |
| 632 return true; | 646 return true; |
| 633 if (type == Resource::MainResource) | 647 if (type == Resource::MainResource) |
| 634 return m_documentLoader == frame()->loader().provisionalDocumentLoader() ; | 648 return m_documentLoader == frame()->loader().provisionalDocumentLoader() ; |
| 635 return m_documentLoader == frame()->loader().documentLoader(); | 649 return m_documentLoader == frame()->loader().documentLoader(); |
| 636 } | 650 } |
| (...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1544 | 1558 |
| 1545 void ResourceFetcher::trace(Visitor* visitor) | 1559 void ResourceFetcher::trace(Visitor* visitor) |
| 1546 { | 1560 { |
| 1547 visitor->trace(m_document); | 1561 visitor->trace(m_document); |
| 1548 visitor->trace(m_loaders); | 1562 visitor->trace(m_loaders); |
| 1549 visitor->trace(m_multipartLoaders); | 1563 visitor->trace(m_multipartLoaders); |
| 1550 ResourceLoaderHost::trace(visitor); | 1564 ResourceLoaderHost::trace(visitor); |
| 1551 } | 1565 } |
| 1552 | 1566 |
| 1553 } | 1567 } |
| OLD | NEW |