Replace "nested message loop" with "nested run loop" in comments.
Following https://codereview.chromium.org/2818533003/ BUG=703346 TBR=danakj@chromium.org Review-Url: https://codereview.chromium.org/2828913003 Cr-Commit-Position: refs/heads/master@{#469674}
This commit is contained in:
ash
base
chrome/browser
app_controller_mac.mm
autocomplete
browser_process_impl.ccchrome_navigation_browsertest.ccextensions
api
media
printing
sessions
subresource_filter
sync
test
integration
ui
components
history
core
browser
printing
content
browser
public
browser
test
android
javatests
src
org
chromium
content
browser
renderer
shell
browser
layout_test
extensions/test
ipc
mojo/public/cpp/bindings/lib
native_client_sdk/doc_generated
pepper_beta
pepper_dev
pepper_stable
ppapi
api
c
cpp
proxy
tests
services/ui/ws
third_party/WebKit/Source
ui
aura
base
events
views
controls
menu
widget
wm
public
@ -502,7 +502,7 @@ void DragDropController::AnimationEnded(const gfx::Animation* animation) {
|
||||
if (!IsDragDropInProgress())
|
||||
drag_image_.reset();
|
||||
if (pending_long_tap_) {
|
||||
// If not in a nested message loop, we can forward the long tap right now.
|
||||
// If not in a nested run loop, we can forward the long tap right now.
|
||||
if (!should_block_during_drag_drop_) {
|
||||
ForwardPendingLongTap();
|
||||
} else {
|
||||
|
@ -126,7 +126,7 @@ class ASH_EXPORT DragDropController : public aura::client::DragDropClient,
|
||||
// Only be used for tests.
|
||||
bool should_block_during_drag_drop_;
|
||||
|
||||
// Closure for quitting nested message loop.
|
||||
// Closure for quitting nested run loop.
|
||||
base::Closure quit_closure_;
|
||||
|
||||
std::unique_ptr<ash::DragDropTracker> drag_drop_tracker_;
|
||||
|
@ -243,7 +243,7 @@ class ASH_EXPORT RootWindowController : public ShellObserver {
|
||||
// Deletes associated objects and clears the state, but doesn't delete
|
||||
// the root window yet. This is used to delete a secondary displays'
|
||||
// root window safely when the display disconnect signal is received,
|
||||
// which may come while we're in the nested message loop.
|
||||
// which may come while we're in the nested run loop.
|
||||
void Shutdown();
|
||||
|
||||
// Deletes all child windows and performs necessary cleanup.
|
||||
|
@ -53,7 +53,7 @@ class ASH_EXPORT ToplevelWindowEventHandler
|
||||
|
||||
wm::WmToplevelWindowEventHandler wm_toplevel_window_event_handler_;
|
||||
|
||||
// Are we running a nested message loop from RunMoveLoop().
|
||||
// Are we running a nested run loop from RunMoveLoop().
|
||||
bool in_move_loop_ = false;
|
||||
|
||||
base::WeakPtrFactory<ToplevelWindowEventHandler> weak_factory_;
|
||||
|
@ -418,7 +418,7 @@ bool MessageLoop::DeferOrRunPendingTask(PendingTask pending_task) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// We couldn't run the task now because we're in a nested message loop
|
||||
// We couldn't run the task now because we're in a nested run loop
|
||||
// and the task isn't nestable.
|
||||
deferred_non_nestable_work_queue_.push(std::move(pending_task));
|
||||
return false;
|
||||
|
@ -405,8 +405,8 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
|
||||
TimeTicks recent_time_;
|
||||
|
||||
// A queue of non-nestable tasks that we had to defer because when it came
|
||||
// time to execute them we were in a nested message loop. They will execute
|
||||
// once we're out of nested message loops.
|
||||
// time to execute them we were in a nested run loop. They will execute
|
||||
// once we're out of nested run loops.
|
||||
TaskQueue deferred_non_nestable_work_queue_;
|
||||
|
||||
ObserverList<DestructionObserver> destruction_observers_;
|
||||
|
@ -106,7 +106,7 @@ void MessagePumpForUI::ScheduleWork() {
|
||||
return; // There was room in the Window Message queue.
|
||||
|
||||
// We have failed to insert a have-work message, so there is a chance that we
|
||||
// will starve tasks/timers while sitting in a nested message loop. Nested
|
||||
// will starve tasks/timers while sitting in a nested run loop. Nested
|
||||
// loops only look at Windows Message queues, and don't look at *our* task
|
||||
// queues, etc., so we might not get a time slice in such. :-(
|
||||
// We could abort here, but the fear is that this failure mode is plausibly
|
||||
|
@ -60,7 +60,7 @@ class BASE_EXPORT RunLoop {
|
||||
// effect.
|
||||
//
|
||||
// WARNING: You must NEVER assume that a call to Quit() or QuitWhenIdle() will
|
||||
// terminate the targetted message loop. If a nested message loop continues
|
||||
// terminate the targetted message loop. If a nested run loop continues
|
||||
// running, the target may NEVER terminate. It is very easy to livelock (run
|
||||
// forever) in such a case.
|
||||
void Quit();
|
||||
|
@ -944,7 +944,7 @@ class AppControllerProfileObserver : public ProfileAttributesStorage::Observer {
|
||||
}
|
||||
|
||||
// Ignore commands during session restore's browser creation. It uses a
|
||||
// nested message loop and commands dispatched during this operation cause
|
||||
// nested run loop and commands dispatched during this operation cause
|
||||
// havoc.
|
||||
if (SessionRestore::IsRestoring(lastProfile) &&
|
||||
base::RunLoop::IsNestedOnCurrentThread()) {
|
||||
|
@ -192,7 +192,7 @@ class SearchProviderTest : public testing::Test,
|
||||
// If we're waiting for the provider to finish, this exits the message loop.
|
||||
void OnProviderUpdate(bool updated_matches) override;
|
||||
|
||||
// Runs a nested message loop until provider_ is done. The message loop is
|
||||
// Runs a nested run loop until provider_ is done. The message loop is
|
||||
// exited by way of OnProviderUpdate.
|
||||
void RunTillProviderDone();
|
||||
|
||||
|
@ -1344,7 +1344,7 @@ void BrowserProcessImpl::Unpin() {
|
||||
shutting_down_ = true;
|
||||
#if BUILDFLAG(ENABLE_PRINTING)
|
||||
// Wait for the pending print jobs to finish. Don't do this later, since
|
||||
// this might cause a nested message loop to run, and we don't want pending
|
||||
// this might cause a nested run loop to run, and we don't want pending
|
||||
// tasks to run once teardown has started.
|
||||
print_job_manager_->Shutdown();
|
||||
#endif
|
||||
|
@ -65,7 +65,7 @@ class DidStartNavigationObserver : public content::WebContentsObserver {
|
||||
message_loop_runner_(new content::MessageLoopRunner) {}
|
||||
~DidStartNavigationObserver() override {}
|
||||
|
||||
// Runs a nested message loop and blocks until the full load has
|
||||
// Runs a nested run loop and blocks until the full load has
|
||||
// completed.
|
||||
void Wait() { message_loop_runner_->Run(); }
|
||||
|
||||
|
@ -99,7 +99,7 @@ class UserGestureCatcher : public content::NotificationObserver {
|
||||
// A sequential list of user gesture notifications from the test extension(s).
|
||||
std::deque<bool> results_;
|
||||
|
||||
// True if we're in a nested message loop waiting for results from
|
||||
// True if we're in a nested run loop waiting for results from
|
||||
// the extension.
|
||||
bool waiting_;
|
||||
};
|
||||
|
@ -274,7 +274,7 @@ class StartProvisionalLoadObserver : public content::WebContentsObserver {
|
||||
}
|
||||
}
|
||||
|
||||
// Run a nested message loop until navigation to the expected URL has started.
|
||||
// Run a nested run loop until navigation to the expected URL has started.
|
||||
void Wait() {
|
||||
if (url_seen_)
|
||||
return;
|
||||
|
@ -275,7 +275,7 @@ void DesktopCaptureAccessHandler::ProcessScreenCaptureAccessRequest(
|
||||
// 2. Request comes from a page with a secure origin or from an extension.
|
||||
if (screen_capture_enabled && origin_is_secure) {
|
||||
// Get title of the calling application prior to showing the message box.
|
||||
// chrome::ShowQuestionMessageBox() starts a nested message loop which may
|
||||
// chrome::ShowQuestionMessageBox() starts a nested run loop which may
|
||||
// allow |web_contents| to be destroyed on the UI thread before the messag
|
||||
// box is closed. See http://crbug.com/326690.
|
||||
base::string16 application_title =
|
||||
|
@ -150,7 +150,7 @@ void PrintJob::Stop() {
|
||||
DCHECK(RunsTasksOnCurrentThread());
|
||||
|
||||
if (quit_factory_.HasWeakPtrs()) {
|
||||
// In case we're running a nested message loop to wait for a job to finish,
|
||||
// In case we're running a nested run loop to wait for a job to finish,
|
||||
// and we finished before the timeout, quit the nested loop right away.
|
||||
Quit();
|
||||
quit_factory_.InvalidateWeakPtrs();
|
||||
|
@ -125,7 +125,7 @@ class PrintJob : public PrintJobWorkerOwner,
|
||||
// eventual deadlock.
|
||||
void ControlledWorkerShutdown();
|
||||
|
||||
// Called at shutdown when running a nested message loop.
|
||||
// Called at shutdown when running a nested run loop.
|
||||
void Quit();
|
||||
|
||||
void HoldUntilStopIsCalled();
|
||||
@ -167,7 +167,7 @@ class PrintJob : public PrintJobWorkerOwner,
|
||||
std::vector<int> pdf_page_mapping_;
|
||||
#endif // defined(OS_WIN)
|
||||
|
||||
// Used at shutdown so that we can quit a nested message loop.
|
||||
// Used at shutdown so that we can quit a nested run loop.
|
||||
base::WeakPtrFactory<PrintJob> quit_factory_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(PrintJob);
|
||||
|
@ -716,10 +716,10 @@ class SessionRestoreImpl : public content::NotificationObserver {
|
||||
// Responsible for loading the tabs.
|
||||
scoped_refptr<TabLoader> tab_loader_;
|
||||
|
||||
// When synchronous we run a nested message loop. To avoid creating windows
|
||||
// from the nested message loop (which can make exiting the nested message
|
||||
// When synchronous we run a nested run loop. To avoid creating windows
|
||||
// from the nested run loop (which can make exiting the nested message
|
||||
// loop take a while) we cache the SessionWindows here and create the actual
|
||||
// windows when the nested message loop exits.
|
||||
// windows when the nested run loop exits.
|
||||
std::vector<std::unique_ptr<sessions::SessionWindow>> windows_;
|
||||
SessionID::id_type active_window_id_;
|
||||
|
||||
|
@ -19,7 +19,7 @@ class TestRulesetPublisher {
|
||||
~TestRulesetPublisher();
|
||||
|
||||
// Indexes the |unindexed_ruleset| and publishes it to all renderers
|
||||
// via the RulesetService. Spins a nested message loop until done.
|
||||
// via the RulesetService. Spins a nested run loop until done.
|
||||
void SetRuleset(const TestRuleset& unindexed_ruleset);
|
||||
|
||||
private:
|
||||
|
@ -45,7 +45,7 @@ class StatusChangeChecker {
|
||||
// Timeout length when blocking.
|
||||
virtual base::TimeDelta GetTimeoutDuration();
|
||||
|
||||
// Helper function to start running the nested message loop.
|
||||
// Helper function to start running the nested run loop.
|
||||
//
|
||||
// Will exit if IsExitConditionSatisfied() returns true when called from
|
||||
// CheckExitCondition(), if a timeout occurs, or if StopWaiting() is called.
|
||||
|
@ -20,7 +20,7 @@ app_list::AppListModel* GetAppListModel(AppListService* service);
|
||||
|
||||
AppListServiceImpl* GetAppListServiceImpl();
|
||||
|
||||
// Creates a second profile in a nested message loop for testing the app list.
|
||||
// Creates a second profile in a nested run loop for testing the app list.
|
||||
Profile* CreateSecondProfileAsync();
|
||||
|
||||
} // namespace test
|
||||
|
@ -55,7 +55,7 @@ void DragBookmarks(Profile* profile,
|
||||
ui::DragDropTypes::DragEventSource source) {
|
||||
DCHECK(!nodes.empty());
|
||||
|
||||
// Allow nested message loop so we get DnD events as we drag this around.
|
||||
// Allow nested run loop so we get DnD events as we drag this around.
|
||||
base::MessageLoop::ScopedNestableTaskAllower nestable_task_allower(
|
||||
base::MessageLoop::current());
|
||||
|
||||
|
@ -31,7 +31,7 @@ void DragBookmarks(Profile* profile,
|
||||
bookmarks::BookmarkNodeData drag_data(nodes);
|
||||
drag_data.Write(profile->GetPath(), &data);
|
||||
|
||||
// Allow nested message loop so we get DnD events as we drag this around.
|
||||
// Allow nested run loop so we get DnD events as we drag this around.
|
||||
base::MessageLoop::ScopedNestableTaskAllower nestable_task_allower(
|
||||
base::MessageLoop::current());
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
namespace {
|
||||
|
||||
// Shows a Windows certificate viewer dialog on a background thread to avoid
|
||||
// nested message loops.
|
||||
// nested run loops.
|
||||
class CertificateViewerDialog : public ui::BaseShellDialogImpl {
|
||||
public:
|
||||
CertificateViewerDialog() {}
|
||||
|
@ -38,7 +38,7 @@ bool MonitorHasAutohideTaskbarForEdge(UINT edge, HMONITOR monitor) {
|
||||
// state of the taskbar and then retrieve its position. That call returns
|
||||
// the edge on which the taskbar is present. If it matches the edge we
|
||||
// are looking for, we are done.
|
||||
// NOTE: This call spins a nested message loop.
|
||||
// NOTE: This call spins a nested run loop.
|
||||
HWND taskbar = reinterpret_cast<HWND>(
|
||||
SHAppBarMessage(ABM_GETAUTOHIDEBAR, &taskbar_data));
|
||||
if (!::IsWindow(taskbar)) {
|
||||
|
@ -24,7 +24,7 @@ namespace chrome {
|
||||
namespace {
|
||||
|
||||
// Responsible for invoking TaskbarList::SetOverlayIcon(). The call to
|
||||
// TaskbarList::SetOverlayIcon() runs a nested message loop that proves
|
||||
// TaskbarList::SetOverlayIcon() runs a nested run loop that proves
|
||||
// problematic when called on the UI thread. Additionally it seems the call may
|
||||
// take a while to complete. For this reason we call it on a worker thread.
|
||||
//
|
||||
|
@ -183,7 +183,7 @@ class TabDragController : public views::WidgetObserver,
|
||||
// Indicates what should happen after invoking DragBrowserToNewTabStrip().
|
||||
enum DragBrowserResultType {
|
||||
// The caller should return immediately. This return value is used if a
|
||||
// nested message loop was created or we're in a nested message loop and
|
||||
// nested run loop was created or we're in a nested run loop and
|
||||
// need to exit it.
|
||||
DRAG_BROWSER_RESULT_STOP,
|
||||
|
||||
@ -303,7 +303,7 @@ class TabDragController : public views::WidgetObserver,
|
||||
// runs a nested move loop.
|
||||
void DetachIntoNewBrowserAndRunMoveLoop(const gfx::Point& point_in_screen);
|
||||
|
||||
// Runs a nested message loop that handles moving the current
|
||||
// Runs a nested run loop that handles moving the current
|
||||
// Browser. |drag_offset| is the offset from the window origin and is used in
|
||||
// calculating the location of the window offset from the cursor while
|
||||
// dragging.
|
||||
|
@ -641,7 +641,7 @@ IN_PROC_BROWSER_TEST_P(DetachToBrowserTabDragControllerTest,
|
||||
|
||||
namespace {
|
||||
|
||||
// Invoked from the nested message loop.
|
||||
// Invoked from the nested run loop.
|
||||
void DragToSeparateWindowStep2(DetachToBrowserTabDragControllerTest* test,
|
||||
TabStrip* not_attached_tab_strip,
|
||||
TabStrip* target_tab_strip) {
|
||||
@ -1358,7 +1358,7 @@ IN_PROC_BROWSER_TEST_P(DetachToBrowserTabDragControllerTest, MAYBE_DragAll) {
|
||||
|
||||
namespace {
|
||||
|
||||
// Invoked from the nested message loop.
|
||||
// Invoked from the nested run loop.
|
||||
void DragAllToSeparateWindowStep2(DetachToBrowserTabDragControllerTest* test,
|
||||
TabStrip* attached_tab_strip,
|
||||
TabStrip* target_tab_strip,
|
||||
@ -1430,7 +1430,7 @@ IN_PROC_BROWSER_TEST_P(DetachToBrowserTabDragControllerTest,
|
||||
|
||||
namespace {
|
||||
|
||||
// Invoked from the nested message loop.
|
||||
// Invoked from the nested run loop.
|
||||
void DragAllToSeparateWindowAndCancelStep2(
|
||||
DetachToBrowserTabDragControllerTest* test,
|
||||
TabStrip* attached_tab_strip,
|
||||
@ -1622,7 +1622,7 @@ IN_PROC_BROWSER_TEST_P(DetachToBrowserTabDragControllerTest,
|
||||
|
||||
namespace {
|
||||
|
||||
// Invoked from the nested message loop.
|
||||
// Invoked from the nested run loop.
|
||||
void CancelOnNewTabWhenDraggingStep2(
|
||||
DetachToBrowserTabDragControllerTest* test,
|
||||
const BrowserList* browser_list) {
|
||||
@ -1844,7 +1844,7 @@ IN_PROC_BROWSER_TEST_P(DetachToBrowserInSeparateDisplayTabDragControllerTest,
|
||||
|
||||
namespace {
|
||||
|
||||
// Invoked from the nested message loop.
|
||||
// Invoked from the nested run loop.
|
||||
void DragTabToWindowInSeparateDisplayStep2(
|
||||
DetachToBrowserTabDragControllerTest* test,
|
||||
TabStrip* not_attached_tab_strip,
|
||||
@ -2268,7 +2268,7 @@ class DetachToBrowserInSeparateDisplayAndCancelTabDragControllerTest
|
||||
DetachToBrowserInSeparateDisplayAndCancelTabDragControllerTest);
|
||||
};
|
||||
|
||||
// Invoked from the nested message loop.
|
||||
// Invoked from the nested run loop.
|
||||
void CancelDragTabToWindowInSeparateDisplayStep3(
|
||||
TabStrip* tab_strip,
|
||||
const BrowserList* browser_list) {
|
||||
@ -2282,7 +2282,7 @@ void CancelDragTabToWindowInSeparateDisplayStep3(
|
||||
display_manager->AddRemoveDisplay();
|
||||
}
|
||||
|
||||
// Invoked from the nested message loop.
|
||||
// Invoked from the nested run loop.
|
||||
void CancelDragTabToWindowInSeparateDisplayStep2(
|
||||
DetachToBrowserInSeparateDisplayAndCancelTabDragControllerTest* test,
|
||||
TabStrip* tab_strip,
|
||||
|
@ -52,14 +52,14 @@ bool MockCanAddURLToHistory(const GURL& url) {
|
||||
}
|
||||
|
||||
// Used for querying top sites. Either runs sequentially, or runs a nested
|
||||
// nested message loop until the response is complete. The later is used when
|
||||
// nested run loop until the response is complete. The later is used when
|
||||
// TopSites is queried before it finishes loading.
|
||||
class TopSitesQuerier {
|
||||
public:
|
||||
TopSitesQuerier()
|
||||
: number_of_callbacks_(0), waiting_(false), weak_ptr_factory_(this) {}
|
||||
|
||||
// Queries top sites. If |wait| is true a nested message loop is run until the
|
||||
// Queries top sites. If |wait| is true a nested run loop is run until the
|
||||
// callback is notified.
|
||||
void QueryTopSites(TopSitesImpl* top_sites, bool wait) {
|
||||
QueryAllTopSites(top_sites, wait, false);
|
||||
|
@ -461,7 +461,7 @@ IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintPreviewCancelled,
|
||||
IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintPreviewInvalidPrinterSettings,
|
||||
int /* document cookie */)
|
||||
|
||||
// Run a nested message loop in the renderer until print preview for
|
||||
// Run a nested run loop in the renderer until print preview for
|
||||
// window.print() finishes.
|
||||
IPC_SYNC_MESSAGE_ROUTED0_0(PrintHostMsg_SetupScriptedPrintPreview)
|
||||
|
||||
|
@ -989,7 +989,7 @@ void PrintWebViewHelper::ScriptedPrint(bool user_initiated) {
|
||||
bool PrintWebViewHelper::OnMessageReceived(const IPC::Message& message) {
|
||||
// The class is not designed to handle recursive messages. This is not
|
||||
// expected during regular flow. However, during rendering of content for
|
||||
// printing, lower level code may run nested message loop. E.g. PDF may has
|
||||
// printing, lower level code may run nested run loop. E.g. PDF may has
|
||||
// script to show message box http://crbug.com/502562. In that moment browser
|
||||
// may receive updated printer capabilities and decide to restart print
|
||||
// preview generation. When this happened message handling function may
|
||||
|
@ -456,7 +456,7 @@ void GpuProcessTransportFactory::EstablishedGpuChannel(
|
||||
"::Compositor"));
|
||||
#if defined(OS_MACOSX)
|
||||
// On Mac, GpuCommandBufferMsg_SwapBuffersCompleted must be handled in
|
||||
// a nested message loop during resize.
|
||||
// a nested run loop during resize.
|
||||
context_provider->SetDefaultTaskRunner(
|
||||
ui::WindowResizeHelperMac::Get()->task_runner());
|
||||
#endif
|
||||
|
@ -50,7 +50,7 @@ bool DelegatedFrameHostClientAura::DelegatedFrameCanCreateResizeLock() const {
|
||||
#if !defined(OS_CHROMEOS)
|
||||
// On Windows and Linux, holding pointer moves will not help throttling
|
||||
// resizes.
|
||||
// TODO(piman): on Windows we need to block (nested message loop?) the
|
||||
// TODO(piman): on Windows we need to block (nested run loop?) the
|
||||
// WM_SIZE event. On Linux we need to throttle at the WM level using
|
||||
// _NET_WM_SYNC_REQUEST.
|
||||
return false;
|
||||
|
@ -929,7 +929,7 @@ void RenderWidgetHostImpl::WaitForSurface() {
|
||||
Send(new ViewMsg_Repaint(routing_id_, view_size));
|
||||
}
|
||||
|
||||
// Pump a nested message loop until we time out or get a frame of the right
|
||||
// Pump a nested run loop until we time out or get a frame of the right
|
||||
// size.
|
||||
TimeTicks start_time = TimeTicks::Now();
|
||||
TimeDelta time_left = TimeDelta::FromMilliseconds(kPaintMsgTimeoutMS);
|
||||
|
@ -447,7 +447,7 @@ class RenderFrameHostCreatedObserver : public WebContentsObserver {
|
||||
|
||||
~RenderFrameHostCreatedObserver() override;
|
||||
|
||||
// Runs a nested message loop and blocks until the expected number of
|
||||
// Runs a nested run loop and blocks until the expected number of
|
||||
// RenderFrameHosts is created.
|
||||
void Wait();
|
||||
|
||||
|
@ -952,7 +952,7 @@ void WebContentsViewAura::StartDragging(
|
||||
}
|
||||
|
||||
// Grab a weak pointer to the RenderWidgetHost, since it can be destroyed
|
||||
// during the drag and drop nested message loop in StartDragAndDrop.
|
||||
// during the drag and drop nested run loop in StartDragAndDrop.
|
||||
// For example, the RenderWidgetHost can be deleted if a cross-process
|
||||
// transfer happens while dragging, since the RenderWidgetHost is deleted in
|
||||
// that case.
|
||||
|
@ -606,7 +606,7 @@ class WebContents : public PageNavigator,
|
||||
virtual content::RendererPreferences* GetMutableRendererPrefs() = 0;
|
||||
|
||||
// Tells the tab to close now. The tab will take care not to close until it's
|
||||
// out of nested message loops.
|
||||
// out of nested run loops.
|
||||
virtual void Close() = 0;
|
||||
|
||||
// A render view-originated drag has ended. Informs the render view host and
|
||||
|
@ -19,7 +19,7 @@ import java.lang.reflect.Method;
|
||||
/**
|
||||
* Handles processing messages in nested run loops.
|
||||
*
|
||||
* Android does not support nested message loops by default. While running
|
||||
* Android does not support nested run loops by default. While running
|
||||
* in nested mode, we use reflection to retreive messages from the MessageQueue
|
||||
* and dispatch them.
|
||||
*/
|
||||
|
@ -114,7 +114,7 @@ class BrowserTestBase : public testing::Test {
|
||||
void CreateTestServer(const base::FilePath& test_server_base);
|
||||
|
||||
// When the test is running in --single-process mode, runs the given task on
|
||||
// the in-process renderer thread. A nested message loop is run until it
|
||||
// the in-process renderer thread. A nested run loop is run until it
|
||||
// returns.
|
||||
void PostTaskToInProcessRendererAndWait(const base::Closure& task);
|
||||
|
||||
|
@ -237,7 +237,7 @@ class TestDownloadRequestHandler : public base::NonThreadSafe {
|
||||
// different runs of the same test.
|
||||
//
|
||||
// * Initialization of the handler synchronously runs a task on the
|
||||
// BrowserThread::IO thread using a nested message loop. Only construct an
|
||||
// BrowserThread::IO thread using a nested run loop. Only construct an
|
||||
// instance of this object after browser threads have been initialized.
|
||||
TestDownloadRequestHandler();
|
||||
|
||||
|
@ -24,11 +24,11 @@ class TestFrameNavigationObserver : public WebContentsObserver {
|
||||
|
||||
~TestFrameNavigationObserver() override;
|
||||
|
||||
// Runs a nested message loop and blocks until the full load has
|
||||
// Runs a nested run loop and blocks until the full load has
|
||||
// completed.
|
||||
void Wait();
|
||||
|
||||
// Runs a nested message loop and blocks until the navigation in the
|
||||
// Runs a nested run loop and blocks until the navigation in the
|
||||
// associated FrameTreeNode has committed.
|
||||
void WaitForCommit();
|
||||
|
||||
|
@ -33,7 +33,7 @@ class TestNavigationObserver {
|
||||
|
||||
virtual ~TestNavigationObserver();
|
||||
|
||||
// Runs a nested message loop and blocks until the expected number of
|
||||
// Runs a nested run loop and blocks until the expected number of
|
||||
// navigations are complete.
|
||||
void Wait();
|
||||
|
||||
|
@ -148,7 +148,7 @@ void HostGlobals::LogWithSource(PP_Instance instance,
|
||||
const std::string& value) {
|
||||
PepperPluginInstanceImpl* instance_object =
|
||||
HostGlobals::Get()->GetInstance(instance);
|
||||
// It's possible to process this message in a nested message loop while
|
||||
// It's possible to process this message in a nested run loop while
|
||||
// detaching a Document…
|
||||
// TODO(dcheng): Make it so this can't happen. https://crbug.com/561683
|
||||
if (instance_object &&
|
||||
|
@ -84,7 +84,7 @@ int32_t PPB_Flash_MessageLoop_Impl::InternalRun(
|
||||
state_->set_run_callback(callback);
|
||||
|
||||
// It is possible that the PPB_Flash_MessageLoop_Impl object has been
|
||||
// destroyed when the nested message loop exits.
|
||||
// destroyed when the nested run loop exits.
|
||||
scoped_refptr<State> state_protector(state_);
|
||||
{
|
||||
base::MessageLoop::ScopedNestableTaskAllower allow(
|
||||
|
@ -1379,7 +1379,7 @@ class CONTENT_EXPORT RenderFrameImpl
|
||||
// Whether or not this RenderFrame is currently pasting.
|
||||
bool is_pasting_;
|
||||
|
||||
// Whether we must stop creating nested message loops for modal dialogs. This
|
||||
// Whether we must stop creating nested run loops for modal dialogs. This
|
||||
// is necessary because modal dialogs have a ScopedPageLoadDeferrer on the
|
||||
// stack that interferes with swapping out.
|
||||
bool suppress_further_dialogs_;
|
||||
|
@ -2498,7 +2498,7 @@ TEST_F(DevToolsAgentTest, DevToolsResumeOnClose) {
|
||||
DispatchDevToolsMessage("Debugger.enable",
|
||||
"{\"id\":1,\"method\":\"Debugger.enable\"}");
|
||||
|
||||
// Executing javascript will pause the thread and create nested message loop.
|
||||
// Executing javascript will pause the thread and create nested run loop.
|
||||
// Posting task simulates message coming from browser.
|
||||
base::ThreadTaskRunnerHandle::Get()->PostTask(
|
||||
FROM_HERE,
|
||||
|
@ -45,7 +45,7 @@ class RenderProcessHost;
|
||||
class Shell;
|
||||
|
||||
#if defined(OS_ANDROID)
|
||||
// Android uses a nested message loop for running layout tests because the
|
||||
// Android uses a nested run loop for running layout tests because the
|
||||
// default message loop, provided by the system, does not offer a blocking
|
||||
// Run() method. The loop itself, implemented as NestedMessagePumpAndroid,
|
||||
// uses a base::WaitableEvent allowing it to sleep until more events arrive.
|
||||
|
@ -57,7 +57,7 @@ class ResultCatcher : public content::NotificationObserver {
|
||||
// If non-NULL, we will listen to events from this BrowserContext only.
|
||||
content::BrowserContext* browser_context_restriction_;
|
||||
|
||||
// Only set if we're in a nested message loop waiting for results from
|
||||
// Only set if we're in a nested run loop waiting for results from
|
||||
// the extension.
|
||||
base::Closure quit_closure_;
|
||||
};
|
||||
|
@ -674,7 +674,7 @@ void SyncChannel::WaitForReply(mojo::SyncHandleRegistry* registry,
|
||||
}
|
||||
|
||||
if (should_pump_messages)
|
||||
WaitForReplyWithNestedMessageLoop(context); // Run a nested message loop.
|
||||
WaitForReplyWithNestedMessageLoop(context); // Run a nested run loop.
|
||||
|
||||
break;
|
||||
}
|
||||
|
@ -225,12 +225,12 @@ class IPC_EXPORT SyncChannel : public ChannelProxy {
|
||||
}
|
||||
|
||||
// Both these functions wait for a reply, timeout or process shutdown. The
|
||||
// latter one also runs a nested message loop in the meantime.
|
||||
// latter one also runs a nested run loop in the meantime.
|
||||
static void WaitForReply(mojo::SyncHandleRegistry* registry,
|
||||
SyncContext* context,
|
||||
bool pump_messages);
|
||||
|
||||
// Runs a nested message loop until a reply arrives, times out, or the process
|
||||
// Runs a nested run loop until a reply arrives, times out, or the process
|
||||
// shuts down.
|
||||
static void WaitForReplyWithNestedMessageLoop(SyncContext* context);
|
||||
|
||||
|
@ -52,7 +52,7 @@ class Connector::ActiveDispatchTracker {
|
||||
};
|
||||
|
||||
// Watches the MessageLoop on the current thread. Notifies the current chain of
|
||||
// ActiveDispatchTrackers when a nested message loop is started.
|
||||
// ActiveDispatchTrackers when a nested run loop is started.
|
||||
class Connector::RunLoopNestingObserver
|
||||
: public base::RunLoop::NestingObserver,
|
||||
public base::MessageLoop::DestructionObserver {
|
||||
|
@ -212,7 +212,7 @@ Data Fields</h2><table class="memberdecls">
|
||||
<p>Runs the thread message loop. </p>
|
||||
<p>Running the message loop is required for you to get issued completion callbacks on the thread.</p>
|
||||
<p>The message loop identified by the argument must have been previously successfully attached to the current thread.</p>
|
||||
<p>You may not run nested message loops. Since the main thread has an implicit message loop that the system runs, you may not call Run on the main thread.</p>
|
||||
<p>You may not run nested run loops. Since the main thread has an implicit message loop that the system runs, you may not call Run on the main thread.</p>
|
||||
<dl class="return"><dt><b>Returns:</b></dt><dd><ul>
|
||||
<li>PP_OK: The message loop was successfully run. Note that on success, the message loop will only exit when you call <a class="el" href="struct_p_p_b___message_loop__1__0.html#adbbdc03661c9ac41df82fffcc566603d" title="Posts a quit message to the given message loop's work queue.">PostQuit()</a>.</li>
|
||||
<li>PP_ERROR_BADRESOURCE: The given message loop resource is invalid.</li>
|
||||
|
@ -306,7 +306,7 @@ Static Public Member Functions</h2><table class="memberdecls">
|
||||
<p>Runs the thread message loop. </p>
|
||||
<p>Running the message loop is required for you to get issued completion callbacks on the thread.</p>
|
||||
<p>The message loop identified by the argument must have been previously successfully attached to the current thread.</p>
|
||||
<p>You may not run nested message loops. Since the main thread has an implicit message loop that the system runs, you may not call Run on the main thread.</p>
|
||||
<p>You may not run nested run loops. Since the main thread has an implicit message loop that the system runs, you may not call Run on the main thread.</p>
|
||||
<dl class="return"><dt><b>Returns:</b></dt><dd><ul>
|
||||
<li>PP_OK: The message loop was successfully run. Note that on success, the message loop will only exit when you call <a class="el" href="classpp_1_1_message_loop.html#a2311af860834b866076fb518ac27eab5" title="Posts a quit message to the given message loop's work queue.">PostQuit()</a>.</li>
|
||||
<li>PP_ERROR_BADRESOURCE: The given message loop resource is invalid.</li>
|
||||
|
@ -212,7 +212,7 @@ Data Fields</h2><table class="memberdecls">
|
||||
<p>Runs the thread message loop. </p>
|
||||
<p>Running the message loop is required for you to get issued completion callbacks on the thread.</p>
|
||||
<p>The message loop identified by the argument must have been previously successfully attached to the current thread.</p>
|
||||
<p>You may not run nested message loops. Since the main thread has an implicit message loop that the system runs, you may not call Run on the main thread.</p>
|
||||
<p>You may not run nested run loops. Since the main thread has an implicit message loop that the system runs, you may not call Run on the main thread.</p>
|
||||
<dl class="return"><dt><b>Returns:</b></dt><dd><ul>
|
||||
<li>PP_OK: The message loop was successfully run. Note that on success, the message loop will only exit when you call <a class="el" href="struct_p_p_b___message_loop__1__0.html#adbbdc03661c9ac41df82fffcc566603d" title="Posts a quit message to the given message loop's work queue.">PostQuit()</a>.</li>
|
||||
<li>PP_ERROR_BADRESOURCE: The given message loop resource is invalid.</li>
|
||||
|
@ -306,7 +306,7 @@ Static Public Member Functions</h2><table class="memberdecls">
|
||||
<p>Runs the thread message loop. </p>
|
||||
<p>Running the message loop is required for you to get issued completion callbacks on the thread.</p>
|
||||
<p>The message loop identified by the argument must have been previously successfully attached to the current thread.</p>
|
||||
<p>You may not run nested message loops. Since the main thread has an implicit message loop that the system runs, you may not call Run on the main thread.</p>
|
||||
<p>You may not run nested run loops. Since the main thread has an implicit message loop that the system runs, you may not call Run on the main thread.</p>
|
||||
<dl class="return"><dt><b>Returns:</b></dt><dd><ul>
|
||||
<li>PP_OK: The message loop was successfully run. Note that on success, the message loop will only exit when you call <a class="el" href="classpp_1_1_message_loop.html#a2311af860834b866076fb518ac27eab5" title="Posts a quit message to the given message loop's work queue.">PostQuit()</a>.</li>
|
||||
<li>PP_ERROR_BADRESOURCE: The given message loop resource is invalid.</li>
|
||||
|
@ -212,7 +212,7 @@ Data Fields</h2><table class="memberdecls">
|
||||
<p>Runs the thread message loop. </p>
|
||||
<p>Running the message loop is required for you to get issued completion callbacks on the thread.</p>
|
||||
<p>The message loop identified by the argument must have been previously successfully attached to the current thread.</p>
|
||||
<p>You may not run nested message loops. Since the main thread has an implicit message loop that the system runs, you may not call Run on the main thread.</p>
|
||||
<p>You may not run nested run loops. Since the main thread has an implicit message loop that the system runs, you may not call Run on the main thread.</p>
|
||||
<dl class="return"><dt><b>Returns:</b></dt><dd><ul>
|
||||
<li>PP_OK: The message loop was successfully run. Note that on success, the message loop will only exit when you call <a class="el" href="struct_p_p_b___message_loop__1__0.html#adbbdc03661c9ac41df82fffcc566603d" title="Posts a quit message to the given message loop's work queue.">PostQuit()</a>.</li>
|
||||
<li>PP_ERROR_BADRESOURCE: The given message loop resource is invalid.</li>
|
||||
|
@ -306,7 +306,7 @@ Static Public Member Functions</h2><table class="memberdecls">
|
||||
<p>Runs the thread message loop. </p>
|
||||
<p>Running the message loop is required for you to get issued completion callbacks on the thread.</p>
|
||||
<p>The message loop identified by the argument must have been previously successfully attached to the current thread.</p>
|
||||
<p>You may not run nested message loops. Since the main thread has an implicit message loop that the system runs, you may not call Run on the main thread.</p>
|
||||
<p>You may not run nested run loops. Since the main thread has an implicit message loop that the system runs, you may not call Run on the main thread.</p>
|
||||
<dl class="return"><dt><b>Returns:</b></dt><dd><ul>
|
||||
<li>PP_OK: The message loop was successfully run. Note that on success, the message loop will only exit when you call <a class="el" href="classpp_1_1_message_loop.html#a2311af860834b866076fb518ac27eab5" title="Posts a quit message to the given message loop's work queue.">PostQuit()</a>.</li>
|
||||
<li>PP_ERROR_BADRESOURCE: The given message loop resource is invalid.</li>
|
||||
|
@ -182,7 +182,7 @@ interface PPB_MessageLoop {
|
||||
* The message loop identified by the argument must have been previously
|
||||
* successfully attached to the current thread.
|
||||
*
|
||||
* You may not run nested message loops. Since the main thread has an
|
||||
* You may not run nested run loops. Since the main thread has an
|
||||
* implicit message loop that the system runs, you may not call Run on the
|
||||
* main thread.
|
||||
*
|
||||
|
@ -13,7 +13,7 @@ label Chrome {
|
||||
|
||||
/**
|
||||
* The <code>PPB_Flash_MessageLoop</code> interface supports Pepper Flash to run
|
||||
* nested message loops.
|
||||
* nested run loops.
|
||||
*/
|
||||
interface PPB_Flash_MessageLoop {
|
||||
/**
|
||||
@ -39,14 +39,14 @@ interface PPB_Flash_MessageLoop {
|
||||
PP_Bool IsFlashMessageLoop([in] PP_Resource resource);
|
||||
|
||||
/**
|
||||
* Runs a nested message loop. The plugin will be reentered from this call.
|
||||
* Runs a nested run loop. The plugin will be reentered from this call.
|
||||
* This function is used in places where Flash would normally enter a nested
|
||||
* message loop (e.g., when displaying context menus), but Pepper provides
|
||||
* only an asynchronous call. After performing that asynchronous call, call
|
||||
* <code>Run()</code>. In the callback, call <code>Quit()</code>.
|
||||
*
|
||||
* For a given message loop resource, only the first call to
|
||||
* <code>Run()</code> will start a nested message loop. The subsequent calls
|
||||
* <code>Run()</code> will start a nested run loop. The subsequent calls
|
||||
* will return <code>PP_ERROR_FAILED</code> immediately.
|
||||
*
|
||||
* @param[in] flash_message_loop The Flash message loop.
|
||||
@ -60,14 +60,14 @@ interface PPB_Flash_MessageLoop {
|
||||
int32_t Run([in] PP_Resource flash_message_loop);
|
||||
|
||||
/**
|
||||
* Signals to quit the outermost nested message loop. Use this to exit and
|
||||
* Signals to quit the outermost nested run loop. Use this to exit and
|
||||
* return back to the caller after you call <code>Run()</code>.
|
||||
*
|
||||
* If <code>Quit()</code> is not called to balance the call to
|
||||
* <code>Run()</code>, the outermost nested message loop will be quitted
|
||||
* <code>Run()</code>, the outermost nested run loop will be quitted
|
||||
* implicitly when the resource is destroyed.
|
||||
*
|
||||
* @param[in] flash_message_loop The Flash message loop.
|
||||
*/
|
||||
void Quit([in] PP_Resource flash_message_loop);
|
||||
};
|
||||
};
|
||||
|
@ -48,7 +48,7 @@ interface PPB_Testing_Private {
|
||||
[in] PP_Point top_left);
|
||||
|
||||
/**
|
||||
* Runs a nested message loop. The plugin will be reentered from this call.
|
||||
* Runs a nested run loop. The plugin will be reentered from this call.
|
||||
* This function is used for unit testing the API. The normal pattern is to
|
||||
* issue some asynchronous call that has a callback. Then you call
|
||||
* RunMessageLoop which will suspend the plugin and go back to processing
|
||||
@ -60,7 +60,7 @@ interface PPB_Testing_Private {
|
||||
void RunMessageLoop([in] PP_Instance instance);
|
||||
|
||||
/**
|
||||
* Posts a quit message for the outermost nested message loop. Use this to
|
||||
* Posts a quit message for the outermost nested run loop. Use this to
|
||||
* exit and return back to the caller after you call RunMessageLoop.
|
||||
*/
|
||||
void QuitMessageLoop([in] PP_Instance instance);
|
||||
|
@ -196,7 +196,7 @@ struct PPB_MessageLoop_1_0 {
|
||||
* The message loop identified by the argument must have been previously
|
||||
* successfully attached to the current thread.
|
||||
*
|
||||
* You may not run nested message loops. Since the main thread has an
|
||||
* You may not run nested run loops. Since the main thread has an
|
||||
* implicit message loop that the system runs, you may not call Run on the
|
||||
* main thread.
|
||||
*
|
||||
|
@ -29,7 +29,7 @@
|
||||
*/
|
||||
/**
|
||||
* The <code>PPB_Flash_MessageLoop</code> interface supports Pepper Flash to run
|
||||
* nested message loops.
|
||||
* nested run loops.
|
||||
*/
|
||||
struct PPB_Flash_MessageLoop_0_1 {
|
||||
/**
|
||||
@ -53,14 +53,14 @@ struct PPB_Flash_MessageLoop_0_1 {
|
||||
*/
|
||||
PP_Bool (*IsFlashMessageLoop)(PP_Resource resource);
|
||||
/**
|
||||
* Runs a nested message loop. The plugin will be reentered from this call.
|
||||
* Runs a nested run loop. The plugin will be reentered from this call.
|
||||
* This function is used in places where Flash would normally enter a nested
|
||||
* message loop (e.g., when displaying context menus), but Pepper provides
|
||||
* only an asynchronous call. After performing that asynchronous call, call
|
||||
* <code>Run()</code>. In the callback, call <code>Quit()</code>.
|
||||
*
|
||||
* For a given message loop resource, only the first call to
|
||||
* <code>Run()</code> will start a nested message loop. The subsequent calls
|
||||
* <code>Run()</code> will start a nested run loop. The subsequent calls
|
||||
* will return <code>PP_ERROR_FAILED</code> immediately.
|
||||
*
|
||||
* @param[in] flash_message_loop The Flash message loop.
|
||||
@ -73,11 +73,11 @@ struct PPB_Flash_MessageLoop_0_1 {
|
||||
*/
|
||||
int32_t (*Run)(PP_Resource flash_message_loop);
|
||||
/**
|
||||
* Signals to quit the outermost nested message loop. Use this to exit and
|
||||
* Signals to quit the outermost nested run loop. Use this to exit and
|
||||
* return back to the caller after you call <code>Run()</code>.
|
||||
*
|
||||
* If <code>Quit()</code> is not called to balance the call to
|
||||
* <code>Run()</code>, the outermost nested message loop will be quitted
|
||||
* <code>Run()</code>, the outermost nested run loop will be quitted
|
||||
* implicitly when the resource is destroyed.
|
||||
*
|
||||
* @param[in] flash_message_loop The Flash message loop.
|
||||
|
@ -66,7 +66,7 @@ struct PPB_Testing_Private_1_0 {
|
||||
PP_Resource image,
|
||||
const struct PP_Point* top_left);
|
||||
/**
|
||||
* Runs a nested message loop. The plugin will be reentered from this call.
|
||||
* Runs a nested run loop. The plugin will be reentered from this call.
|
||||
* This function is used for unit testing the API. The normal pattern is to
|
||||
* issue some asynchronous call that has a callback. Then you call
|
||||
* RunMessageLoop which will suspend the plugin and go back to processing
|
||||
@ -77,7 +77,7 @@ struct PPB_Testing_Private_1_0 {
|
||||
*/
|
||||
void (*RunMessageLoop)(PP_Instance instance);
|
||||
/**
|
||||
* Posts a quit message for the outermost nested message loop. Use this to
|
||||
* Posts a quit message for the outermost nested run loop. Use this to
|
||||
* exit and return back to the caller after you call RunMessageLoop.
|
||||
*/
|
||||
void (*QuitMessageLoop)(PP_Instance instance);
|
||||
|
@ -184,7 +184,7 @@ class MessageLoop : public Resource {
|
||||
/// The message loop identified by the argument must have been previously
|
||||
/// successfully attached to the current thread.
|
||||
///
|
||||
/// You may not run nested message loops. Since the main thread has an
|
||||
/// You may not run nested run loops. Since the main thread has an
|
||||
/// implicit message loop that the system runs, you may not call Run on the
|
||||
/// main thread.
|
||||
///
|
||||
|
@ -49,12 +49,12 @@ int32_t FlashMenuResource::Show(
|
||||
// 1. Flash sends a show request to the renderer.
|
||||
// 2. The show handler in the renderer (in the case of full screen) requests
|
||||
// the window rect which is a sync message to the browser. This causes
|
||||
// a nested message loop to be spun up in the renderer.
|
||||
// a nested run loop to be spun up in the renderer.
|
||||
// 3. Flash expects context menus to be synchronous so it starts a nested
|
||||
// message loop. This creates a second nested message loop in both the
|
||||
// message loop. This creates a second nested run loop in both the
|
||||
// plugin and renderer process.
|
||||
// 4. The browser sends the window rect reply to unblock the renderer, but
|
||||
// it's in the second nested message loop and the reply will *not*
|
||||
// it's in the second nested run loop and the reply will *not*
|
||||
// unblock this loop.
|
||||
// 5. The second loop won't exit until the message loop is complete, but
|
||||
// that can't start until the first one exits.
|
||||
|
@ -197,7 +197,7 @@ class TestCase {
|
||||
// Now give the loop a chance to clean up.
|
||||
loop_.PostQuit(true /* should_destroy */);
|
||||
loop_.Run();
|
||||
// Tell the main thread to quit its nested message loop, now that the test
|
||||
// Tell the main thread to quit its nested run loop, now that the test
|
||||
// is complete.
|
||||
TestCase::QuitMainMessageLoop(instance_);
|
||||
}
|
||||
|
@ -653,7 +653,7 @@ void TestGraphics2D::ResetViewChangedState() {
|
||||
}
|
||||
|
||||
bool TestGraphics2D::WaitUntilViewChanged() {
|
||||
// Run a nested message loop. It will exit either on ViewChanged or if the
|
||||
// Run a nested run loop. It will exit either on ViewChanged or if the
|
||||
// timeout happens.
|
||||
|
||||
// If view changed before we have chance to run message loop, return directly.
|
||||
|
@ -44,14 +44,14 @@ uint16_t GetPort(const pp::NetAddress& addr);
|
||||
// event to complete. For example, you can use it to wait for a callback on a
|
||||
// PPP interface, which will "Signal" the event and make the loop quit.
|
||||
// "Wait()" will return immediately if it has already been signalled. Otherwise,
|
||||
// it will run a nested message loop (using PPB_Testing.RunMessageLoop) and will
|
||||
// it will run a nested run loop (using PPB_Testing.RunMessageLoop) and will
|
||||
// return only after it has been signalled.
|
||||
// Example:
|
||||
// std::string TestFullscreen::TestNormalToFullscreen() {
|
||||
// pp::Fullscreen screen_mode(instance);
|
||||
// screen_mode.SetFullscreen(true);
|
||||
// SimulateUserGesture();
|
||||
// // Let DidChangeView run in a nested message loop.
|
||||
// // Let DidChangeView run in a nested run loop.
|
||||
// nested_event_.Wait();
|
||||
// Pass();
|
||||
// }
|
||||
@ -68,7 +68,7 @@ class NestedEvent {
|
||||
explicit NestedEvent(PP_Instance instance)
|
||||
: instance_(instance), waiting_(false), signalled_(false) {
|
||||
}
|
||||
// Run a nested message loop and wait until Signal() is called. If Signal()
|
||||
// Run a nested run loop and wait until Signal() is called. If Signal()
|
||||
// has already been called, return immediately without running a nested loop.
|
||||
void Wait();
|
||||
// Signal the NestedEvent. If Wait() has been called, quit the message loop.
|
||||
|
@ -46,7 +46,7 @@ void TestView::RunTests(const std::string& filter) {
|
||||
bool TestView::WaitUntilViewChanged() {
|
||||
size_t old_page_visibility_change_count = page_visibility_log_.size();
|
||||
|
||||
// Run a nested message loop. It will exit either on ViewChanged or if the
|
||||
// Run a nested run loop. It will exit either on ViewChanged or if the
|
||||
// timeout happens.
|
||||
post_quit_on_view_changed_ = true;
|
||||
testing_interface_->RunMessageLoop(instance_->pp_instance());
|
||||
|
@ -304,7 +304,7 @@ class WindowServerTest : public WindowServerTestBase {
|
||||
|
||||
std::unique_ptr<ClientAreaChange> WaitForClientAreaToChange() {
|
||||
client_area_change_ = base::MakeUnique<ClientAreaChange>();
|
||||
// The nested message loop is quit in OnWmSetClientArea(). Client area
|
||||
// The nested run loop is quit in OnWmSetClientArea(). Client area
|
||||
// changes don't route through the window, only the WindowManagerDelegate.
|
||||
if (!WindowServerTestBase::DoRunLoopWithTimeout()) {
|
||||
client_area_change_.reset();
|
||||
|
@ -2511,7 +2511,7 @@ void Document::Shutdown() {
|
||||
// since that will cause a situation where LocalFrame still has a Document
|
||||
// attached after this finishes! Normally, it shouldn't actually be possible
|
||||
// to trigger navigation here. However, plugins (see below) can cause lots of
|
||||
// crazy things to happen, since plugin detach involves nested message loops.
|
||||
// crazy things to happen, since plugin detach involves nested run loops.
|
||||
FrameNavigationDisabler navigation_disabler(*frame_);
|
||||
// Defer FrameViewBase updates to avoid plugins trying to run script inside
|
||||
// ScriptForbiddenScope, which will crash the renderer after
|
||||
|
@ -708,7 +708,7 @@ void DocumentLoader::DataReceived(Resource* resource,
|
||||
if (in_data_received_) {
|
||||
// If this function is reentered, defer processing of the additional data to
|
||||
// the top-level invocation. Reentrant calls can occur because of web
|
||||
// platform (mis-)features that require running a nested message loop:
|
||||
// platform (mis-)features that require running a nested run loop:
|
||||
// - alert(), confirm(), prompt()
|
||||
// - Detach of plugin elements.
|
||||
// - Synchronous XMLHTTPRequest
|
||||
|
@ -117,7 +117,7 @@ static Frame* CreateNewWindow(LocalFrame& opener_frame,
|
||||
frame.Loader().ForceSandboxFlags(
|
||||
opener_frame.GetSecurityContext()->GetSandboxFlags());
|
||||
|
||||
// This call may suspend the execution by running nested message loop.
|
||||
// This call may suspend the execution by running nested run loop.
|
||||
probe::windowCreated(&opener_frame, &frame);
|
||||
created = true;
|
||||
return &frame;
|
||||
|
@ -373,7 +373,7 @@ bool DragController::TryDocumentDrag(DragData* drag_data,
|
||||
TryDHTMLDrag(drag_data, drag_session.operation, local_root);
|
||||
// Do not continue if m_documentUnderMouse has been reset by tryDHTMLDrag.
|
||||
// tryDHTMLDrag fires dragenter event. The event listener that listens
|
||||
// to this event may create a nested message loop (open a modal dialog),
|
||||
// to this event may create a nested run loop (open a modal dialog),
|
||||
// which could process dragleave event and reset m_documentUnderMouse in
|
||||
// dragExited.
|
||||
if (!document_under_mouse_)
|
||||
|
@ -12,13 +12,13 @@
|
||||
namespace blink {
|
||||
|
||||
// Similar to ScriptForbiddenScope, but more selective. This is intended to help
|
||||
// reduce the number of places where Flash can run a nested message loop as its
|
||||
// reduce the number of places where Flash can run a nested run loop as its
|
||||
// plugin element is being destroyed. One of the reasons that Flash runs this
|
||||
// nested message loop is to allow Flash content to synchronously script the
|
||||
// nested run loop is to allow Flash content to synchronously script the
|
||||
// page when the plugin element is destroyed.
|
||||
//
|
||||
// This is problematic for many reasons: the DOM may not be in a consistent
|
||||
// state, since Blink is in the middle of detaching nodes, nested message loops
|
||||
// state, since Blink is in the middle of detaching nodes, nested run loops
|
||||
// can cause normally impossible conditions to occur (https://crbug.com/367210),
|
||||
// etc.
|
||||
//
|
||||
@ -35,9 +35,9 @@ namespace blink {
|
||||
//
|
||||
// Unfortunately, there are still ways for plugins to synchronously script
|
||||
// during Document detach: if an unload handler removes a Flash plugin element,
|
||||
// that will run the nested message loop, etc. This scoper is intended to block
|
||||
// that will run the nested run loop, etc. This scoper is intended to block
|
||||
// those usages, with the eventual goal that Frame detach will never have to run
|
||||
// a nested message loop.
|
||||
// a nested run loop.
|
||||
class PLATFORM_EXPORT PluginScriptForbiddenScope final {
|
||||
STACK_ALLOCATED();
|
||||
WTF_MAKE_NONCOPYABLE(PluginScriptForbiddenScope);
|
||||
|
@ -145,7 +145,7 @@ TEST_F(QueueingTimeEstimatorTest,
|
||||
EXPECT_EQ(base::TimeDelta::FromMilliseconds(5500), estimated_queueing_time);
|
||||
}
|
||||
|
||||
// Tasks containing nested message loops may be extremely long without
|
||||
// Tasks containing nested run loops may be extremely long without
|
||||
// negatively impacting user experience. Ignore such tasks.
|
||||
TEST_F(QueueingTimeEstimatorTest, IgnoresTasksWithNestedMessageLoops) {
|
||||
TestQueueingTimeEstimatorClient client;
|
||||
@ -163,7 +163,7 @@ TEST_F(QueueingTimeEstimatorTest, IgnoresTasksWithNestedMessageLoops) {
|
||||
estimator.OnBeginNestedRunLoop();
|
||||
estimator.OnTopLevelTaskCompleted(time);
|
||||
|
||||
// Perform an additional task after the nested message loop. A 1 second task
|
||||
// Perform an additional task after the nested run loop. A 1 second task
|
||||
// in a 5 second window results in a 100ms expected queueing time.
|
||||
estimator.OnTopLevelTaskStarted(time);
|
||||
time += base::TimeDelta::FromMilliseconds(1000);
|
||||
|
@ -173,7 +173,7 @@ void TaskQueueManager::WakeUpReadyDelayedQueues(LazyNow* lazy_now) {
|
||||
}
|
||||
|
||||
void TaskQueueManager::OnBeginNestedRunLoop() {
|
||||
// We just entered a nested message loop, make sure there's a DoWork posted or
|
||||
// We just entered a nested run loop, make sure there's a DoWork posted or
|
||||
// the system will grind to a halt.
|
||||
{
|
||||
base::AutoLock lock(any_thread_lock_);
|
||||
@ -181,7 +181,7 @@ void TaskQueueManager::OnBeginNestedRunLoop() {
|
||||
any_thread().is_nested = true;
|
||||
}
|
||||
|
||||
// When a nested message loop starts, task time observers may want to ignore
|
||||
// When a nested run loop starts, task time observers may want to ignore
|
||||
// the current task.
|
||||
for (auto& observer : task_time_observers_)
|
||||
observer.OnBeginNestedRunLoop();
|
||||
@ -288,7 +288,7 @@ void TaskQueueManager::DoWork(bool delayed) {
|
||||
queues_to_delete_.clear();
|
||||
|
||||
// This must be done before running any tasks because they could invoke a
|
||||
// nested message loop and we risk having a stale |next_delayed_do_work_|.
|
||||
// nested run loop and we risk having a stale |next_delayed_do_work_|.
|
||||
if (delayed)
|
||||
next_delayed_do_work_.Clear();
|
||||
|
||||
|
@ -24,7 +24,7 @@ class PLATFORM_EXPORT TaskQueueManagerDelegate
|
||||
// a nested task).
|
||||
virtual bool IsNested() const = 0;
|
||||
|
||||
// A NestingObserver is notified when a nested message loop begins. The
|
||||
// A NestingObserver is notified when a nested run loop begins. The
|
||||
// observers are notified before the first task is processed.
|
||||
virtual void AddNestingObserver(base::RunLoop::NestingObserver* observer) = 0;
|
||||
|
||||
|
@ -2728,7 +2728,7 @@ void MessageLoopTaskWithImmediateQuit(
|
||||
base::MessageLoop::ScopedNestableTaskAllower allow(message_loop);
|
||||
|
||||
base::RunLoop run_loop;
|
||||
// Needed because entering the nested message loop causes a DoWork to get
|
||||
// Needed because entering the nested run loop causes a DoWork to get
|
||||
// posted.
|
||||
task_queue->PostTask(FROM_HERE, base::Bind(&NopTask));
|
||||
task_queue->PostTask(FROM_HERE, run_loop.QuitClosure());
|
||||
|
@ -32,7 +32,7 @@ class PLATFORM_EXPORT TaskTimeObserver {
|
||||
double start_time,
|
||||
double end_time) = 0;
|
||||
|
||||
// Callback to be called when we enter a nested message loop.
|
||||
// Callback to be called when we enter a nested run loop.
|
||||
virtual void OnBeginNestedRunLoop() = 0;
|
||||
|
||||
private:
|
||||
|
@ -129,7 +129,7 @@ void TouchActionTest::RunTouchActionTest(std::string file) {
|
||||
TouchActionTrackingWebWidgetClient client;
|
||||
|
||||
// runTouchActionTest() loads a document in a frame, setting up a
|
||||
// nested message loop. Should any Oilpan GC happen while it is in
|
||||
// nested run loop. Should any Oilpan GC happen while it is in
|
||||
// effect, the implicit assumption that we're outside any event
|
||||
// loop (=> there being no pointers on the stack needing scanning)
|
||||
// when that GC strikes will no longer hold.
|
||||
|
@ -6949,7 +6949,7 @@ TEST_P(ParameterizedWebFrameTest, DidAccessInitialDocumentBodyBeforeModalDialog)
|
||||
WebScriptSource("window.opener.document.body.innerHTML += 'Modified';"));
|
||||
EXPECT_TRUE(web_frame_client.did_access_initial_document_);
|
||||
|
||||
// Run a modal dialog, which used to run a nested message loop and require
|
||||
// Run a modal dialog, which used to run a nested run loop and require
|
||||
// a special case for notifying about the access.
|
||||
new_view->MainFrame()->ExecuteScript(
|
||||
WebScriptSource("window.opener.confirm('Modal');"));
|
||||
@ -6986,7 +6986,7 @@ TEST_P(ParameterizedWebFrameTest, DidWriteToInitialDocumentBeforeModalDialog)
|
||||
"window.opener.document.close();"));
|
||||
EXPECT_TRUE(web_frame_client.did_access_initial_document_);
|
||||
|
||||
// Run a modal dialog, which used to run a nested message loop and require
|
||||
// Run a modal dialog, which used to run a nested run loop and require
|
||||
// a special case for notifying about the access.
|
||||
new_view->MainFrame()->ExecuteScript(
|
||||
WebScriptSource("window.opener.confirm('Modal');"));
|
||||
|
@ -50,7 +50,7 @@ struct DragDropControllerMus::CurrentDragState {
|
||||
// OSExchangeData supplied to StartDragAndDrop().
|
||||
const ui::OSExchangeData& drag_data;
|
||||
|
||||
// StartDragDrop() runs a nested message loop. This closure is used to quit
|
||||
// StartDragDrop() runs a nested run loop. This closure is used to quit
|
||||
// the run loop when the drag completes.
|
||||
base::Closure runloop_quit_closure;
|
||||
};
|
||||
|
@ -19,7 +19,7 @@ namespace aura {
|
||||
// Env::last_mouse_location() should use
|
||||
// WindowTreeClient::GetCursorScreenPoint(). While processing an event
|
||||
// Env uses the value from the current event, otherwise Env uses
|
||||
// WindowTreeClient::GetCursorScreenPoint(). If a nested message loop is
|
||||
// WindowTreeClient::GetCursorScreenPoint(). If a nested run loop is
|
||||
// started while processing an event Env uses GetCursorScreenPoint().
|
||||
class MusMouseLocationUpdater : public base::RunLoop::NestingObserver {
|
||||
public:
|
||||
|
@ -109,8 +109,8 @@ class EventAckHandler : public base::RunLoop::NestingObserver {
|
||||
|
||||
// base::RunLoop::NestingObserver:
|
||||
void OnBeginNestedRunLoop() override {
|
||||
// Acknowledge the event immediately if a nested message loop starts.
|
||||
// Otherwise we appear unresponsive for the life of the nested message loop.
|
||||
// Acknowledge the event immediately if a nested run loop starts.
|
||||
// Otherwise we appear unresponsive for the life of the nested run loop.
|
||||
if (ack_callback_) {
|
||||
ack_callback_->Run(ui::mojom::EventResult::HANDLED);
|
||||
ack_callback_.reset();
|
||||
|
@ -862,7 +862,7 @@ DispatchDetails WindowEventDispatcher::PreDispatchMouseEvent(
|
||||
return target_details;
|
||||
}
|
||||
// If the |mouse_moved_handler_| changes out from under us, assume a
|
||||
// nested message loop ran and we don't need to do anything.
|
||||
// nested run loop ran and we don't need to do anything.
|
||||
if (mouse_moved_handler_ != old_mouse_moved_handler) {
|
||||
event->SetHandled();
|
||||
return target_details;
|
||||
|
@ -2209,8 +2209,8 @@ TEST_P(WindowEventDispatcherTestInHighDPI, TouchMovesHeldOnScroll) {
|
||||
root_window()->RemovePreTargetHandler(&recorder);
|
||||
}
|
||||
|
||||
// This handler triggers a nested message loop when it receives a right click
|
||||
// event, and runs a single callback in the nested message loop.
|
||||
// This handler triggers a nested run loop when it receives a right click
|
||||
// event, and runs a single callback in the nested run loop.
|
||||
class TriggerNestedLoopOnRightMousePress : public ui::test::TestEventHandler {
|
||||
public:
|
||||
explicit TriggerNestedLoopOnRightMousePress(const base::Closure& callback)
|
||||
@ -2244,8 +2244,8 @@ class TriggerNestedLoopOnRightMousePress : public ui::test::TestEventHandler {
|
||||
DISALLOW_COPY_AND_ASSIGN(TriggerNestedLoopOnRightMousePress);
|
||||
};
|
||||
|
||||
// Tests that if dispatching a 'held' event triggers a nested message loop, then
|
||||
// the events that are dispatched from the nested message loop are transformed
|
||||
// Tests that if dispatching a 'held' event triggers a nested run loop, then
|
||||
// the events that are dispatched from the nested run loop are transformed
|
||||
// correctly.
|
||||
TEST_P(WindowEventDispatcherTestInHighDPI,
|
||||
EventsTransformedInRepostedEventTriggeredNestedLoop) {
|
||||
@ -2911,7 +2911,7 @@ class NestedLocationDelegate : public test::TestWindowDelegate {
|
||||
|
||||
void InRunMessageLoop(base::RunLoop* run_loop) {
|
||||
++nested_message_loop_count_;
|
||||
// Nested message loops trigger falling back to using the location from
|
||||
// nested run loops trigger falling back to using the location from
|
||||
// WindowTreeClient, which is 0,0.
|
||||
EXPECT_EQ(gfx::Point(0, 0), Env::GetInstance()->last_mouse_location());
|
||||
run_loop->Quit();
|
||||
|
@ -265,7 +265,7 @@ class ClipboardAuraX11::AuraX11Details : public PlatformEventDispatcher {
|
||||
//
|
||||
// If the selection holder is us, this call is synchronous and we pull
|
||||
// the data out of |clipboard_selection_| or |primary_selection_|. If the
|
||||
// selection holder is some other window, we spin up a nested message loop
|
||||
// selection holder is some other window, we spin up a nested run loop
|
||||
// and do the asynchronous dance with whatever application is holding the
|
||||
// selection.
|
||||
ui::SelectionData RequestAndWaitForTypes(ClipboardType type,
|
||||
@ -402,7 +402,7 @@ SelectionData ClipboardAuraX11::AuraX11Details::RequestAndWaitForTypes(
|
||||
const std::vector<::Atom>& types) {
|
||||
::Atom selection_name = LookupSelectionForClipboardType(type);
|
||||
if (XGetSelectionOwner(x_display_, selection_name) == x_window_) {
|
||||
// We can local fastpath instead of playing the nested message loop game
|
||||
// We can local fastpath instead of playing the nested run loop game
|
||||
// with the X server.
|
||||
const SelectionFormatMap& format_map = LookupStorageForAtom(selection_name);
|
||||
|
||||
|
@ -113,7 +113,7 @@ bool PreventWindowFromPinning(HWND hwnd) {
|
||||
}
|
||||
|
||||
// TODO(calamity): investigate moving this out of the UI thread as COM
|
||||
// operations may spawn nested message loops which can cause issues.
|
||||
// operations may spawn nested run loops which can cause issues.
|
||||
void SetAppDetailsForWindow(const base::string16& app_id,
|
||||
const base::FilePath& app_icon_path,
|
||||
int app_icon_index,
|
||||
|
@ -38,7 +38,7 @@ class UI_BASE_EXPORT SelectionRequestor {
|
||||
~SelectionRequestor();
|
||||
|
||||
// Does the work of requesting |target| from |selection|, spinning up the
|
||||
// nested message loop, and reading the resulting data back. The result is
|
||||
// nested run loop, and reading the resulting data back. The result is
|
||||
// stored in |out_data|.
|
||||
// |out_data_items| is the length of |out_data| in |out_type| items.
|
||||
bool PerformBlockingConvertSelection(
|
||||
@ -98,7 +98,7 @@ class UI_BASE_EXPORT SelectionRequestor {
|
||||
// The time when the request should be aborted.
|
||||
base::TimeTicks timeout;
|
||||
|
||||
// Called to terminate the nested message loop.
|
||||
// Called to terminate the nested run loop.
|
||||
base::Closure quit_closure;
|
||||
|
||||
// True if the request is complete.
|
||||
|
@ -90,10 +90,10 @@ class EventGeneratorDelegate {
|
||||
//
|
||||
// 1) If your test depends on native events (ui::Event::native_event()).
|
||||
// This return is empty/NULL event with EventGenerator.
|
||||
// 2) If your test involves nested message loop, such as
|
||||
// 2) If your test involves nested run loop, such as
|
||||
// menu or drag & drop. Because this class directly
|
||||
// post an event to WindowEventDispatcher, this event will not be
|
||||
// handled in the nested message loop.
|
||||
// handled in the nested run loop.
|
||||
// 3) Similarly, |base::MessagePumpObserver| will not be invoked.
|
||||
// 4) Any other code that requires native message loops, such as
|
||||
// tests for WindowTreeHostWin/WindowTreeHostX11.
|
||||
|
@ -308,7 +308,7 @@ class VIEWS_EXPORT MenuController
|
||||
// Key processing.
|
||||
void OnKeyDown(ui::KeyboardCode key_code);
|
||||
|
||||
// Creates a MenuController. If |blocking| is true a nested message loop is
|
||||
// Creates a MenuController. If |blocking| is true a nested run loop is
|
||||
// started in |Run|.
|
||||
MenuController(bool blocking,
|
||||
internal::MenuControllerDelegate* delegate);
|
||||
|
@ -153,7 +153,7 @@ class TestEventHandler : public ui::EventHandler {
|
||||
};
|
||||
|
||||
#if defined(USE_AURA)
|
||||
// A DragDropClient which does not trigger a nested message loop. Instead a
|
||||
// A DragDropClient which does not trigger a nested run loop. Instead a
|
||||
// callback is triggered during StartDragAndDrop in order to allow testing.
|
||||
class TestDragDropClient : public aura::client::DragDropClient {
|
||||
public:
|
||||
|
@ -109,7 +109,7 @@ class VIEWS_EXPORT MenuRunner {
|
||||
MenuAnchorPosition anchor,
|
||||
ui::MenuSourceType source_type);
|
||||
|
||||
// Returns true if we're in a nested message loop running the menu.
|
||||
// Returns true if we're in a nested run loop running the menu.
|
||||
bool IsRunning() const;
|
||||
|
||||
// Hides and cancels the menu. This does nothing if the menu is not open.
|
||||
|
@ -209,7 +209,7 @@ class MenuRunnerCocoaTest : public ViewsTestBase,
|
||||
runner_->Cancel();
|
||||
}
|
||||
|
||||
// Run a nested message loop so that async and sync menus can be tested the
|
||||
// Run a nested run loop so that async and sync menus can be tested the
|
||||
// same way.
|
||||
void MaybeRunAsync() {
|
||||
if (!IsAsync())
|
||||
|
@ -47,7 +47,7 @@ void MenuRunnerImpl::Release() {
|
||||
if (delete_after_run_)
|
||||
return; // We already canceled.
|
||||
|
||||
// The menu is running a nested message loop, we can't delete it now
|
||||
// The menu is running a nested run loop, we can't delete it now
|
||||
// otherwise the stack would be in a really bad state (many frames would
|
||||
// have deleted objects on them). Instead cancel the menu, when it returns
|
||||
// Holder will delete itself.
|
||||
|
@ -27,7 +27,7 @@ class MenuRunnerImplInterface {
|
||||
int32_t run_types,
|
||||
const base::Closure& on_menu_closed_callback);
|
||||
|
||||
// Returns true if we're in a nested message loop running the menu.
|
||||
// Returns true if we're in a nested run loop running the menu.
|
||||
virtual bool IsRunning() const = 0;
|
||||
|
||||
// See description above class for details.
|
||||
|
@ -201,7 +201,7 @@ class VIEWS_EXPORT DesktopDragDropClientAuraX11
|
||||
// with alpha > 32).
|
||||
bool IsValidDragImage(const gfx::ImageSkia& image);
|
||||
|
||||
// A nested message loop that notifies this object of events through the
|
||||
// A nested run loop that notifies this object of events through the
|
||||
// X11MoveLoopDelegate interface.
|
||||
std::unique_ptr<X11MoveLoop> move_loop_;
|
||||
|
||||
|
@ -461,7 +461,7 @@ TEST_F(DesktopAuraWidgetTest, TopLevelOwnedPopupRepositionTest) {
|
||||
|
||||
// The following code verifies we can correctly destroy a Widget from a mouse
|
||||
// enter/exit. We could test move/drag/enter/exit but in general we don't run
|
||||
// nested message loops from such events, nor has the code ever really dealt
|
||||
// nested run loops from such events, nor has the code ever really dealt
|
||||
// with this situation.
|
||||
|
||||
// Generates two moves (first generates enter, second real move), a press, drag
|
||||
|
@ -10,13 +10,13 @@
|
||||
|
||||
namespace views {
|
||||
|
||||
// Runs a nested message loop and grabs the mouse. This is used to implement
|
||||
// Runs a nested run loop and grabs the mouse. This is used to implement
|
||||
// dragging.
|
||||
class X11MoveLoop {
|
||||
public:
|
||||
virtual ~X11MoveLoop() {}
|
||||
|
||||
// Runs the nested message loop. While the mouse is grabbed, use |cursor| as
|
||||
// Runs the nested run loop. While the mouse is grabbed, use |cursor| as
|
||||
// the mouse cursor. Returns true if the move-loop is completed successfully.
|
||||
// If the pointer-grab fails, or the move-loop is canceled by the user (e.g.
|
||||
// by pressing escape), then returns false.
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user