Index: Source/web/WebSharedWorkerImpl.cpp |
diff --git a/Source/web/WebSharedWorkerImpl.cpp b/Source/web/WebSharedWorkerImpl.cpp |
index 240b9108441811afba92ebce1ad30672d2611fa7..ef6dfedd6f74f8d68af305023aa7e16816cd64ce 100644 |
--- a/Source/web/WebSharedWorkerImpl.cpp |
+++ b/Source/web/WebSharedWorkerImpl.cpp |
@@ -34,6 +34,7 @@ |
#include "core/dom/CrossThreadTask.h" |
#include "core/dom/Document.h" |
#include "core/events/MessageEvent.h" |
+#include "core/frame/Navigator.h" |
#include "core/html/HTMLFormElement.h" |
#include "core/inspector/ConsoleMessage.h" |
#include "core/inspector/InspectorInstrumentation.h" |
@@ -47,6 +48,8 @@ |
#include "core/workers/WorkerClients.h" |
#include "core/workers/WorkerGlobalScope.h" |
#include "core/workers/WorkerInspectorProxy.h" |
+#include "core/workers/WorkerLanguageTasks.h" |
+#include "core/workers/WorkerNavigator.h" |
#include "core/workers/WorkerScriptLoader.h" |
#include "core/workers/WorkerThreadStartupData.h" |
#include "platform/RuntimeEnabledFeatures.h" |
@@ -310,8 +313,13 @@ void WebSharedWorkerImpl::workerGlobalScopeClosedOnMainThread() |
stopWorkerThread(); |
} |
-void WebSharedWorkerImpl::workerGlobalScopeStarted(WorkerGlobalScope*) |
+void WebSharedWorkerImpl::workerGlobalScopeStarted(WorkerGlobalScope* workerGlobalScope) |
{ |
+ WTF::Vector<WTF::String> languages; |
+ String acceptLangsString = m_acceptLanguages; |
+ acceptLangsString.split(',', languages); |
+ // Get the navigator and set the user preferred langauges |
+ workerGlobalScope->navigator()->setUserPreferredLanguagesForWorkers(languages); |
} |
void WebSharedWorkerImpl::workerThreadTerminated() |
@@ -356,12 +364,13 @@ void WebSharedWorkerImpl::connectTask(ExecutionContext* context, PassOwnPtr<WebM |
workerGlobalScope->dispatchEvent(createConnectEvent(port.release())); |
} |
-void WebSharedWorkerImpl::startWorkerContext(const WebURL& url, const WebString& name, const WebString& contentSecurityPolicy, WebContentSecurityPolicyType policyType) |
+void WebSharedWorkerImpl::startWorkerContext(const WebURL& url, const WebString& name, const WebString& contentSecurityPolicy, WebContentSecurityPolicyType policyType, const WebString& acceptLanguages) |
{ |
m_url = url; |
m_name = name; |
m_contentSecurityPolicy = contentSecurityPolicy; |
m_policyType = policyType; |
+ m_acceptLanguages = acceptLanguages; |
initializeLoader(url); |
} |