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

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

Issue 2829453003: Remove unused methods from ScriptStreamer (Closed)
Patch Set: Rebase 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
« no previous file with comments | « no previous file | no next file » | 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 #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"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 65
66 // When the streaming is suppressed, the data is not given to V8, but 66 // When the streaming is suppressed, the data is not given to V8, but
67 // ScriptStreamer still watches the resource load and notifies the upper 67 // ScriptStreamer still watches the resource load and notifies the upper
68 // layers when loading is finished. It is used in situations when we have 68 // layers when loading is finished. It is used in situations when we have
69 // started streaming but then we detect we don't want to stream (e.g., when 69 // started streaming but then we detect we don't want to stream (e.g., when
70 // we have the code cache for the script) and we still want to parse and 70 // we have the code cache for the script) and we still want to parse and
71 // execute it when it has finished loading. 71 // execute it when it has finished loading.
72 void SuppressStreaming(); 72 void SuppressStreaming();
73 bool StreamingSuppressed() const { return streaming_suppressed_; } 73 bool StreamingSuppressed() const { return streaming_suppressed_; }
74 74
75 v8::ScriptCompiler::CompileOptions GetCompileOptions() const {
76 return compile_options_;
77 }
78
79 // Called by PendingScript when data arrives from the network. 75 // Called by PendingScript when data arrives from the network.
80 void NotifyAppendData(ScriptResource*); 76 void NotifyAppendData(ScriptResource*);
81 void NotifyFinished(Resource*); 77 void NotifyFinished(Resource*);
82 78
83 // Called by ScriptStreamingTask when it has streamed all data to V8 and V8 79 // Called by ScriptStreamingTask when it has streamed all data to V8 and V8
84 // has processed it. 80 // has processed it.
85 void StreamingCompleteOnBackgroundThread(); 81 void StreamingCompleteOnBackgroundThread();
86 82
87 v8::ScriptCompiler::StreamedSource::Encoding GetEncoding() const {
88 return encoding_;
89 }
90
91 const String& ScriptURLString() const { return script_url_string_; } 83 const String& ScriptURLString() const { return script_url_string_; }
92 unsigned long ScriptResourceIdentifier() const { 84 unsigned long ScriptResourceIdentifier() const {
93 return script_resource_identifier_; 85 return script_resource_identifier_;
94 } 86 }
95 87
96 static void SetSmallScriptThresholdForTesting(size_t threshold) { 88 static void SetSmallScriptThresholdForTesting(size_t threshold) {
97 small_script_threshold_ = threshold; 89 small_script_threshold_ = threshold;
98 } 90 }
99 91
100 static size_t SmallScriptThreshold() { return small_script_threshold_; }
101
102 private: 92 private:
103 // Scripts whose first data chunk is smaller than this constant won't be 93 // Scripts whose first data chunk is smaller than this constant won't be
104 // streamed. Non-const for testing. 94 // streamed. Non-const for testing.
105 static size_t small_script_threshold_; 95 static size_t small_script_threshold_;
106 96
107 static ScriptStreamer* Create( 97 static ScriptStreamer* Create(
108 PendingScript* script, 98 PendingScript* script,
109 Type script_type, 99 Type script_type,
110 ScriptState* script_state, 100 ScriptState* script_state,
111 v8::ScriptCompiler::CompileOptions compile_options, 101 v8::ScriptCompiler::CompileOptions compile_options,
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 155
166 // Encoding of the streamed script. Saved for sanity checking purposes. 156 // Encoding of the streamed script. Saved for sanity checking purposes.
167 v8::ScriptCompiler::StreamedSource::Encoding encoding_; 157 v8::ScriptCompiler::StreamedSource::Encoding encoding_;
168 158
169 RefPtr<WebTaskRunner> loading_task_runner_; 159 RefPtr<WebTaskRunner> loading_task_runner_;
170 }; 160 };
171 161
172 } // namespace blink 162 } // namespace blink
173 163
174 #endif // ScriptStreamer_h 164 #endif // ScriptStreamer_h
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698