OLD | NEW |
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 <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 content::RenderView* GetRenderView() const; | 101 content::RenderView* GetRenderView() const; |
102 | 102 |
103 // Returns the RenderFrame associated with this context. Can return NULL if | 103 // Returns the RenderFrame associated with this context. Can return NULL if |
104 // the context is in the process of being destroyed. | 104 // the context is in the process of being destroyed. |
105 content::RenderFrame* GetRenderFrame() const; | 105 content::RenderFrame* GetRenderFrame() const; |
106 | 106 |
107 // Runs |function| with appropriate scopes. Doesn't catch exceptions, callers | 107 // Runs |function| with appropriate scopes. Doesn't catch exceptions, callers |
108 // must do that if they want. | 108 // must do that if they want. |
109 // | 109 // |
110 // USE THIS METHOD RATHER THAN v8::Function::Call WHEREVER POSSIBLE. | 110 // USE THIS METHOD RATHER THAN v8::Function::Call WHEREVER POSSIBLE. |
111 v8::Local<v8::Value> CallFunction(v8::Local<v8::Function> function, | 111 v8::Local<v8::Value> CallFunction(const v8::Local<v8::Function>& function, |
112 int argc, | 112 int argc, |
113 v8::Local<v8::Value> argv[]) const; | 113 v8::Local<v8::Value> argv[]) const; |
| 114 v8::Local<v8::Value> CallFunction( |
| 115 const v8::Local<v8::Function>& function) const; |
114 | 116 |
115 void DispatchEvent(const char* event_name, v8::Local<v8::Array> args) const; | 117 void DispatchEvent(const char* event_name, v8::Local<v8::Array> args) const; |
116 | 118 |
117 // Fires the onunload event on the unload_event module. | 119 // Fires the onunload event on the unload_event module. |
118 void DispatchOnUnloadEvent(); | 120 void DispatchOnUnloadEvent(); |
119 | 121 |
120 // Returns the availability of the API |api_name|. | 122 // Returns the availability of the API |api_name|. |
121 Feature::Availability GetAvailability(const std::string& api_name); | 123 Feature::Availability GetAvailability(const std::string& api_name); |
122 | 124 |
123 // Returns a string description of the type of context this is. | 125 // Returns a string description of the type of context this is. |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 GURL url_; | 226 GURL url_; |
225 | 227 |
226 scoped_ptr<Runner> runner_; | 228 scoped_ptr<Runner> runner_; |
227 | 229 |
228 DISALLOW_COPY_AND_ASSIGN(ScriptContext); | 230 DISALLOW_COPY_AND_ASSIGN(ScriptContext); |
229 }; | 231 }; |
230 | 232 |
231 } // namespace extensions | 233 } // namespace extensions |
232 | 234 |
233 #endif // EXTENSIONS_RENDERER_SCRIPT_CONTEXT_H_ | 235 #endif // EXTENSIONS_RENDERER_SCRIPT_CONTEXT_H_ |
OLD | NEW |