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 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 m_stream(0), | 524 m_stream(0), |
525 m_loadingFinished(false), | 525 m_loadingFinished(false), |
526 m_parsingFinished(false), | 526 m_parsingFinished(false), |
527 m_haveEnoughDataForStreaming(false), | 527 m_haveEnoughDataForStreaming(false), |
528 m_streamingSuppressed(false), | 528 m_streamingSuppressed(false), |
529 m_compileOptions(compileOptions), | 529 m_compileOptions(compileOptions), |
530 m_scriptState(scriptState), | 530 m_scriptState(scriptState), |
531 m_scriptType(scriptType), | 531 m_scriptType(scriptType), |
532 m_scriptURLString(m_resource->url().copy().getString()), | 532 m_scriptURLString(m_resource->url().copy().getString()), |
533 m_scriptResourceIdentifier(m_resource->identifier()), | 533 m_scriptResourceIdentifier(m_resource->identifier()), |
534 m_encoding( | 534 // Unfortunately there's no dummy encoding value in the enum; let's use |
535 v8::ScriptCompiler::StreamedSource:: | 535 // one we don't stream. |
536 TWO_BYTE) // Unfortunately there's no dummy encoding value in the
enum; let's use one we don't stream. | 536 m_encoding(v8::ScriptCompiler::StreamedSource::TWO_BYTE), |
537 , | |
538 m_loadingTaskRunner(loadingTaskRunner->clone()) {} | 537 m_loadingTaskRunner(loadingTaskRunner->clone()) {} |
539 | 538 |
540 ScriptStreamer::~ScriptStreamer() {} | 539 ScriptStreamer::~ScriptStreamer() {} |
541 | 540 |
542 DEFINE_TRACE(ScriptStreamer) { | 541 DEFINE_TRACE(ScriptStreamer) { |
543 visitor->trace(m_pendingScript); | 542 visitor->trace(m_pendingScript); |
544 visitor->trace(m_resource); | 543 visitor->trace(m_resource); |
545 } | 544 } |
546 | 545 |
547 void ScriptStreamer::streamingComplete() { | 546 void ScriptStreamer::streamingComplete() { |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 // The Resource might go out of scope if the script is no longer | 615 // The Resource might go out of scope if the script is no longer |
617 // needed. This makes PendingScript notify the ScriptStreamer when it is | 616 // needed. This makes PendingScript notify the ScriptStreamer when it is |
618 // destroyed. | 617 // destroyed. |
619 script->setStreamer(ScriptStreamer::create(script, scriptType, scriptState, | 618 script->setStreamer(ScriptStreamer::create(script, scriptType, scriptState, |
620 compileOption, loadingTaskRunner)); | 619 compileOption, loadingTaskRunner)); |
621 | 620 |
622 return true; | 621 return true; |
623 } | 622 } |
624 | 623 |
625 } // namespace blink | 624 } // namespace blink |
OLD | NEW |