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

Unified Diff: Source/core/inspector/AsyncCallTracker.cpp

Issue 1286383007: Use Optional instead of OwnPtr for holding AllowUserAgentScript (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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 | Source/core/inspector/InspectorDebuggerAgent.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | Source/core/inspector/InspectorDebuggerAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698