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

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

Issue 705953002: Script streaming: turn off cached data to prevent crashes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « no previous file | Source/bindings/core/v8/V8ScriptRunner.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "config.h" 5 #include "config.h"
6 #include "bindings/core/v8/ScriptStreamer.h" 6 #include "bindings/core/v8/ScriptStreamer.h"
7 7
8 #include "bindings/core/v8/ScriptStreamerThread.h" 8 #include "bindings/core/v8/ScriptStreamerThread.h"
9 #include "bindings/core/v8/V8ScriptRunner.h" 9 #include "bindings/core/v8/V8ScriptRunner.h"
10 #include "core/dom/Document.h" 10 #include "core/dom/Document.h"
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 bool ScriptStreamer::startStreamingInternal(PendingScript& script, Settings* set tings, ScriptState* scriptState, PendingScript::Type scriptType) 499 bool ScriptStreamer::startStreamingInternal(PendingScript& script, Settings* set tings, ScriptState* scriptState, PendingScript::Type scriptType)
500 { 500 {
501 ASSERT(isMainThread()); 501 ASSERT(isMainThread());
502 if (!settings || !settings->v8ScriptStreamingEnabled()) 502 if (!settings || !settings->v8ScriptStreamingEnabled())
503 return false; 503 return false;
504 if (settings->v8ScriptStreamingMode() == ScriptStreamingModeOnlyAsyncAndDefe r 504 if (settings->v8ScriptStreamingMode() == ScriptStreamingModeOnlyAsyncAndDefe r
505 && scriptType == PendingScript::ParsingBlocking) 505 && scriptType == PendingScript::ParsingBlocking)
506 return false; 506 return false;
507 507
508 ScriptResource* resource = script.resource(); 508 ScriptResource* resource = script.resource();
509 ASSERT(!resource->isLoaded()); 509 if (resource->isLoaded())
510 return false;
510 if (!resource->url().protocolIsInHTTPFamily()) 511 if (!resource->url().protocolIsInHTTPFamily())
511 return false; 512 return false;
512 if (resource->resourceToRevalidate()) { 513 if (resource->resourceToRevalidate()) {
513 // This happens e.g., during reloads. We're actually not going to load 514 // This happens e.g., during reloads. We're actually not going to load
514 // the current Resource of the PendingScript but switch to another 515 // the current Resource of the PendingScript but switch to another
515 // Resource -> don't stream. 516 // Resource -> don't stream.
516 return false; 517 return false;
517 } 518 }
518 // We cannot filter out short scripts, even if we wait for the HTTP headers 519 // We cannot filter out short scripts, even if we wait for the HTTP headers
519 // to arrive. In general, the web servers don't seem to send the 520 // to arrive. In general, the web servers don't seem to send the
(...skipping 11 matching lines...) Expand all
531 532
532 // The Resource might go out of scope if the script is no longer 533 // The Resource might go out of scope if the script is no longer
533 // needed. This makes PendingScript notify the ScriptStreamer when it is 534 // needed. This makes PendingScript notify the ScriptStreamer when it is
534 // destroyed. 535 // destroyed.
535 script.setStreamer(adoptRef(new ScriptStreamer(resource, scriptType, setting s->v8ScriptStreamingMode(), scriptState, compileOption))); 536 script.setStreamer(adoptRef(new ScriptStreamer(resource, scriptType, setting s->v8ScriptStreamingMode(), scriptState, compileOption)));
536 537
537 return true; 538 return true;
538 } 539 }
539 540
540 } // namespace blink 541 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/core/v8/V8ScriptRunner.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698