Commit 0a140486 authored by mahesh.kk@samsung.com's avatar mahesh.kk@samsung.com

Update XMLHttpRequest use counter to count workers

Move UseCounter to createRequest() and use executionContext
instead of document to count XHR sync requests from workers once
http://code.google.com/p/chromium/issues/detail?id=376039 is fixed.

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

git-svn-id: svn://svn.chromium.org/blink/trunk@176448 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 83f06db5
......@@ -573,9 +573,6 @@ void XMLHttpRequest::open(const AtomicString& method, const KURL& url, bool asyn
}
if (!async && executionContext()->isDocument()) {
// Use count for XHR synchronous requests.
UseCounter::count(document(), UseCounter::XMLHttpRequestSynchronous);
if (document()->settings() && !document()->settings()->syncXHRInDocumentsEnabled()) {
exceptionState.throwDOMException(InvalidAccessError, "Synchronous requests are disabled for this page.");
return;
......@@ -895,6 +892,8 @@ void XMLHttpRequest::createRequest(PassRefPtr<FormData> httpBody, ExceptionState
setPendingActivity(this);
}
} else {
// Use count for XHR synchronous requests.
UseCounter::count(&executionContext, UseCounter::XMLHttpRequestSynchronous);
ThreadableLoader::loadResourceSynchronously(executionContext, request, *this, options, resourceLoaderOptions);
}
......
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