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

Side by Side Diff: third_party/WebKit/Source/core/dom/MessagePort.cpp

Issue 2811863002: Move ScriptState::GetExecutionContext (Part 4) (Closed)
Patch Set: Fix Document.cpp Created 3 years, 8 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) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 // Make sure we aren't connected to any of the passed-in ports. 71 // Make sure we aren't connected to any of the passed-in ports.
72 for (unsigned i = 0; i < ports.size(); ++i) { 72 for (unsigned i = 0; i < ports.size(); ++i) {
73 if (ports[i] == this) { 73 if (ports[i] == this) {
74 exception_state.ThrowDOMException( 74 exception_state.ThrowDOMException(
75 kDataCloneError, 75 kDataCloneError,
76 "Port at index " + String::Number(i) + " contains the source port."); 76 "Port at index " + String::Number(i) + " contains the source port.");
77 return; 77 return;
78 } 78 }
79 } 79 }
80 MessagePortChannelArray channels = MessagePort::DisentanglePorts( 80 MessagePortChannelArray channels = MessagePort::DisentanglePorts(
81 script_state->GetExecutionContext(), ports, exception_state); 81 ExecutionContext::From(script_state), ports, exception_state);
82 if (exception_state.HadException()) 82 if (exception_state.HadException())
83 return; 83 return;
84 84
85 WebString message_string = message->ToWireString(); 85 WebString message_string = message->ToWireString();
86 WebMessagePortChannelArray web_channels = 86 WebMessagePortChannelArray web_channels =
87 ToWebMessagePortChannelArray(std::move(channels)); 87 ToWebMessagePortChannelArray(std::move(channels));
88 entangled_channel_->PostMessage(message_string, std::move(web_channels)); 88 entangled_channel_->PostMessage(message_string, std::move(web_channels));
89 } 89 }
90 90
91 // static 91 // static
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 } 286 }
287 return port_array; 287 return port_array;
288 } 288 }
289 289
290 DEFINE_TRACE(MessagePort) { 290 DEFINE_TRACE(MessagePort) {
291 ContextLifecycleObserver::Trace(visitor); 291 ContextLifecycleObserver::Trace(visitor);
292 EventTargetWithInlineData::Trace(visitor); 292 EventTargetWithInlineData::Trace(visitor);
293 } 293 }
294 294
295 } // namespace blink 295 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | third_party/WebKit/Source/core/dom/TaskRunnerHelper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698