| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef ClassicPendingScript_h | 5 #ifndef ClassicPendingScript_h |
| 6 #define ClassicPendingScript_h | 6 #define ClassicPendingScript_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ScriptStreamer.h" | 8 #include "bindings/core/v8/ScriptStreamer.h" |
| 9 #include "core/dom/ClassicScript.h" | 9 #include "core/dom/ClassicScript.h" |
| 10 #include "core/dom/PendingScript.h" | 10 #include "core/dom/PendingScript.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 DECLARE_TRACE(); | 44 DECLARE_TRACE(); |
| 45 | 45 |
| 46 blink::ScriptType GetScriptType() const override { | 46 blink::ScriptType GetScriptType() const override { |
| 47 return blink::ScriptType::kClassic; | 47 return blink::ScriptType::kClassic; |
| 48 } | 48 } |
| 49 | 49 |
| 50 ClassicScript* GetSource(const KURL& document_url, | 50 ClassicScript* GetSource(const KURL& document_url, |
| 51 bool& error_occurred) const override; | 51 bool& error_occurred) const override; |
| 52 bool IsReady() const override; | 52 bool IsReady() const override; |
| 53 bool IsExternal() const override { return GetResource(); } | 53 bool IsExternal() const override { return is_external_; } |
| 54 bool ErrorOccurred() const override; | 54 bool ErrorOccurred() const override; |
| 55 bool WasCanceled() const override; | 55 bool WasCanceled() const override; |
| 56 bool StartStreamingIfPossible(ScriptStreamer::Type, WTF::Closure) override; | 56 bool StartStreamingIfPossible(ScriptStreamer::Type, WTF::Closure) override; |
| 57 bool IsCurrentlyStreaming() const override; | 57 bool IsCurrentlyStreaming() const override; |
| 58 KURL UrlForClassicScript() const override; | 58 KURL UrlForClassicScript() const override; |
| 59 void RemoveFromMemoryCache() override; | 59 void RemoveFromMemoryCache() override; |
| 60 void DisposeInternal() override; | 60 void DisposeInternal() override; |
| 61 | 61 |
| 62 void Prefinalize(); | 62 void Prefinalize(); |
| 63 | 63 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 89 void CheckState() const override; | 89 void CheckState() const override; |
| 90 | 90 |
| 91 // ScriptResourceClient | 91 // ScriptResourceClient |
| 92 void NotifyFinished(Resource*) override; | 92 void NotifyFinished(Resource*) override; |
| 93 String DebugName() const override { return "PendingScript"; } | 93 String DebugName() const override { return "PendingScript"; } |
| 94 void NotifyAppendData(ScriptResource*) override; | 94 void NotifyAppendData(ScriptResource*) override; |
| 95 | 95 |
| 96 // MemoryCoordinatorClient | 96 // MemoryCoordinatorClient |
| 97 void OnPurgeMemory() override; | 97 void OnPurgeMemory() override; |
| 98 | 98 |
| 99 const bool is_external_; |
| 99 ReadyState ready_state_; | 100 ReadyState ready_state_; |
| 100 bool integrity_failure_; | 101 bool integrity_failure_; |
| 101 | 102 |
| 102 Member<ScriptStreamer> streamer_; | 103 Member<ScriptStreamer> streamer_; |
| 103 WTF::Closure streamer_done_; | 104 WTF::Closure streamer_done_; |
| 104 | 105 |
| 105 // This is a temporary flag to confirm that ClassicPendingScript is not | 106 // This is a temporary flag to confirm that ClassicPendingScript is not |
| 106 // touched after its refinalizer call and thus https://crbug.com/715309 | 107 // touched after its refinalizer call and thus https://crbug.com/715309 |
| 107 // doesn't break assumptions. | 108 // doesn't break assumptions. |
| 108 // TODO(hiroshige): Check the state in more general way. | 109 // TODO(hiroshige): Check the state in more general way. |
| 109 bool prefinalizer_called_ = false; | 110 bool prefinalizer_called_ = false; |
| 110 }; | 111 }; |
| 111 | 112 |
| 112 } // namespace blink | 113 } // namespace blink |
| 113 | 114 |
| 114 #endif // PendingScript_h | 115 #endif // PendingScript_h |
| OLD | NEW |