Commit a5ef710c authored by yurys@chromium.org's avatar yurys@chromium.org

Use Optional instead of OwnPtr for holding AllowUserAgentScript

BUG=522674

Review URL: https://codereview.chromium.org/1286383007

git-svn-id: svn://svn.chromium.org/blink/trunk@200870 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent b65213fb
......@@ -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);
......
......@@ -35,6 +35,7 @@
#include "core/inspector/v8/V8Debugger.h"
#include "platform/ScriptForbiddenScope.h"
#include "wtf/MainThread.h"
#include "wtf/Optional.h"
namespace blink {
......@@ -261,9 +262,9 @@ bool InspectorDebuggerAgent::isPaused()
PassRefPtrWillBeRawPtr<ScriptAsyncCallStack> InspectorDebuggerAgent::currentAsyncStackTraceForConsole()
{
OwnPtr<ScriptForbiddenScope::AllowUserAgentScript> allowScripting;
Optional<ScriptForbiddenScope::AllowUserAgentScript> allowScripting;
if (isMainThread())
allowScripting = adoptPtr(new ScriptForbiddenScope::AllowUserAgentScript());
allowScripting.emplace();
return m_v8DebuggerAgent->currentAsyncStackTraceForConsole();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment