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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 | 269 |
270 bool WebSharedWorkerImpl::postTaskToWorkerGlobalScope(std::unique_ptr<ExecutionC
ontextTask> task) | 270 bool WebSharedWorkerImpl::postTaskToWorkerGlobalScope(std::unique_ptr<ExecutionC
ontextTask> task) |
271 { | 271 { |
272 m_workerThread->postTask(BLINK_FROM_HERE, std::move(task)); | 272 m_workerThread->postTask(BLINK_FROM_HERE, std::move(task)); |
273 return true; | 273 return true; |
274 } | 274 } |
275 | 275 |
276 void WebSharedWorkerImpl::connect(WebMessagePortChannel* webChannel) | 276 void WebSharedWorkerImpl::connect(WebMessagePortChannel* webChannel) |
277 { | 277 { |
278 workerThread()->postTask( | 278 workerThread()->postTask( |
279 BLINK_FROM_HERE, createCrossThreadTask(&connectTask, passed(adoptPtr(web
Channel)))); | 279 BLINK_FROM_HERE, createCrossThreadTask(&connectTask, passed(WebMessagePo
rtChannelUniquePtr(webChannel)))); |
280 } | 280 } |
281 | 281 |
282 void WebSharedWorkerImpl::connectTask(PassOwnPtr<WebMessagePortChannel> channel,
ExecutionContext* context) | 282 void WebSharedWorkerImpl::connectTask(WebMessagePortChannelUniquePtr channel, Ex
ecutionContext* context) |
283 { | 283 { |
284 // Wrap the passed-in channel in a MessagePort, and send it off via a connec
t event. | 284 // Wrap the passed-in channel in a MessagePort, and send it off via a connec
t event. |
285 MessagePort* port = MessagePort::create(*context); | 285 MessagePort* port = MessagePort::create(*context); |
286 port->entangle(std::move(channel)); | 286 port->entangle(std::move(channel)); |
287 WorkerGlobalScope* workerGlobalScope = toWorkerGlobalScope(context); | 287 WorkerGlobalScope* workerGlobalScope = toWorkerGlobalScope(context); |
288 ASSERT_WITH_SECURITY_IMPLICATION(workerGlobalScope->isSharedWorkerGlobalScop
e()); | 288 ASSERT_WITH_SECURITY_IMPLICATION(workerGlobalScope->isSharedWorkerGlobalScop
e()); |
289 workerGlobalScope->dispatchEvent(createConnectEvent(port)); | 289 workerGlobalScope->dispatchEvent(createConnectEvent(port)); |
290 } | 290 } |
291 | 291 |
292 void WebSharedWorkerImpl::startWorkerContext(const WebURL& url, const WebString&
name, const WebString& contentSecurityPolicy, WebContentSecurityPolicyType poli
cyType, WebAddressSpace creationAddressSpace) | 292 void WebSharedWorkerImpl::startWorkerContext(const WebURL& url, const WebString&
name, const WebString& contentSecurityPolicy, WebContentSecurityPolicyType poli
cyType, WebAddressSpace creationAddressSpace) |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 if (devtoolsAgent) | 391 if (devtoolsAgent) |
392 devtoolsAgent->dispatchOnInspectorBackend(sessionId, callId, method, mes
sage); | 392 devtoolsAgent->dispatchOnInspectorBackend(sessionId, callId, method, mes
sage); |
393 } | 393 } |
394 | 394 |
395 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) | 395 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) |
396 { | 396 { |
397 return new WebSharedWorkerImpl(client); | 397 return new WebSharedWorkerImpl(client); |
398 } | 398 } |
399 | 399 |
400 } // namespace blink | 400 } // namespace blink |
OLD | NEW |