| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 &connectTask, passed(WebMessagePortChannelUniquePtr(webChannel)))); | 302 &connectTask, passed(WebMessagePortChannelUniquePtr(webChannel)))); |
| 303 } | 303 } |
| 304 | 304 |
| 305 void WebSharedWorkerImpl::connectTask(WebMessagePortChannelUniquePtr channel, | 305 void WebSharedWorkerImpl::connectTask(WebMessagePortChannelUniquePtr channel, |
| 306 ExecutionContext* context) { | 306 ExecutionContext* context) { |
| 307 // Wrap the passed-in channel in a MessagePort, and send it off via a connect | 307 // Wrap the passed-in channel in a MessagePort, and send it off via a connect |
| 308 // event. | 308 // event. |
| 309 MessagePort* port = MessagePort::create(*context); | 309 MessagePort* port = MessagePort::create(*context); |
| 310 port->entangle(std::move(channel)); | 310 port->entangle(std::move(channel)); |
| 311 WorkerGlobalScope* workerGlobalScope = toWorkerGlobalScope(context); | 311 WorkerGlobalScope* workerGlobalScope = toWorkerGlobalScope(context); |
| 312 ASSERT_WITH_SECURITY_IMPLICATION( | 312 SECURITY_DCHECK(workerGlobalScope->isSharedWorkerGlobalScope()); |
| 313 workerGlobalScope->isSharedWorkerGlobalScope()); | |
| 314 workerGlobalScope->dispatchEvent(createConnectEvent(port)); | 313 workerGlobalScope->dispatchEvent(createConnectEvent(port)); |
| 315 } | 314 } |
| 316 | 315 |
| 317 void WebSharedWorkerImpl::startWorkerContext( | 316 void WebSharedWorkerImpl::startWorkerContext( |
| 318 const WebURL& url, | 317 const WebURL& url, |
| 319 const WebString& name, | 318 const WebString& name, |
| 320 const WebString& contentSecurityPolicy, | 319 const WebString& contentSecurityPolicy, |
| 321 WebContentSecurityPolicyType policyType, | 320 WebContentSecurityPolicyType policyType, |
| 322 WebAddressSpace creationAddressSpace) { | 321 WebAddressSpace creationAddressSpace) { |
| 323 m_url = url; | 322 m_url = url; |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 if (devtoolsAgent) | 435 if (devtoolsAgent) |
| 437 devtoolsAgent->dispatchOnInspectorBackend(sessionId, callId, method, | 436 devtoolsAgent->dispatchOnInspectorBackend(sessionId, callId, method, |
| 438 message); | 437 message); |
| 439 } | 438 } |
| 440 | 439 |
| 441 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) { | 440 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) { |
| 442 return new WebSharedWorkerImpl(client); | 441 return new WebSharedWorkerImpl(client); |
| 443 } | 442 } |
| 444 | 443 |
| 445 } // namespace blink | 444 } // namespace blink |
| OLD | NEW |