Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.cpp

Issue 1997833002: Don't keep a separate m_revalidatingRequest on Resource (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 635 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 ASSERT(scriptState->contextIsValid()); 646 ASSERT(scriptState->contextIsValid());
647 ScriptResource* resource = script->resource(); 647 ScriptResource* resource = script->resource();
648 if (resource->isLoaded()) { 648 if (resource->isLoaded()) {
649 recordNotStreamingReasonHistogram(scriptType, AlreadyLoaded); 649 recordNotStreamingReasonHistogram(scriptType, AlreadyLoaded);
650 return false; 650 return false;
651 } 651 }
652 if (!resource->url().protocolIsInHTTPFamily()) { 652 if (!resource->url().protocolIsInHTTPFamily()) {
653 recordNotStreamingReasonHistogram(scriptType, NotHTTP); 653 recordNotStreamingReasonHistogram(scriptType, NotHTTP);
654 return false; 654 return false;
655 } 655 }
656 if (resource->isCacheValidator()) {
Nate Chapin 2016/05/19 22:18:38 I think this this was a cache for the old way of r
yhirano 2016/05/23 11:40:38 It seems this branch was introduced at https://cod
yhirano 2016/05/24 11:18:51 I think this branch is needed because ScriptResour
Nate Chapin 2016/05/26 21:43:02 Ok, the lack of tests is annoying, but I agree tha
657 recordNotStreamingReasonHistogram(scriptType, Reload);
658 // This happens e.g., during reloads. We're actually not going to load
659 // the current Resource of the PendingScript but switch to another
660 // Resource -> don't stream.
661 return false;
662 }
663 // We cannot filter out short scripts, even if we wait for the HTTP headers 656 // We cannot filter out short scripts, even if we wait for the HTTP headers
664 // to arrive: the Content-Length HTTP header is not sent for chunked 657 // to arrive: the Content-Length HTTP header is not sent for chunked
665 // downloads. 658 // downloads.
666 659
667 // Decide what kind of cached data we should produce while streaming. Only 660 // Decide what kind of cached data we should produce while streaming. Only
668 // produce parser cache if the non-streaming compile takes advantage of it. 661 // produce parser cache if the non-streaming compile takes advantage of it.
669 v8::ScriptCompiler::CompileOptions compileOption = v8::ScriptCompiler::kNoCo mpileOptions; 662 v8::ScriptCompiler::CompileOptions compileOption = v8::ScriptCompiler::kNoCo mpileOptions;
670 if (settings->v8CacheOptions() == V8CacheOptionsParse) 663 if (settings->v8CacheOptions() == V8CacheOptionsParse)
671 compileOption = v8::ScriptCompiler::kProduceParserCache; 664 compileOption = v8::ScriptCompiler::kProduceParserCache;
672 665
673 // The Resource might go out of scope if the script is no longer 666 // The Resource might go out of scope if the script is no longer
674 // needed. This makes PendingScript notify the ScriptStreamer when it is 667 // needed. This makes PendingScript notify the ScriptStreamer when it is
675 // destroyed. 668 // destroyed.
676 script->setStreamer(ScriptStreamer::create(script, scriptType, scriptState, compileOption, loadingTaskRunner)); 669 script->setStreamer(ScriptStreamer::create(script, scriptType, scriptState, compileOption, loadingTaskRunner));
677 670
678 return true; 671 return true;
679 } 672 }
680 673
681 } // namespace blink 674 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/fetch/ImageResource.cpp » ('j') | third_party/WebKit/Source/core/fetch/Resource.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698