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

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

Issue 2011553008: [Binding] [Refactoring] Move some create() from SerializedScriptValueFactory to SerializedScriptValu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 WebString messageString; 168 WebString messageString;
169 WebMessagePortChannelArray webChannels; 169 WebMessagePortChannelArray webChannels;
170 if (!webChannel.tryGetMessage(&messageString, webChannels)) 170 if (!webChannel.tryGetMessage(&messageString, webChannels))
171 return false; 171 return false;
172 172
173 if (webChannels.size()) { 173 if (webChannels.size()) {
174 channels = adoptPtr(new MessagePortChannelArray(webChannels.size())); 174 channels = adoptPtr(new MessagePortChannelArray(webChannels.size()));
175 for (size_t i = 0; i < webChannels.size(); ++i) 175 for (size_t i = 0; i < webChannels.size(); ++i)
176 (*channels)[i] = adoptPtr(webChannels[i]); 176 (*channels)[i] = adoptPtr(webChannels[i]);
177 } 177 }
178 message = SerializedScriptValueFactory::instance().createFromWire(messageStr ing); 178 message = SerializedScriptValue::create(messageString);
179 return true; 179 return true;
180 } 180 }
181 181
182 bool MessagePort::tryGetMessage(RefPtr<SerializedScriptValue>& message, OwnPtr<M essagePortChannelArray>& channels) 182 bool MessagePort::tryGetMessage(RefPtr<SerializedScriptValue>& message, OwnPtr<M essagePortChannelArray>& channels)
183 { 183 {
184 if (!m_entangledChannel) 184 if (!m_entangledChannel)
185 return false; 185 return false;
186 return tryGetMessageFrom(*m_entangledChannel, message, channels); 186 return tryGetMessageFrom(*m_entangledChannel, message, channels);
187 } 187 }
188 188
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 return portArray; 267 return portArray;
268 } 268 }
269 269
270 DEFINE_TRACE(MessagePort) 270 DEFINE_TRACE(MessagePort)
271 { 271 {
272 ActiveDOMObject::trace(visitor); 272 ActiveDOMObject::trace(visitor);
273 EventTargetWithInlineData::trace(visitor); 273 EventTargetWithInlineData::trace(visitor);
274 } 274 }
275 275
276 } // namespace blink 276 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698