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

Side by Side Diff: extensions/renderer/script_context.h

Issue 2339683006: [Blink] Modify SuspendableScriptExecutor to take a v8::Function (Closed)
Patch Set: Haraken's Created 4 years, 2 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 EXTENSIONS_RENDERER_SCRIPT_CONTEXT_H_ 5 #ifndef EXTENSIONS_RENDERER_SCRIPT_CONTEXT_H_
6 #define EXTENSIONS_RENDERER_SCRIPT_CONTEXT_H_ 6 #define EXTENSIONS_RENDERER_SCRIPT_CONTEXT_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 // Runs |function| with appropriate scopes. Doesn't catch exceptions, callers 111 // Runs |function| with appropriate scopes. Doesn't catch exceptions, callers
112 // must do that if they want. 112 // must do that if they want.
113 // 113 //
114 // USE THIS METHOD RATHER THAN v8::Function::Call WHEREVER POSSIBLE. 114 // USE THIS METHOD RATHER THAN v8::Function::Call WHEREVER POSSIBLE.
115 v8::Local<v8::Value> CallFunction(const v8::Local<v8::Function>& function, 115 v8::Local<v8::Value> CallFunction(const v8::Local<v8::Function>& function,
116 int argc, 116 int argc,
117 v8::Local<v8::Value> argv[]) const; 117 v8::Local<v8::Value> argv[]) const;
118 v8::Local<v8::Value> CallFunction( 118 v8::Local<v8::Value> CallFunction(
119 const v8::Local<v8::Function>& function) const; 119 const v8::Local<v8::Function>& function) const;
120 120
121 // Safely calls the v8::Function, respecting the page load deferrer and
122 // possibly executing asynchronously.
123 // TODO(devlin): Remove the above variants in favor of this.
dcheng 2016/10/04 05:58:49 Btw, do you estimate that this will be a lot of wo
Devlin 2016/10/04 19:40:05 It's hard to say until I really start in on it. I
124 void SafeCallFunction(const v8::Local<v8::Function>& function,
125 int argc,
126 v8::Local<v8::Value> argv[]);
127
121 void DispatchEvent(const char* event_name, v8::Local<v8::Array> args) const; 128 void DispatchEvent(const char* event_name, v8::Local<v8::Array> args) const;
122 129
123 // Returns the availability of the API |api_name|. 130 // Returns the availability of the API |api_name|.
124 Feature::Availability GetAvailability(const std::string& api_name); 131 Feature::Availability GetAvailability(const std::string& api_name);
125 132
126 // Returns a string description of the type of context this is. 133 // Returns a string description of the type of context this is.
127 std::string GetContextTypeDescription() const; 134 std::string GetContextTypeDescription() const;
128 135
129 // Returns a string description of the effective type of context this is. 136 // Returns a string description of the effective type of context this is.
130 std::string GetEffectiveContextTypeDescription() const; 137 std::string GetEffectiveContextTypeDescription() const;
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 std::unique_ptr<Runner> runner_; 265 std::unique_ptr<Runner> runner_;
259 266
260 base::ThreadChecker thread_checker_; 267 base::ThreadChecker thread_checker_;
261 268
262 DISALLOW_COPY_AND_ASSIGN(ScriptContext); 269 DISALLOW_COPY_AND_ASSIGN(ScriptContext);
263 }; 270 };
264 271
265 } // namespace extensions 272 } // namespace extensions
266 273
267 #endif // EXTENSIONS_RENDERER_SCRIPT_CONTEXT_H_ 274 #endif // EXTENSIONS_RENDERER_SCRIPT_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698