| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 DECLARE_TRACE(); | 43 DECLARE_TRACE(); |
| 44 | 44 |
| 45 blink::ScriptType GetScriptType() const override { | 45 blink::ScriptType GetScriptType() const override { |
| 46 return blink::ScriptType::kClassic; | 46 return blink::ScriptType::kClassic; |
| 47 } | 47 } |
| 48 | 48 |
| 49 ClassicScript* GetSource(const KURL& document_url, | 49 ClassicScript* GetSource(const KURL& document_url, |
| 50 bool& error_occurred) const override; | 50 bool& error_occurred) const override; |
| 51 bool IsReady() const override; | 51 bool IsReady() const override; |
| 52 bool IsExternal() const override { return GetResource(); } | 52 bool IsExternal() const override { return is_external_; } |
| 53 bool ErrorOccurred() const override; | 53 bool ErrorOccurred() const override; |
| 54 bool WasCanceled() const override; | 54 bool WasCanceled() const override; |
| 55 void StartStreamingIfPossible(Document*, ScriptStreamer::Type) override; | 55 void StartStreamingIfPossible(Document*, ScriptStreamer::Type) override; |
| 56 KURL UrlForClassicScript() const override; | 56 KURL UrlForClassicScript() const override; |
| 57 void RemoveFromMemoryCache() override; | 57 void RemoveFromMemoryCache() override; |
| 58 void DisposeInternal() override; | 58 void DisposeInternal() override; |
| 59 | 59 |
| 60 void Prefinalize(); | 60 void Prefinalize(); |
| 61 | 61 |
| 62 private: | 62 private: |
| 63 ClassicPendingScript(ScriptElementBase*, | 63 ClassicPendingScript(ScriptElementBase*, |
| 64 ScriptResource*, | 64 ScriptResource*, |
| 65 const TextPosition&); | 65 const TextPosition&); |
| 66 ClassicPendingScript() = delete; | 66 ClassicPendingScript() = delete; |
| 67 | 67 |
| 68 void CheckState() const override; | 68 void CheckState() const override; |
| 69 | 69 |
| 70 // ScriptResourceClient | 70 // ScriptResourceClient |
| 71 void NotifyFinished(Resource*) override; | 71 void NotifyFinished(Resource*) override; |
| 72 String DebugName() const override { return "PendingScript"; } | 72 String DebugName() const override { return "PendingScript"; } |
| 73 void NotifyAppendData(ScriptResource*) override; | 73 void NotifyAppendData(ScriptResource*) override; |
| 74 | 74 |
| 75 // MemoryCoordinatorClient | 75 // MemoryCoordinatorClient |
| 76 void OnPurgeMemory() override; | 76 void OnPurgeMemory() override; |
| 77 | 77 |
| 78 const bool is_external_; |
| 79 |
| 78 bool integrity_failure_; | 80 bool integrity_failure_; |
| 79 | 81 |
| 80 Member<ScriptStreamer> streamer_; | 82 Member<ScriptStreamer> streamer_; |
| 81 | 83 |
| 82 // This is a temporary flag to confirm that ClassicPendingScript is not | 84 // This is a temporary flag to confirm that ClassicPendingScript is not |
| 83 // touched after its refinalizer call and thus https://crbug.com/715309 | 85 // touched after its refinalizer call and thus https://crbug.com/715309 |
| 84 // doesn't break assumptions. | 86 // doesn't break assumptions. |
| 85 // TODO(hiroshige): Check the state in more general way. | 87 // TODO(hiroshige): Check the state in more general way. |
| 86 bool prefinalizer_called_ = false; | 88 bool prefinalizer_called_ = false; |
| 87 }; | 89 }; |
| 88 | 90 |
| 89 } // namespace blink | 91 } // namespace blink |
| 90 | 92 |
| 91 #endif // PendingScript_h | 93 #endif // PendingScript_h |
| OLD | NEW |