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

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

Issue 2962353002: Add probe for V8.Complie (Closed)
Patch Set: correct executionContext usage Created 3 years, 5 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 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 class ScriptSourceCode; 46 class ScriptSourceCode;
47 class ExecutionContext; 47 class ExecutionContext;
48 class ScriptStreamer; 48 class ScriptStreamer;
49 49
50 class CORE_EXPORT V8ScriptRunner final { 50 class CORE_EXPORT V8ScriptRunner final {
51 STATIC_ONLY(V8ScriptRunner); 51 STATIC_ONLY(V8ScriptRunner);
52 52
53 public: 53 public:
54 // For the following methods, the caller sites have to hold 54 // For the following methods, the caller sites have to hold
55 // a HandleScope and a ContextScope. 55 // a HandleScope and a ContextScope.
56 static v8::MaybeLocal<v8::Script> CompileScript(const ScriptSourceCode&, 56 static v8::MaybeLocal<v8::Script> CompileScript(ExecutionContext*,
haraken 2017/07/18 05:18:17 In a follow-up CL, would you make a change to pass
Liquan (Max) Gu 2017/07/18 21:18:49 Done.
57 const ScriptSourceCode&,
57 v8::Isolate*, 58 v8::Isolate*,
58 AccessControlStatus, 59 AccessControlStatus,
59 V8CacheOptions); 60 V8CacheOptions);
60 static v8::MaybeLocal<v8::Script> CompileScript(const String&, 61 static v8::MaybeLocal<v8::Script> CompileScript(ExecutionContext*,
62 const String&,
61 const String& file_name, 63 const String& file_name,
62 const String& source_map_url, 64 const String& source_map_url,
63 const TextPosition&, 65 const TextPosition&,
64 v8::Isolate*, 66 v8::Isolate*,
65 CachedMetadataHandler*, 67 CachedMetadataHandler*,
66 AccessControlStatus, 68 AccessControlStatus,
67 V8CacheOptions); 69 V8CacheOptions);
68 // CachedMetadataHandler is set when metadata caching is supported. For 70 // CachedMetadataHandler is set when metadata caching is supported. For
69 // normal scripe resources, CachedMetadataHandler is from ScriptResource. 71 // normal scripe resources, CachedMetadataHandler is from ScriptResource.
70 // For worker script, ScriptResource is null but CachedMetadataHandler may be 72 // For worker script, ScriptResource is null but CachedMetadataHandler may be
71 // set. When ScriptStreamer is set, ScriptResource must be set. 73 // set. When ScriptStreamer is set, ScriptResource must be set.
72 static v8::MaybeLocal<v8::Script> CompileScript(v8::Local<v8::String>, 74 static v8::MaybeLocal<v8::Script> CompileScript(ExecutionContext*,
75 v8::Local<v8::String>,
73 const String& file_name, 76 const String& file_name,
74 const String& source_map_url, 77 const String& source_map_url,
75 const TextPosition&, 78 const TextPosition&,
76 v8::Isolate*, 79 v8::Isolate*,
77 ScriptResource*, 80 ScriptResource*,
78 ScriptStreamer*, 81 ScriptStreamer*,
79 CachedMetadataHandler*, 82 CachedMetadataHandler*,
80 AccessControlStatus, 83 AccessControlStatus,
81 V8CacheOptions); 84 V8CacheOptions);
82 static v8::MaybeLocal<v8::Module> CompileModule(v8::Isolate*, 85 static v8::MaybeLocal<v8::Module> CompileModule(v8::Isolate*,
83 const String& source, 86 const String& source,
84 const String& file_name, 87 const String& file_name,
85 AccessControlStatus, 88 AccessControlStatus,
86 const TextPosition&); 89 const TextPosition&);
87 static v8::MaybeLocal<v8::Value> RunCompiledScript(v8::Isolate*, 90 static v8::MaybeLocal<v8::Value> RunCompiledScript(v8::Isolate*,
88 v8::Local<v8::Script>, 91 v8::Local<v8::Script>,
89 ExecutionContext*); 92 ExecutionContext*);
90 static v8::MaybeLocal<v8::Value> CompileAndRunInternalScript( 93 static v8::MaybeLocal<v8::Value> CompileAndRunInternalScript(
94 ExecutionContext*,
91 v8::Local<v8::String>, 95 v8::Local<v8::String>,
92 v8::Isolate*, 96 v8::Isolate*,
93 const String& = String(), 97 const String& = String(),
94 const TextPosition& = TextPosition()); 98 const TextPosition& = TextPosition());
95 static v8::MaybeLocal<v8::Value> RunCompiledInternalScript( 99 static v8::MaybeLocal<v8::Value> RunCompiledInternalScript(
96 v8::Isolate*, 100 v8::Isolate*,
97 v8::Local<v8::Script>); 101 v8::Local<v8::Script>);
98 static v8::MaybeLocal<v8::Value> CallAsConstructor( 102 static v8::MaybeLocal<v8::Value> CallAsConstructor(
99 v8::Isolate*, 103 v8::Isolate*,
100 v8::Local<v8::Object>, 104 v8::Local<v8::Object>,
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 private: 156 private:
153 static v8::MaybeLocal<v8::Value> CallExtraHelper(ScriptState*, 157 static v8::MaybeLocal<v8::Value> CallExtraHelper(ScriptState*,
154 const char* name, 158 const char* name,
155 size_t num_args, 159 size_t num_args,
156 v8::Local<v8::Value>* args); 160 v8::Local<v8::Value>* args);
157 }; 161 };
158 162
159 } // namespace blink 163 } // namespace blink
160 164
161 #endif // V8ScriptRunner_h 165 #endif // V8ScriptRunner_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698