| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google, Inc. All Rights Reserved. | 2 * Copyright (C) 2010 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 #include "core/loader/resource/ScriptResource.h" | 32 #include "core/loader/resource/ScriptResource.h" |
| 33 #include "platform/MemoryCoordinator.h" | 33 #include "platform/MemoryCoordinator.h" |
| 34 #include "platform/heap/Handle.h" | 34 #include "platform/heap/Handle.h" |
| 35 #include "platform/loader/fetch/ResourceOwner.h" | 35 #include "platform/loader/fetch/ResourceOwner.h" |
| 36 #include "wtf/Noncopyable.h" | 36 #include "wtf/Noncopyable.h" |
| 37 #include "wtf/text/TextPosition.h" | 37 #include "wtf/text/TextPosition.h" |
| 38 | 38 |
| 39 namespace blink { | 39 namespace blink { |
| 40 | 40 |
| 41 class PendingScript; | 41 class PendingScript; |
| 42 class ScriptSourceCode; | 42 class ClassicScript; |
| 43 | 43 |
| 44 class CORE_EXPORT PendingScriptClient : public GarbageCollectedMixin { | 44 class CORE_EXPORT PendingScriptClient : public GarbageCollectedMixin { |
| 45 public: | 45 public: |
| 46 virtual ~PendingScriptClient() {} | 46 virtual ~PendingScriptClient() {} |
| 47 | 47 |
| 48 // Invoked when the pending script has finished loading. This could be during | 48 // Invoked when the pending script has finished loading. This could be during |
| 49 // |watchForLoad| (if the pending script was already ready), or when the | 49 // |watchForLoad| (if the pending script was already ready), or when the |
| 50 // resource loads (if script streaming is not occurring), or when script | 50 // resource loads (if script streaming is not occurring), or when script |
| 51 // streaming finishes. | 51 // streaming finishes. |
| 52 virtual void pendingScriptFinished(PendingScript*) = 0; | 52 virtual void pendingScriptFinished(PendingScript*) = 0; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 return m_parserBlockingLoadStartTime; | 88 return m_parserBlockingLoadStartTime; |
| 89 } | 89 } |
| 90 | 90 |
| 91 void watchForLoad(PendingScriptClient*); | 91 void watchForLoad(PendingScriptClient*); |
| 92 void stopWatchingForLoad(); | 92 void stopWatchingForLoad(); |
| 93 | 93 |
| 94 ScriptElementBase* element() const; | 94 ScriptElementBase* element() const; |
| 95 | 95 |
| 96 DECLARE_TRACE(); | 96 DECLARE_TRACE(); |
| 97 | 97 |
| 98 ScriptSourceCode getSource(const KURL& documentURL, | 98 ClassicScript* getSource(const KURL& documentURL, bool& errorOccurred) const; |
| 99 bool& errorOccurred) const; | |
| 100 | 99 |
| 101 void setStreamer(ScriptStreamer*); | 100 void setStreamer(ScriptStreamer*); |
| 102 void streamingFinished(); | 101 void streamingFinished(); |
| 103 | 102 |
| 104 bool isReady() const; | 103 bool isReady() const; |
| 105 bool errorOccurred() const; | 104 bool errorOccurred() const; |
| 106 | 105 |
| 107 void dispose(); | 106 void dispose(); |
| 108 | 107 |
| 109 private: | 108 private: |
| (...skipping 28 matching lines...) Expand all Loading... |
| 138 Member<PendingScriptClient> m_client; | 137 Member<PendingScriptClient> m_client; |
| 139 | 138 |
| 140 // This flag is used to skip non-null checks of |m_element| in unit | 139 // This flag is used to skip non-null checks of |m_element| in unit |
| 141 // tests, because |m_element| can be null in unit tests. | 140 // tests, because |m_element| can be null in unit tests. |
| 142 const bool m_isForTesting; | 141 const bool m_isForTesting; |
| 143 }; | 142 }; |
| 144 | 143 |
| 145 } // namespace blink | 144 } // namespace blink |
| 146 | 145 |
| 147 #endif // PendingScript_h | 146 #endif // PendingScript_h |
| OLD | NEW |