Index: third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp |
diff --git a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp |
index 4e1085e5ea2f5555338f704e0ce50a5733ee2c32..0d317bdbad102559cf8eb1f140562f7d9fb094c0 100644 |
--- a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp |
+++ b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp |
@@ -631,11 +631,13 @@ bool XMLHttpRequest::initSend(ExceptionState& exceptionState) |
return false; |
} |
- if (!m_async && exceptionState.isolate() && v8::MicrotasksScope::IsRunningMicrotasks(exceptionState.isolate())) { |
- UseCounter::count(getExecutionContext(), UseCounter::During_Microtask_SyncXHR); |
+ if (!m_async) { |
+ v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
+ if (isolate && v8::MicrotasksScope::IsRunningMicrotasks(isolate)) { |
+ UseCounter::count(getExecutionContext(), UseCounter::During_Microtask_SyncXHR); |
+ } |
} |
- |
m_error = false; |
return true; |
} |