Index: Source/core/inspector/AsyncCallTracker.cpp |
diff --git a/Source/core/inspector/AsyncCallTracker.cpp b/Source/core/inspector/AsyncCallTracker.cpp |
index 2e025a33465112196cb13ce4a0db33dc6c1a1b8f..256fdcc3ed3006f6ac2b8fe846cec3516d4d5a32 100644 |
--- a/Source/core/inspector/AsyncCallTracker.cpp |
+++ b/Source/core/inspector/AsyncCallTracker.cpp |
@@ -42,6 +42,7 @@ |
#include "core/xmlhttprequest/XMLHttpRequestUpload.h" |
#include "platform/ScriptForbiddenScope.h" |
#include "wtf/MainThread.h" |
+#include "wtf/Optional.h" |
#include "wtf/text/StringBuilder.h" |
#include "wtf/text/StringHash.h" |
@@ -241,9 +242,9 @@ void AsyncCallTracker::didEnqueueEvent(EventTarget* eventTarget, Event* event) |
{ |
ASSERT(eventTarget->executionContext()); |
ASSERT(m_debuggerAgent->trackingAsyncCalls()); |
- OwnPtr<ScriptForbiddenScope::AllowUserAgentScript> allowScripting; |
+ Optional<ScriptForbiddenScope::AllowUserAgentScript> allowScripting; |
if (isMainThread()) |
- allowScripting = adoptPtr(new ScriptForbiddenScope::AllowUserAgentScript()); |
+ allowScripting.emplace(); |
int operationId = m_debuggerAgent->traceAsyncOperationStarting(event->type()); |
ExecutionContextData* data = createContextDataIfNeeded(eventTarget->executionContext()); |
data->m_eventCallChains.set(event, operationId); |