| 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 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 #include "core/html/LinkResource.h" | 34 #include "core/html/LinkResource.h" |
| 35 #include "core/loader/cache/CachedResourceClient.h" | 35 #include "core/loader/cache/CachedResourceClient.h" |
| 36 #include "core/loader/cache/CachedResourceHandle.h" | 36 #include "core/loader/cache/CachedResourceHandle.h" |
| 37 #include "wtf/FastAllocBase.h" | 37 #include "wtf/FastAllocBase.h" |
| 38 #include "wtf/PassOwnPtr.h" | 38 #include "wtf/PassOwnPtr.h" |
| 39 #include "wtf/Vector.h" | 39 #include "wtf/Vector.h" |
| 40 | 40 |
| 41 namespace WebCore { | 41 namespace WebCore { |
| 42 | 42 |
| 43 class CachedResourceLoader; |
| 43 class HTMLImportLoader; | 44 class HTMLImportLoader; |
| 44 class HTMLImportsController; | 45 class HTMLImportsController; |
| 45 | 46 |
| 46 // | 47 // |
| 47 // A LinkResource subclasss used for @rel=import. | 48 // A LinkResource subclasss used for @rel=import. |
| 48 // | 49 // |
| 49 class LinkImport : public LinkResource { | 50 class LinkImport : public LinkResource { |
| 50 WTF_MAKE_FAST_ALLOCATED; | 51 WTF_MAKE_FAST_ALLOCATED; |
| 51 public: | 52 public: |
| 52 | 53 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 void setState(State); | 95 void setState(State); |
| 95 | 96 |
| 96 HTMLImportsController* m_controller; | 97 HTMLImportsController* m_controller; |
| 97 State m_state; | 98 State m_state; |
| 98 KURL m_url; | 99 KURL m_url; |
| 99 CachedResourceHandle<CachedScript> m_resource; | 100 CachedResourceHandle<CachedScript> m_resource; |
| 100 RefPtr<Document> m_importedDocument; | 101 RefPtr<Document> m_importedDocument; |
| 101 }; | 102 }; |
| 102 | 103 |
| 103 | 104 |
| 104 class HTMLImportsController { | 105 class HTMLImportsController : public RefCounted<HTMLImportsController> { |
| 105 WTF_MAKE_FAST_ALLOCATED; | 106 WTF_MAKE_FAST_ALLOCATED; |
| 106 public: | 107 public: |
| 107 static PassOwnPtr<HTMLImportsController> create(Document*); | 108 static PassRefPtr<HTMLImportsController> create(Document*); |
| 108 | 109 |
| 109 explicit HTMLImportsController(Document*); | 110 explicit HTMLImportsController(Document*); |
| 110 virtual ~HTMLImportsController(); | 111 virtual ~HTMLImportsController(); |
| 111 | 112 |
| 112 void addImport(PassRefPtr<HTMLImportLoader>); | 113 void addImport(PassRefPtr<HTMLImportLoader>); |
| 113 void showSecurityErrorMessage(const String&); | 114 void showSecurityErrorMessage(const String&); |
| 114 PassRefPtr<HTMLImportLoader> findLinkFor(const KURL&) const; | 115 PassRefPtr<HTMLImportLoader> findLinkFor(const KURL&) const; |
| 115 SecurityOrigin* securityOrigin() const; | 116 SecurityOrigin* securityOrigin() const; |
| 117 CachedResourceLoader* cachedResourceLoader() const; |
| 116 bool haveLoaded() const; | 118 bool haveLoaded() const; |
| 117 void didLoad(); | 119 void didLoad(); |
| 118 | 120 |
| 119 private: | 121 private: |
| 120 Document* m_master; | 122 Document* m_master; |
| 121 | 123 |
| 122 // List of import which has been loaded or being loaded. | 124 // List of import which has been loaded or being loaded. |
| 123 typedef Vector<RefPtr<HTMLImportLoader> > ImportList; | 125 typedef Vector<RefPtr<HTMLImportLoader> > ImportList; |
| 124 ImportList m_imports; | 126 ImportList m_imports; |
| 125 }; | 127 }; |
| 126 | 128 |
| 127 } // namespace WebCore | 129 } // namespace WebCore |
| 128 | 130 |
| 129 #endif // HTMLImportsController_h | 131 #endif // HTMLImportsController_h |
| OLD | NEW |