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

Side by Side Diff: Source/bindings/v8/ScriptController.h

Issue 181843003: Don't ignore OOM exceptions. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/bindings/v8/ScriptController.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008, 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2008, 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 void updateDocument(); 128 void updateDocument();
129 129
130 void namedItemAdded(HTMLDocument*, const AtomicString&); 130 void namedItemAdded(HTMLDocument*, const AtomicString&);
131 void namedItemRemoved(HTMLDocument*, const AtomicString&); 131 void namedItemRemoved(HTMLDocument*, const AtomicString&);
132 132
133 void updateSecurityOrigin(SecurityOrigin*); 133 void updateSecurityOrigin(SecurityOrigin*);
134 void clearScriptObjects(); 134 void clearScriptObjects();
135 void cleanupScriptObjectsForPlugin(Widget*); 135 void cleanupScriptObjectsForPlugin(Widget*);
136 136
137 void clearForClose(); 137 void clearForClose();
138 void clearForOutOfMemory();
139 138
140 NPObject* createScriptObjectForPluginElement(HTMLPlugInElement*); 139 NPObject* createScriptObjectForPluginElement(HTMLPlugInElement*);
141 NPObject* windowScriptNPObject(); 140 NPObject* windowScriptNPObject();
142 141
143 // Registers a v8 extension to be available on webpages. Will only 142 // Registers a v8 extension to be available on webpages. Will only
144 // affect v8 contexts initialized after this call. Takes ownership of 143 // affect v8 contexts initialized after this call. Takes ownership of
145 // the v8::Extension object passed. 144 // the v8::Extension object passed.
146 static void registerExtensionIfNeeded(v8::Extension*); 145 static void registerExtensionIfNeeded(v8::Extension*);
147 static V8Extensions& registeredExtensions(); 146 static V8Extensions& registeredExtensions();
148 147
149 bool setContextDebugId(int); 148 bool setContextDebugId(int);
150 static int contextDebugId(v8::Handle<v8::Context>); 149 static int contextDebugId(v8::Handle<v8::Context>);
151 150
152 v8::Isolate* isolate() const { return m_isolate; } 151 v8::Isolate* isolate() const { return m_isolate; }
153 152
154 private: 153 private:
155 typedef HashMap<int, OwnPtr<V8WindowShell> > IsolatedWorldMap; 154 typedef HashMap<int, OwnPtr<V8WindowShell> > IsolatedWorldMap;
156 typedef HashMap<Widget*, NPObject*> PluginObjectMap; 155 typedef HashMap<Widget*, NPObject*> PluginObjectMap;
157 156
158 ScriptValue evaluateScriptInMainWorld(const ScriptSourceCode&, AccessControl Status, ExecuteScriptPolicy); 157 ScriptValue evaluateScriptInMainWorld(const ScriptSourceCode&, AccessControl Status, ExecuteScriptPolicy);
159 void clearForClose(bool destroyGlobal);
160 158
161 LocalFrame* m_frame; 159 LocalFrame* m_frame;
162 const String* m_sourceURL; 160 const String* m_sourceURL;
163 v8::Isolate* m_isolate; 161 v8::Isolate* m_isolate;
164 162
165 OwnPtr<V8WindowShell> m_windowShell; 163 OwnPtr<V8WindowShell> m_windowShell;
166 IsolatedWorldMap m_isolatedWorlds; 164 IsolatedWorldMap m_isolatedWorlds;
167 165
168 // A mapping between Widgets and their corresponding script object. 166 // A mapping between Widgets and their corresponding script object.
169 // This list is used so that when the plugin dies, we can immediately 167 // This list is used so that when the plugin dies, we can immediately
170 // invalidate all sub-objects which are associated with that plugin. 168 // invalidate all sub-objects which are associated with that plugin.
171 // The frame keeps a NPObject reference for each item on the list. 169 // The frame keeps a NPObject reference for each item on the list.
172 PluginObjectMap m_pluginObjects; 170 PluginObjectMap m_pluginObjects;
173 171
174 NPObject* m_windowScriptNPObject; 172 NPObject* m_windowScriptNPObject;
175 }; 173 };
176 174
177 } // namespace WebCore 175 } // namespace WebCore
178 176
179 #endif // ScriptController_h 177 #endif // ScriptController_h
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/v8/ScriptController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698