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

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

Issue 1136953017: Add fallback mechanism to release Extension ports if the JS context has been destroyed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments Created 5 years, 7 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 | « extensions/renderer/resources/messaging.js ('k') | extensions/renderer/script_context.cc » ('j') | 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 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
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
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_
OLDNEW
« no previous file with comments | « extensions/renderer/resources/messaging.js ('k') | extensions/renderer/script_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698