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

Side by Side Diff: webkit/port/bindings/v8/ScriptController.h

Issue 10719: Add GCController support to test_shell.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years, 1 month 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
OLDNEW
1 // Copyright 2008, Google Inc. 1 // Copyright 2008, Google Inc.
2 // All rights reserved. 2 // 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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 211
212 // Get/Set RecordPlaybackMode flag. 212 // Get/Set RecordPlaybackMode flag.
213 // This is a special mode where JS helps the browser implement 213 // This is a special mode where JS helps the browser implement
214 // playback/record mode. Generally, in this mode, some functions 214 // playback/record mode. Generally, in this mode, some functions
215 // of client-side randomness are removed. For example, in 215 // of client-side randomness are removed. For example, in
216 // this mode Math.random() and Date.getTime() may not return 216 // this mode Math.random() and Date.getTime() may not return
217 // values which vary. 217 // values which vary.
218 static bool RecordPlaybackMode() { return m_recordPlaybackMode; } 218 static bool RecordPlaybackMode() { return m_recordPlaybackMode; }
219 static void setRecordPlaybackMode(bool value) { m_recordPlaybackMode = value ; } 219 static void setRecordPlaybackMode(bool value) { m_recordPlaybackMode = value ; }
220 220
221 // Set/Get ShouldExposeGCController flag.
222 // Some WebKit layout test need window.GCController.collect() to
223 // trigger GC, this flag lets the binding code expose
224 // window.GCController.collect() to the JavaScript code.
225 //
226 // GCController.collect() needs V8 engine expose gc() function by passing
227 // '--expose-gc' flag to the engine.
228 static bool shouldExposeGCController() {
229 return m_shouldExposeGCController;
230 }
231 static void setShouldExposeGCController(bool value) {
232 m_shouldExposeGCController = value;
233 }
234
221 void finishedWithEvent(Event*); 235 void finishedWithEvent(Event*);
222 void setEventHandlerLineno(int lineno); 236 void setEventHandlerLineno(int lineno);
223 237
224 void setProcessingTimerCallback(bool b) { m_processingTimerCallback = b; } 238 void setProcessingTimerCallback(bool b) { m_processingTimerCallback = b; }
225 bool processingUserGesture() const; 239 bool processingUserGesture() const;
226 240
227 void setPaused(bool b) { m_paused = b; } 241 void setPaused(bool b) { m_paused = b; }
228 bool isPaused() const { return m_paused; } 242 bool isPaused() const { return m_paused; }
229 243
230 const String* sourceURL() const { return m_sourceURL; } // 0 if we are not e valuating any script 244 const String* sourceURL() const { return m_sourceURL; } // 0 if we are not e valuating any script
231 245
232 void clearWindowShell(); 246 void clearWindowShell();
233 void updateDocument(); 247 void updateDocument();
234 248
235 void pauseTimeouts(OwnPtr<PausedTimeouts>&); 249 void pauseTimeouts(OwnPtr<PausedTimeouts>&);
236 void resumeTimeouts(OwnPtr<PausedTimeouts>&); 250 void resumeTimeouts(OwnPtr<PausedTimeouts>&);
237 251
238 void clearScriptObjects(); 252 void clearScriptObjects();
239 void cleanupScriptObjectsForPlugin(void*); 253 void cleanupScriptObjectsForPlugin(void*);
240 254
241 #if ENABLE(NETSCAPE_PLUGIN_API) 255 #if ENABLE(NETSCAPE_PLUGIN_API)
242 NPObject* createScriptObjectForPluginElement(HTMLPlugInElement*); 256 NPObject* createScriptObjectForPluginElement(HTMLPlugInElement*);
243 NPObject* windowScriptNPObject(); 257 NPObject* windowScriptNPObject();
244 #endif 258 #endif
245 259
246 private: 260 private:
247 static bool m_recordPlaybackMode; 261 static bool m_recordPlaybackMode;
262 static bool m_shouldExposeGCController;
248 263
249 Frame* m_frame; 264 Frame* m_frame;
250 const String* m_sourceURL; 265 const String* m_sourceURL;
251 266
252 bool m_processingTimerCallback; 267 bool m_processingTimerCallback;
253 bool m_paused; 268 bool m_paused;
254 269
255 OwnPtr<V8Proxy> m_proxy; 270 OwnPtr<V8Proxy> m_proxy;
256 typedef HashMap<void*, NPObject*> PluginObjectMap; 271 typedef HashMap<void*, NPObject*> PluginObjectMap;
257 272
(...skipping 23 matching lines...) Expand all
281 JSInstanceHolder& operator=(JSInstanceHandle); 296 JSInstanceHolder& operator=(JSInstanceHandle);
282 static JSInstance EmptyInstance(); 297 static JSInstance EmptyInstance();
283 298
284 private: 299 private:
285 JSPersistentInstance m_instance; 300 JSPersistentInstance m_instance;
286 }; 301 };
287 302
288 } // namespace WebCore 303 } // namespace WebCore
289 304
290 #endif // ScriptController_h 305 #endif // ScriptController_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698