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

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

Issue 2653923008: Reland of Split PendingScript into PendingScript and ClassicPendingScript (Closed)
Patch Set: Crash fix by adding Dispose() as ClassicPendingScript prefinalizer Created 3 years, 8 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 #ifndef ScriptStreamer_h 5 #ifndef ScriptStreamer_h
6 #define ScriptStreamer_h 6 #define ScriptStreamer_h
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "core/CoreExport.h" 10 #include "core/CoreExport.h"
11 #include "platform/heap/Handle.h" 11 #include "platform/heap/Handle.h"
12 #include "platform/wtf/Noncopyable.h" 12 #include "platform/wtf/Noncopyable.h"
13 #include "v8/include/v8.h" 13 #include "v8/include/v8.h"
14 14
15 namespace blink { 15 namespace blink {
16 16
17 class Resource; 17 class Resource;
18 class ScriptResource; 18 class ScriptResource;
19 19
20 // ScriptStreamer streams incomplete script data to V8 so that it can be parsed 20 // ScriptStreamer streams incomplete script data to V8 so that it can be parsed
21 // while it's loaded. PendingScript holds a reference to ScriptStreamer. At the 21 // while it's loaded. ClassicPendingScript holds a reference to ScriptStreamer.
22 // moment, ScriptStreamer is only used for parser blocking scripts; this means 22 // At the moment, ScriptStreamer is only used for parser blocking scripts; this
23 // that the Document stays stable and no other scripts are executing while we're 23 // means that the Document stays stable and no other scripts are executing
24 // streaming. It is possible, though, that Document and the PendingScript are 24 // while we're streaming. It is possible, though, that Document and the
25 // destroyed while the streaming is in progress, and ScriptStreamer handles it 25 // ClassicPendingScript are destroyed while the streaming is in progress, and
26 // gracefully. 26 // ScriptStreamer handles it gracefully.
27 // 27 //
28 // ScriptStreamer is abstract just to implement unit tests. ScriptStreamerImpl 28 // ScriptStreamer is abstract just to implement unit tests. ScriptStreamerImpl
29 // is the only subclass in non-test code that implements the functionality. 29 // is the only subclass in non-test code that implements the functionality.
30 class CORE_EXPORT ScriptStreamer 30 class CORE_EXPORT ScriptStreamer
31 : public GarbageCollectedFinalized<ScriptStreamer> { 31 : public GarbageCollectedFinalized<ScriptStreamer> {
32 WTF_MAKE_NONCOPYABLE(ScriptStreamer); 32 WTF_MAKE_NONCOPYABLE(ScriptStreamer);
33 33
34 public: 34 public:
35 enum Type { kParsingBlocking, kDeferred, kAsync }; 35 enum Type { kParsingBlocking, kDeferred, kAsync };
36 36
(...skipping 22 matching lines...) Expand all
59 virtual bool StreamingSuppressed() const = 0; 59 virtual bool StreamingSuppressed() const = 0;
60 60
61 // Called by ClassicPendingScript when data arrives from the network. 61 // Called by ClassicPendingScript when data arrives from the network.
62 virtual void NotifyAppendData(ScriptResource*) = 0; 62 virtual void NotifyAppendData(ScriptResource*) = 0;
63 virtual void NotifyFinished(Resource*) = 0; 63 virtual void NotifyFinished(Resource*) = 0;
64 }; 64 };
65 65
66 } // namespace blink 66 } // namespace blink
67 67
68 #endif // ScriptStreamer_h 68 #endif // ScriptStreamer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698