| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "bindings/core/v8/ScriptStreamer.h" | 5 #include "bindings/core/v8/ScriptStreamer.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/ScriptStreamerThread.h" | 7 #include "bindings/core/v8/ScriptStreamerThread.h" |
| 8 #include "bindings/core/v8/V8ScriptRunner.h" | 8 #include "bindings/core/v8/V8ScriptRunner.h" |
| 9 #include "core/dom/Document.h" | 9 #include "core/dom/Document.h" |
| 10 #include "core/dom/Element.h" | 10 #include "core/dom/Element.h" |
| (...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 recordNotStreamingReasonHistogram(m_scriptType, ScriptTooSmall); | 565 recordNotStreamingReasonHistogram(m_scriptType, ScriptTooSmall); |
| 566 recordStartedStreamingHistogram(m_scriptType, 0); | 566 recordStartedStreamingHistogram(m_scriptType, 0); |
| 567 suppressStreaming(); | 567 suppressStreaming(); |
| 568 } | 568 } |
| 569 if (m_stream) | 569 if (m_stream) |
| 570 m_stream->didFinishLoading(); | 570 m_stream->didFinishLoading(); |
| 571 m_loadingFinished = true; | 571 m_loadingFinished = true; |
| 572 | 572 |
| 573 // Calling notifyFinishedToClient can result into the upper layers dropping | 573 // Calling notifyFinishedToClient can result into the upper layers dropping |
| 574 // references to ScriptStreamer. Keep it alive until this function ends. | 574 // references to ScriptStreamer. Keep it alive until this function ends. |
| 575 RefPtrWillBeRawPtr<ScriptStreamer> protect(this); | 575 RawPtr<ScriptStreamer> protect(this); |
| 576 | 576 |
| 577 notifyFinishedToClient(); | 577 notifyFinishedToClient(); |
| 578 } | 578 } |
| 579 | 579 |
| 580 ScriptStreamer::ScriptStreamer(PendingScript* script, Type scriptType, ScriptSta
te* scriptState, v8::ScriptCompiler::CompileOptions compileOptions, WebTaskRunne
r* loadingTaskRunner) | 580 ScriptStreamer::ScriptStreamer(PendingScript* script, Type scriptType, ScriptSta
te* scriptState, v8::ScriptCompiler::CompileOptions compileOptions, WebTaskRunne
r* loadingTaskRunner) |
| 581 : m_pendingScript(script) | 581 : m_pendingScript(script) |
| 582 , m_resource(script->resource()) | 582 , m_resource(script->resource()) |
| 583 , m_detached(false) | 583 , m_detached(false) |
| 584 , m_stream(0) | 584 , m_stream(0) |
| 585 , m_loadingFinished(false) | 585 , m_loadingFinished(false) |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 678 | 678 |
| 679 // The Resource might go out of scope if the script is no longer | 679 // The Resource might go out of scope if the script is no longer |
| 680 // needed. This makes PendingScript notify the ScriptStreamer when it is | 680 // needed. This makes PendingScript notify the ScriptStreamer when it is |
| 681 // destroyed. | 681 // destroyed. |
| 682 script->setStreamer(ScriptStreamer::create(script, scriptType, scriptState,
compileOption, loadingTaskRunner)); | 682 script->setStreamer(ScriptStreamer::create(script, scriptType, scriptState,
compileOption, loadingTaskRunner)); |
| 683 | 683 |
| 684 return true; | 684 return true; |
| 685 } | 685 } |
| 686 | 686 |
| 687 } // namespace blink | 687 } // namespace blink |
| OLD | NEW |