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

Unified Diff: WebCore/bindings/generic/ActiveDOMCallback.h

Issue 9572031: Don't be so CRASH happy in the bindings layer. (Closed) Base URL: http://svn.webkit.org/repository/webkit/trunk/Source/
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | WebCore/bindings/generic/ActiveDOMCallback.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: WebCore/bindings/generic/ActiveDOMCallback.h
===================================================================
--- WebCore/bindings/generic/ActiveDOMCallback.h (revision 109601)
+++ WebCore/bindings/generic/ActiveDOMCallback.h (working copy)
@@ -31,26 +31,27 @@
#ifndef ActiveDOMCallback_h
#define ActiveDOMCallback_h
+#include "ContextDestructionObserver.h"
#include <wtf/OwnPtr.h>
namespace WebCore {
-class ActiveDOMObjectCallbackImpl;
class ScriptExecutionContext;
-// A class that allows callbacks to behave like ActiveDOMObjects, and also
-// be destroyed on the context thread or any other thread.
-class ActiveDOMCallback {
+// A base class that prevents binding callbacks from executing when
+// active dom objects are stopped or suspended, and is used by the
+// generated callback v8 bindings code to avoid erroneously CRASH()'ing
+// after script execution on a worker has been terminated.
+//
+// Should only be created, used, and destroyed on the script execution
+// context thread.
+class ActiveDOMCallback : public ContextDestructionObserver {
public:
ActiveDOMCallback(ScriptExecutionContext* context);
- ~ActiveDOMCallback();
+ virtual ~ActiveDOMCallback();
bool canInvokeCallback() const;
- ScriptExecutionContext* scriptExecutionContext() const;
-
-private:
- // The ActiveDOMObject part of the callback.
- OwnPtr<ActiveDOMObjectCallbackImpl> m_impl;
+ bool isScriptControllerTerminating() const;
};
} // namespace WebCore
« no previous file with comments | « no previous file | WebCore/bindings/generic/ActiveDOMCallback.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698