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

Side by Side Diff: third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.cpp

Issue 2433773006: Remove ExecutionContext::activeDOMObjectsAreStopped()
Patch Set: Created 4 years, 2 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) 2011, Google Inc. All rights reserved. 2 * Copyright (C) 2011, Google 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 are met: 5 * modification, are permitted provided that the following conditions are met:
6 * 6 *
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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 // We should stop listening once we detached. 123 // We should stop listening once we detached.
124 Document* document = static_cast<Document*>(getExecutionContext()); 124 Document* document = static_cast<Document*>(getExecutionContext());
125 DCHECK(document->frame()); 125 DCHECK(document->frame());
126 DCHECK(document->frame()->domWindow()); 126 DCHECK(document->frame()->domWindow());
127 127
128 // We register to the dispatcher before sampling gamepads so we need to check 128 // We register to the dispatcher before sampling gamepads so we need to check
129 // if we actually have an event listener. 129 // if we actually have an event listener.
130 if (!m_hasEventListener) 130 if (!m_hasEventListener)
131 return; 131 return;
132 132
133 if (document->activeDOMObjectsAreStopped() || 133 if (document->activeDOMObjectsAreSuspended())
134 document->activeDOMObjectsAreSuspended())
135 return; 134 return;
136 135
137 const GamepadDispatcher::ConnectionChange& change = 136 const GamepadDispatcher::ConnectionChange& change =
138 GamepadDispatcher::instance().latestConnectionChange(); 137 GamepadDispatcher::instance().latestConnectionChange();
139 138
140 if (!m_gamepads) 139 if (!m_gamepads)
141 m_gamepads = GamepadList::create(); 140 m_gamepads = GamepadList::create();
142 141
143 Gamepad* gamepad = m_gamepads->item(change.index); 142 Gamepad* gamepad = m_gamepads->item(change.index);
144 if (!gamepad) 143 if (!gamepad)
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 if (connectedGamepadChanged || (!oldWasConnected && newIsConnected)) { 266 if (connectedGamepadChanged || (!oldWasConnected && newIsConnected)) {
268 m_pendingEvents.append(newGamepad); 267 m_pendingEvents.append(newGamepad);
269 } 268 }
270 } 269 }
271 270
272 if (!m_pendingEvents.isEmpty()) 271 if (!m_pendingEvents.isEmpty())
273 m_dispatchOneEventRunner->runAsync(); 272 m_dispatchOneEventRunner->runAsync();
274 } 273 }
275 274
276 } // namespace blink 275 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698