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

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

Issue 2562323002: Devirtualize Frame::domWindow(). (Closed)
Patch Set: Created 4 years 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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 m_dispatchOneEventRunner->runAsync(); 167 m_dispatchOneEventRunner->runAsync();
168 } 168 }
169 169
170 NavigatorGamepad::NavigatorGamepad(LocalFrame* frame) 170 NavigatorGamepad::NavigatorGamepad(LocalFrame* frame)
171 : ContextLifecycleObserver(frame->document()), 171 : ContextLifecycleObserver(frame->document()),
172 PlatformEventController(frame ? frame->page() : 0), 172 PlatformEventController(frame ? frame->page() : 0),
173 m_dispatchOneEventRunner(AsyncMethodRunner<NavigatorGamepad>::create( 173 m_dispatchOneEventRunner(AsyncMethodRunner<NavigatorGamepad>::create(
174 this, 174 this,
175 &NavigatorGamepad::dispatchOneEvent)) { 175 &NavigatorGamepad::dispatchOneEvent)) {
176 if (frame) 176 if (frame)
177 frame->localDOMWindow()->registerEventListenerObserver(this); 177 frame->domWindow()->registerEventListenerObserver(this);
178 } 178 }
179 179
180 NavigatorGamepad::~NavigatorGamepad() {} 180 NavigatorGamepad::~NavigatorGamepad() {}
181 181
182 const char* NavigatorGamepad::supplementName() { 182 const char* NavigatorGamepad::supplementName() {
183 return "NavigatorGamepad"; 183 return "NavigatorGamepad";
184 } 184 }
185 185
186 void NavigatorGamepad::contextDestroyed() { 186 void NavigatorGamepad::contextDestroyed() {
187 stopUpdating(); 187 stopUpdating();
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 if (connectedGamepadChanged || (!oldWasConnected && newIsConnected)) { 267 if (connectedGamepadChanged || (!oldWasConnected && newIsConnected)) {
268 m_pendingEvents.append(newGamepad); 268 m_pendingEvents.append(newGamepad);
269 } 269 }
270 } 270 }
271 271
272 if (!m_pendingEvents.isEmpty()) 272 if (!m_pendingEvents.isEmpty())
273 m_dispatchOneEventRunner->runAsync(); 273 m_dispatchOneEventRunner->runAsync();
274 } 274 }
275 275
276 } // namespace blink 276 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698