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

Unified Diff: Source/modules/gamepad/WebKitGamepadList.h

Issue 195993007: Factor out GamepadCommon base class from Gamepad and WebKitGamepad (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add ABC FIXME Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: Source/modules/gamepad/WebKitGamepadList.h
diff --git a/Source/modules/gamepad/WebKitGamepadList.h b/Source/modules/gamepad/WebKitGamepadList.h
index 574998ebdd6c65ed45ea86b2642878618ef07832..9651d4dd6d7bd58c83c3ac64ff55603c5e387bc0 100644
--- a/Source/modules/gamepad/WebKitGamepadList.h
+++ b/Source/modules/gamepad/WebKitGamepadList.h
@@ -6,29 +6,26 @@
#define WebKitGamepadList_h
#include "bindings/v8/ScriptWrappable.h"
-#include "heap/Handle.h"
+#include "modules/gamepad/GamepadList.h"
#include "modules/gamepad/WebKitGamepad.h"
-#include "public/platform/WebGamepads.h"
#include "wtf/PassRefPtr.h"
-#include "wtf/RefCounted.h"
-#include "wtf/Vector.h"
namespace WebCore {
-class WebKitGamepadList : public RefCountedWillBeGarbageCollectedFinalized<WebKitGamepadList>, public ScriptWrappable {
+// Inherit from concrete GamepadList class (instead of factoring out an abstract
+// GamepadListCommon class) so GamepadList is simple (unfactored) and low-cruft.
+class WebKitGamepadList : public GamepadList {
public:
static PassRefPtrWillBeRawPtr<WebKitGamepadList> create() { return adoptRefWillBeNoop(new WebKitGamepadList); }
- ~WebKitGamepadList();
void set(unsigned index, PassRefPtrWillBeRawPtr<WebKitGamepad>);
WebKitGamepad* item(unsigned index);
- unsigned length() const;
-
- void trace(Visitor*);
haraken 2014/03/13 07:08:50 As I commented, please keep the trace() method and
Nils Barth (inactive) 2014/03/13 07:36:14 Got it.
private:
WebKitGamepadList()
{
+ // FIXME: don't call ScriptWrappable::init twice
+ // Instead, factor out a base class GamepadListCommon
ScriptWrappable::init(this);
}

Powered by Google App Engine
This is Rietveld 408576698