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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 { | 258 { |
259 m_client->workerContextDestroyed(); | 259 m_client->workerContextDestroyed(); |
260 // The lifetime of this proxy is controlled by the worker context. | 260 // The lifetime of this proxy is controlled by the worker context. |
261 delete this; | 261 delete this; |
262 } | 262 } |
263 | 263 |
264 // WorkerLoaderProxyProvider ---------------------------------------------------
-------- | 264 // WorkerLoaderProxyProvider ---------------------------------------------------
-------- |
265 | 265 |
266 void WebSharedWorkerImpl::postTaskToLoader(PassOwnPtr<ExecutionContextTask> task
) | 266 void WebSharedWorkerImpl::postTaskToLoader(PassOwnPtr<ExecutionContextTask> task
) |
267 { | 267 { |
268 m_mainFrame->frame()->document()->postTask(BLINK_FROM_HERE, task); | 268 m_mainFrame->frame()->document()->postTask(BLINK_FROM_HERE, std::move(task))
; |
269 } | 269 } |
270 | 270 |
271 bool WebSharedWorkerImpl::postTaskToWorkerGlobalScope(PassOwnPtr<ExecutionContex
tTask> task) | 271 bool WebSharedWorkerImpl::postTaskToWorkerGlobalScope(PassOwnPtr<ExecutionContex
tTask> task) |
272 { | 272 { |
273 m_workerThread->postTask(BLINK_FROM_HERE, task); | 273 m_workerThread->postTask(BLINK_FROM_HERE, std::move(task)); |
274 return true; | 274 return true; |
275 } | 275 } |
276 | 276 |
277 void WebSharedWorkerImpl::connect(WebMessagePortChannel* webChannel) | 277 void WebSharedWorkerImpl::connect(WebMessagePortChannel* webChannel) |
278 { | 278 { |
279 workerThread()->postTask( | 279 workerThread()->postTask( |
280 BLINK_FROM_HERE, createCrossThreadTask(&connectTask, adoptPtr(webChannel
))); | 280 BLINK_FROM_HERE, createCrossThreadTask(&connectTask, passed(adoptPtr(web
Channel)))); |
281 } | 281 } |
282 | 282 |
283 void WebSharedWorkerImpl::connectTask(PassOwnPtr<WebMessagePortChannel> channel,
ExecutionContext* context) | 283 void WebSharedWorkerImpl::connectTask(PassOwnPtr<WebMessagePortChannel> channel,
ExecutionContext* context) |
284 { | 284 { |
285 // Wrap the passed-in channel in a MessagePort, and send it off via a connec
t event. | 285 // Wrap the passed-in channel in a MessagePort, and send it off via a connec
t event. |
286 MessagePort* port = MessagePort::create(*context); | 286 MessagePort* port = MessagePort::create(*context); |
287 port->entangle(channel); | 287 port->entangle(std::move(channel)); |
288 WorkerGlobalScope* workerGlobalScope = toWorkerGlobalScope(context); | 288 WorkerGlobalScope* workerGlobalScope = toWorkerGlobalScope(context); |
289 ASSERT_WITH_SECURITY_IMPLICATION(workerGlobalScope->isSharedWorkerGlobalScop
e()); | 289 ASSERT_WITH_SECURITY_IMPLICATION(workerGlobalScope->isSharedWorkerGlobalScop
e()); |
290 workerGlobalScope->dispatchEvent(createConnectEvent(port)); | 290 workerGlobalScope->dispatchEvent(createConnectEvent(port)); |
291 } | 291 } |
292 | 292 |
293 void WebSharedWorkerImpl::startWorkerContext(const WebURL& url, const WebString&
name, const WebString& contentSecurityPolicy, WebContentSecurityPolicyType poli
cyType, WebAddressSpace creationAddressSpace) | 293 void WebSharedWorkerImpl::startWorkerContext(const WebURL& url, const WebString&
name, const WebString& contentSecurityPolicy, WebContentSecurityPolicyType poli
cyType, WebAddressSpace creationAddressSpace) |
294 { | 294 { |
295 m_url = url; | 295 m_url = url; |
296 m_name = name; | 296 m_name = name; |
297 m_creationAddressSpace = creationAddressSpace; | 297 m_creationAddressSpace = creationAddressSpace; |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 if (devtoolsAgent) | 391 if (devtoolsAgent) |
392 devtoolsAgent->dispatchOnInspectorBackend(sessionId, message); | 392 devtoolsAgent->dispatchOnInspectorBackend(sessionId, message); |
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 |