| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 static HashSet<WebEmbeddedWorkerImpl*>& runningWorkerInstances() | 77 static HashSet<WebEmbeddedWorkerImpl*>& runningWorkerInstances() |
| 78 { | 78 { |
| 79 DEFINE_STATIC_LOCAL(HashSet<WebEmbeddedWorkerImpl*>, set, ()); | 79 DEFINE_STATIC_LOCAL(HashSet<WebEmbeddedWorkerImpl*>, set, ()); |
| 80 return set; | 80 return set; |
| 81 } | 81 } |
| 82 | 82 |
| 83 WebEmbeddedWorkerImpl::WebEmbeddedWorkerImpl(PassOwnPtr<WebServiceWorkerContextC
lient> client, PassOwnPtr<WebWorkerContentSettingsClientProxy> ContentSettingsCl
ient) | 83 WebEmbeddedWorkerImpl::WebEmbeddedWorkerImpl(PassOwnPtr<WebServiceWorkerContextC
lient> client, PassOwnPtr<WebWorkerContentSettingsClientProxy> ContentSettingsCl
ient) |
| 84 : m_workerContextClient(client) | 84 : m_workerContextClient(client) |
| 85 , m_contentSettingsClient(ContentSettingsClient) | 85 , m_contentSettingsClient(ContentSettingsClient) |
| 86 , m_workerInspectorProxy(WorkerInspectorProxy::create()) | 86 , m_workerInspectorProxy(WorkerInspectorProxy::create()) |
| 87 , m_webView(0) | 87 , m_webView(nullptr) |
| 88 , m_mainFrame(0) | 88 , m_mainFrame(nullptr) |
| 89 , m_loadingShadowPage(false) | 89 , m_loadingShadowPage(false) |
| 90 , m_askedToTerminate(false) | 90 , m_askedToTerminate(false) |
| 91 , m_waitingForDebuggerState(NotWaitingForDebugger) | 91 , m_waitingForDebuggerState(NotWaitingForDebugger) |
| 92 { | 92 { |
| 93 runningWorkerInstances().add(this); | 93 runningWorkerInstances().add(this); |
| 94 } | 94 } |
| 95 | 95 |
| 96 WebEmbeddedWorkerImpl::~WebEmbeddedWorkerImpl() | 96 WebEmbeddedWorkerImpl::~WebEmbeddedWorkerImpl() |
| 97 { | 97 { |
| 98 // Prevent onScriptLoaderFinished from deleting 'this'. | 98 // Prevent onScriptLoaderFinished from deleting 'this'. |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 // FIXME: http://crbug.com/363843. This needs to find a better way to | 212 // FIXME: http://crbug.com/363843. This needs to find a better way to |
| 213 // not create graphics layers. | 213 // not create graphics layers. |
| 214 settings->setAcceleratedCompositingEnabled(false); | 214 settings->setAcceleratedCompositingEnabled(false); |
| 215 // Currently we block all mixed-content requests from a ServiceWorker. | 215 // Currently we block all mixed-content requests from a ServiceWorker. |
| 216 // FIXME: When we support FetchEvent.default(), we should relax this | 216 // FIXME: When we support FetchEvent.default(), we should relax this |
| 217 // restriction. | 217 // restriction. |
| 218 settings->setStrictMixedContentChecking(true); | 218 settings->setStrictMixedContentChecking(true); |
| 219 settings->setAllowDisplayOfInsecureContent(false); | 219 settings->setAllowDisplayOfInsecureContent(false); |
| 220 settings->setAllowRunningOfInsecureContent(false); | 220 settings->setAllowRunningOfInsecureContent(false); |
| 221 m_mainFrame = toWebLocalFrameImpl(WebLocalFrame::create(WebTreeScopeType::Do
cument, this)); | 221 m_mainFrame = toWebLocalFrameImpl(WebLocalFrame::create(WebTreeScopeType::Do
cument, this)); |
| 222 m_webView->setMainFrame(m_mainFrame); | 222 m_webView->setMainFrame(m_mainFrame.get()); |
| 223 m_mainFrame->setDevToolsAgentClient(this); | 223 m_mainFrame->setDevToolsAgentClient(this); |
| 224 | 224 |
| 225 // If we were asked to wait for debugger then it is the good time to do that
. | 225 // If we were asked to wait for debugger then it is the good time to do that
. |
| 226 m_workerContextClient->workerReadyForInspection(); | 226 m_workerContextClient->workerReadyForInspection(); |
| 227 if (m_workerStartData.waitForDebuggerMode == WebEmbeddedWorkerStartData::Wai
tForDebugger) { | 227 if (m_workerStartData.waitForDebuggerMode == WebEmbeddedWorkerStartData::Wai
tForDebugger) { |
| 228 m_waitingForDebuggerState = WaitingForDebuggerBeforeLoadingScript; | 228 m_waitingForDebuggerState = WaitingForDebuggerBeforeLoadingScript; |
| 229 return; | 229 return; |
| 230 } | 230 } |
| 231 | 231 |
| 232 loadShadowPage(); | 232 loadShadowPage(); |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 m_mainScriptLoader.clear(); | 345 m_mainScriptLoader.clear(); |
| 346 | 346 |
| 347 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *doc
ument, *m_workerContextClient); | 347 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *doc
ument, *m_workerContextClient); |
| 348 m_loaderProxy = WorkerLoaderProxy::create(this); | 348 m_loaderProxy = WorkerLoaderProxy::create(this); |
| 349 m_workerThread = ServiceWorkerThread::create(m_loaderProxy, *m_workerGlobalS
copeProxy); | 349 m_workerThread = ServiceWorkerThread::create(m_loaderProxy, *m_workerGlobalS
copeProxy); |
| 350 m_workerThread->start(startupData.release()); | 350 m_workerThread->start(startupData.release()); |
| 351 m_workerInspectorProxy->workerThreadCreated(document, m_workerThread.get(),
scriptURL); | 351 m_workerInspectorProxy->workerThreadCreated(document, m_workerThread.get(),
scriptURL); |
| 352 } | 352 } |
| 353 | 353 |
| 354 } // namespace blink | 354 } // namespace blink |
| OLD | NEW |