/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// If this is a chromium thread and no nsThread is associated // with it, this call will create a new nsThread.
nsIThread* thread = NS_GetCurrentThread();
MOZ_ASSERT(thread);
// Set the main thread observer so we can wake up when // xpcom events need to get processed.
nsCOMPtr<nsIThreadInternal> ti(do_QueryInterface(thread));
MOZ_ASSERT(ti);
ti->SetObserver(this);
for (;;) { bool didWork = NS_ProcessNextEvent(thread, false);
NS_IMETHODIMP
MessagePumpForNonMainUIThreads::OnDispatchedEvent() { // If our thread is sleeping in DoRunLoop's call to WaitForWork() and an // event posts to the nsIThread event queue - break our thread out of // chromium's WaitForWork. if (GetInWait()) {
ScheduleWork();
} return NS_OK;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.