| Index: Source/WebCore/Modules/intents/IntentRequest.cpp
|
| ===================================================================
|
| --- Source/WebCore/Modules/intents/IntentRequest.cpp (revision 109043)
|
| +++ Source/WebCore/Modules/intents/IntentRequest.cpp (working copy)
|
| @@ -52,24 +52,26 @@
|
| , m_intent(intent)
|
| , m_successCallback(successCallback)
|
| , m_errorCallback(errorCallback)
|
| + , m_stopped(false)
|
| {
|
| }
|
|
|
| void IntentRequest::contextDestroyed()
|
| {
|
| ContextDestructionObserver::contextDestroyed();
|
| - m_successCallback.clear();
|
| - m_errorCallback.clear();
|
| + m_stopped = true;
|
| }
|
|
|
| void IntentRequest::stop()
|
| {
|
| - m_successCallback.clear();
|
| - m_errorCallback.clear();
|
| + m_stopped = true;
|
| }
|
|
|
| void IntentRequest::postResult(SerializedScriptValue* data)
|
| {
|
| + if (m_stopped)
|
| + return;
|
| +
|
| // Callback could lead to deletion of this.
|
| RefPtr<IntentRequest> protector(this);
|
|
|
| @@ -84,6 +86,9 @@
|
|
|
| void IntentRequest::postFailure(SerializedScriptValue* data)
|
| {
|
| + if (m_stopped)
|
| + return;
|
| +
|
| // Callback could lead to deletion of this.
|
| RefPtr<IntentRequest> protector(this);
|
|
|
|
|