Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Side by Side Diff: third_party/WebKit/Source/core/workers/DedicatedWorkerGlobalScope.cpp

Issue 2422793002: HTML MessagePort as mojo::MessagePipeHandle (Closed)
Patch Set: Add missing ScopedAsyncTaskScheduler instance for the new unit tests; required by a recent change t… Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 const AtomicString& DedicatedWorkerGlobalScope::interfaceName() const { 83 const AtomicString& DedicatedWorkerGlobalScope::interfaceName() const {
84 return EventTargetNames::DedicatedWorkerGlobalScope; 84 return EventTargetNames::DedicatedWorkerGlobalScope;
85 } 85 }
86 86
87 void DedicatedWorkerGlobalScope::postMessage( 87 void DedicatedWorkerGlobalScope::postMessage(
88 ScriptState* scriptState, 88 ScriptState* scriptState,
89 PassRefPtr<SerializedScriptValue> message, 89 PassRefPtr<SerializedScriptValue> message,
90 const MessagePortArray& ports, 90 const MessagePortArray& ports,
91 ExceptionState& exceptionState) { 91 ExceptionState& exceptionState) {
92 // Disentangle the port in preparation for sending it to the remote context. 92 // Disentangle the port in preparation for sending it to the remote context.
93 std::unique_ptr<MessagePortChannelArray> channels = 93 MessagePortChannelArray channels =
94 MessagePort::disentanglePorts(scriptState->getExecutionContext(), ports, 94 MessagePort::disentanglePorts(scriptState->getExecutionContext(), ports,
95 exceptionState); 95 exceptionState);
96 if (exceptionState.hadException()) 96 if (exceptionState.hadException())
97 return; 97 return;
98 workerObjectProxy().postMessageToWorkerObject(std::move(message), 98 workerObjectProxy().postMessageToWorkerObject(std::move(message),
99 std::move(channels)); 99 std::move(channels));
100 } 100 }
101 101
102 InProcessWorkerObjectProxy& DedicatedWorkerGlobalScope::workerObjectProxy() 102 InProcessWorkerObjectProxy& DedicatedWorkerGlobalScope::workerObjectProxy()
103 const { 103 const {
104 return static_cast<DedicatedWorkerThread*>(thread())->workerObjectProxy(); 104 return static_cast<DedicatedWorkerThread*>(thread())->workerObjectProxy();
105 } 105 }
106 106
107 DEFINE_TRACE(DedicatedWorkerGlobalScope) { 107 DEFINE_TRACE(DedicatedWorkerGlobalScope) {
108 WorkerGlobalScope::trace(visitor); 108 WorkerGlobalScope::trace(visitor);
109 } 109 }
110 110
111 } // namespace blink 111 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/DOMWindow.cpp ('k') | third_party/WebKit/Source/core/workers/DedicatedWorkerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698