| 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) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
rights reserved. | 4 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
rights reserved. |
| 5 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ | 5 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ |
| 6 | 6 |
| 7 This library is free software; you can redistribute it and/or | 7 This library is free software; you can redistribute it and/or |
| 8 modify it under the terms of the GNU Library General Public | 8 modify it under the terms of the GNU Library General Public |
| 9 License as published by the Free Software Foundation; either | 9 License as published by the Free Software Foundation; either |
| 10 version 2 of the License, or (at your option) any later version. | 10 version 2 of the License, or (at your option) any later version. |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 // The ResourceFetcher provides a per-context interface to the MemoryCache | 69 // The ResourceFetcher provides a per-context interface to the MemoryCache |
| 70 // and enforces a bunch of security checks and rules for resource revalidation. | 70 // and enforces a bunch of security checks and rules for resource revalidation. |
| 71 // Its lifetime is roughly per-DocumentLoader, in that it is generally created | 71 // Its lifetime is roughly per-DocumentLoader, in that it is generally created |
| 72 // in the DocumentLoader constructor and loses its ability to generate network | 72 // in the DocumentLoader constructor and loses its ability to generate network |
| 73 // requests when the DocumentLoader is destroyed. Documents also hold a | 73 // requests when the DocumentLoader is destroyed. Documents also hold a |
| 74 // RefPtr<ResourceFetcher> for their lifetime (and will create one if they | 74 // RefPtr<ResourceFetcher> for their lifetime (and will create one if they |
| 75 // are initialized without a Frame), so a Document can keep a ResourceFetcher | 75 // are initialized without a Frame), so a Document can keep a ResourceFetcher |
| 76 // alive past detach if scripts still reference the Document. | 76 // alive past detach if scripts still reference the Document. |
| 77 class ResourceFetcher : public RefCounted<ResourceFetcher>, public ResourceLoade
rHost { | 77 class ResourceFetcher FINAL : public RefCounted<ResourceFetcher>, public Resourc
eLoaderHost { |
| 78 WTF_MAKE_NONCOPYABLE(ResourceFetcher); WTF_MAKE_FAST_ALLOCATED; | 78 WTF_MAKE_NONCOPYABLE(ResourceFetcher); WTF_MAKE_FAST_ALLOCATED; |
| 79 friend class ImageLoader; | 79 friend class ImageLoader; |
| 80 friend class ResourceCacheValidationSuppressor; | 80 friend class ResourceCacheValidationSuppressor; |
| 81 | 81 |
| 82 public: | 82 public: |
| 83 static PassRefPtr<ResourceFetcher> create(DocumentLoader* documentLoader) {
return adoptRef(new ResourceFetcher(documentLoader)); } | 83 static PassRefPtr<ResourceFetcher> create(DocumentLoader* documentLoader) {
return adoptRef(new ResourceFetcher(documentLoader)); } |
| 84 virtual ~ResourceFetcher(); | 84 virtual ~ResourceFetcher(); |
| 85 | 85 |
| 86 using RefCounted<ResourceFetcher>::ref; | 86 using RefCounted<ResourceFetcher>::ref; |
| 87 using RefCounted<ResourceFetcher>::deref; | 87 using RefCounted<ResourceFetcher>::deref; |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 m_loader->m_allowStaleResources = m_previousState; | 250 m_loader->m_allowStaleResources = m_previousState; |
| 251 } | 251 } |
| 252 private: | 252 private: |
| 253 ResourceFetcher* m_loader; | 253 ResourceFetcher* m_loader; |
| 254 bool m_previousState; | 254 bool m_previousState; |
| 255 }; | 255 }; |
| 256 | 256 |
| 257 } // namespace WebCore | 257 } // namespace WebCore |
| 258 | 258 |
| 259 #endif | 259 #endif |
| OLD | NEW |