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

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

Issue 2091713002: Specialize base::IsWeakReceiver for Blink weak pointers to support base::Bind (1/5) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: +#include for build fix Created 4 years, 5 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 DCHECK(m_entangledChannel); 119 DCHECK(m_entangledChannel);
120 m_entangledChannel->setClient(0); 120 m_entangledChannel->setClient(0);
121 return std::move(m_entangledChannel); 121 return std::move(m_entangledChannel);
122 } 122 }
123 123
124 // Invoked to notify us that there are messages available for this port. 124 // Invoked to notify us that there are messages available for this port.
125 // This code may be called from another thread, and so should not call any non-t hreadsafe APIs (i.e. should not call into the entangled channel or access mutabl e variables). 125 // This code may be called from another thread, and so should not call any non-t hreadsafe APIs (i.e. should not call into the entangled channel or access mutabl e variables).
126 void MessagePort::messageAvailable() 126 void MessagePort::messageAvailable()
127 { 127 {
128 DCHECK(getExecutionContext()); 128 DCHECK(getExecutionContext());
129 getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&Mess agePort::dispatchMessages, CrossThreadWeakPersistentThisPointer<MessagePort>(thi s))); 129 getExecutionContext()->postTask(BLINK_FROM_HERE, createCrossThreadTask(&Mess agePort::dispatchMessages, wrapCrossThreadWeakPersistent(this)));
130 } 130 }
131 131
132 void MessagePort::start() 132 void MessagePort::start()
133 { 133 {
134 // Do nothing if we've been cloned or closed. 134 // Do nothing if we've been cloned or closed.
135 if (!isEntangled()) 135 if (!isEntangled())
136 return; 136 return;
137 137
138 DCHECK(getExecutionContext()); 138 DCHECK(getExecutionContext());
139 if (m_started) 139 if (m_started)
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 return portArray; 269 return portArray;
270 } 270 }
271 271
272 DEFINE_TRACE(MessagePort) 272 DEFINE_TRACE(MessagePort)
273 { 273 {
274 ActiveDOMObject::trace(visitor); 274 ActiveDOMObject::trace(visitor);
275 EventTargetWithInlineData::trace(visitor); 275 EventTargetWithInlineData::trace(visitor);
276 } 276 }
277 277
278 } // namespace blink 278 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/ElementVisibilityObserver.cpp ('k') | third_party/WebKit/Source/core/dom/ScriptRunner.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698