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

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

Issue 2657443005: Migrate WTF::HashSet::add() to ::insert() [part 1 of N] (Closed)
Patch Set: 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) 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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 type = "null"; 252 type = "null";
253 else if (port->isNeutered()) 253 else if (port->isNeutered())
254 type = "already neutered"; 254 type = "already neutered";
255 else 255 else
256 type = "a duplicate"; 256 type = "a duplicate";
257 exceptionState.throwDOMException( 257 exceptionState.throwDOMException(
258 DataCloneError, 258 DataCloneError,
259 "Port at index " + String::number(i) + " is " + type + "."); 259 "Port at index " + String::number(i) + " is " + type + ".");
260 return nullptr; 260 return nullptr;
261 } 261 }
262 visited.add(port); 262 visited.insert(port);
263 } 263 }
264 264
265 UseCounter::count(context, UseCounter::MessagePortsTransferred); 265 UseCounter::count(context, UseCounter::MessagePortsTransferred);
266 266
267 // Passed-in ports passed validity checks, so we can disentangle them. 267 // Passed-in ports passed validity checks, so we can disentangle them.
268 std::unique_ptr<MessagePortChannelArray> portArray = 268 std::unique_ptr<MessagePortChannelArray> portArray =
269 WTF::wrapUnique(new MessagePortChannelArray(ports.size())); 269 WTF::wrapUnique(new MessagePortChannelArray(ports.size()));
270 for (unsigned i = 0; i < ports.size(); ++i) 270 for (unsigned i = 0; i < ports.size(); ++i)
271 (*portArray)[i] = ports[i]->disentangle(); 271 (*portArray)[i] = ports[i]->disentangle();
272 return portArray; 272 return portArray;
(...skipping 15 matching lines...) Expand all
288 } 288 }
289 return portArray; 289 return portArray;
290 } 290 }
291 291
292 DEFINE_TRACE(MessagePort) { 292 DEFINE_TRACE(MessagePort) {
293 ContextLifecycleObserver::trace(visitor); 293 ContextLifecycleObserver::trace(visitor);
294 EventTargetWithInlineData::trace(visitor); 294 EventTargetWithInlineData::trace(visitor);
295 } 295 }
296 296
297 } // namespace blink 297 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698