| 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 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 608 return false; | 608 return false; |
| 609 } | 609 } |
| 610 // We cannot filter out short scripts, even if we wait for the HTTP headers | 610 // We cannot filter out short scripts, even if we wait for the HTTP headers |
| 611 // to arrive: the Content-Length HTTP header is not sent for chunked | 611 // to arrive: the Content-Length HTTP header is not sent for chunked |
| 612 // downloads. | 612 // downloads. |
| 613 | 613 |
| 614 // Decide what kind of cached data we should produce while streaming. Only | 614 // Decide what kind of cached data we should produce while streaming. Only |
| 615 // produce parser cache if the non-streaming compile takes advantage of it. | 615 // produce parser cache if the non-streaming compile takes advantage of it. |
| 616 v8::ScriptCompiler::CompileOptions compileOption = | 616 v8::ScriptCompiler::CompileOptions compileOption = |
| 617 v8::ScriptCompiler::kNoCompileOptions; | 617 v8::ScriptCompiler::kNoCompileOptions; |
| 618 if (settings->v8CacheOptions() == V8CacheOptionsParse) | 618 if (settings->getV8CacheOptions() == V8CacheOptionsParse) |
| 619 compileOption = v8::ScriptCompiler::kProduceParserCache; | 619 compileOption = v8::ScriptCompiler::kProduceParserCache; |
| 620 | 620 |
| 621 // The Resource might go out of scope if the script is no longer | 621 // The Resource might go out of scope if the script is no longer |
| 622 // needed. This makes PendingScript notify the ScriptStreamer when it is | 622 // needed. This makes PendingScript notify the ScriptStreamer when it is |
| 623 // destroyed. | 623 // destroyed. |
| 624 script->setStreamer(ScriptStreamer::create(script, scriptType, scriptState, | 624 script->setStreamer(ScriptStreamer::create(script, scriptType, scriptState, |
| 625 compileOption, loadingTaskRunner)); | 625 compileOption, loadingTaskRunner)); |
| 626 | 626 |
| 627 return true; | 627 return true; |
| 628 } | 628 } |
| 629 | 629 |
| 630 } // namespace blink | 630 } // namespace blink |
| OLD | NEW |