summaryrefslogtreecommitdiff
path: root/chromium/third_party/WebKit/Source/web/SharedWorkerRepositoryClientImpl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/WebKit/Source/web/SharedWorkerRepositoryClientImpl.cpp')
-rw-r--r--chromium/third_party/WebKit/Source/web/SharedWorkerRepositoryClientImpl.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/chromium/third_party/WebKit/Source/web/SharedWorkerRepositoryClientImpl.cpp b/chromium/third_party/WebKit/Source/web/SharedWorkerRepositoryClientImpl.cpp
index 62cb83930c1..5a50eaa2ac0 100644
--- a/chromium/third_party/WebKit/Source/web/SharedWorkerRepositoryClientImpl.cpp
+++ b/chromium/third_party/WebKit/Source/web/SharedWorkerRepositoryClientImpl.cpp
@@ -35,6 +35,7 @@
#include "core/dom/ExceptionCode.h"
#include "core/dom/ExecutionContext.h"
#include "core/events/Event.h"
+#include "core/frame/UseCounter.h"
#include "core/frame/csp/ContentSecurityPolicy.h"
#include "core/inspector/InspectorInstrumentation.h"
#include "core/workers/SharedWorker.h"
@@ -132,18 +133,18 @@ void SharedWorkerRepositoryClientImpl::connect(SharedWorker* worker, PassOwnPtr<
String unusedSecureContextError;
bool isSecureContext = worker->executionContext()->isSecureContext(unusedSecureContextError);
OwnPtr<WebSharedWorkerConnector> webWorkerConnector = adoptPtr(m_client->createSharedWorkerConnector(url, name, getId(document), header, headerType, isSecureContext ? WebSharedWorkerCreationContextTypeSecure : WebSharedWorkerCreationContextTypeNonsecure, &creationError));
- if (!webWorkerConnector) {
+ if (creationError != WebWorkerCreationErrorNone) {
if (creationError == WebWorkerCreationErrorURLMismatch) {
// Existing worker does not match this url, so return an error back to the caller.
exceptionState.throwDOMException(URLMismatchError, "The location of the SharedWorker named '" + name + "' does not exactly match the provided URL ('" + url.elidedString() + "').");
+ return;
} else if (creationError == WebWorkerCreationErrorSecureContextMismatch) {
if (isSecureContext) {
- exceptionState.throwSecurityError("The SharedWorker named '" + name + "' was created from a nonsecure context and this context is secure.");
+ UseCounter::count(document, UseCounter::NonSecureSharedWorkerAccessedFromSecureContext);
} else {
- exceptionState.throwSecurityError("The SharedWorker named '" + name + "' was created from a secure context and this context is not secure.");
+ UseCounter::count(document, UseCounter::SecureSharedWorkerAccessedFromNonSecureContext);
}
}
- return;
}
// The connector object manages its own lifecycle (and the lifecycles of the two worker objects).