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

Unified Diff: Source/modules/gamepad/GamepadCommon.cpp

Issue 195993007: Factor out GamepadCommon base class from Gamepad and WebKitGamepad (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove excess header 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
« no previous file with comments | « Source/modules/gamepad/GamepadCommon.h ('k') | Source/modules/gamepad/GamepadList.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/gamepad/GamepadCommon.cpp
diff --git a/Source/core/css/DocumentFontFaceSet.cpp b/Source/modules/gamepad/GamepadCommon.cpp
similarity index 78%
copy from Source/core/css/DocumentFontFaceSet.cpp
copy to Source/modules/gamepad/GamepadCommon.cpp
index a5952c64b271f9d5cc186f1a38b1298b202676de..bab5498cce811152f829b12ba94ade8b99e8e00c 100644
--- a/Source/core/css/DocumentFontFaceSet.cpp
+++ b/Source/modules/gamepad/GamepadCommon.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013, Google Inc. All rights reserved.
+ * Copyright (C) 2011, Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -24,15 +24,25 @@
*/
#include "config.h"
-#include "core/css/DocumentFontFaceSet.h"
-
-#include "core/css/FontFaceSet.h"
+#include "modules/gamepad/GamepadCommon.h"
namespace WebCore {
-PassRefPtr<FontFaceSet> DocumentFontFaceSet::fonts(Document& document)
+GamepadCommon::GamepadCommon()
+ : m_index(0)
+ , m_timestamp(0)
+{
+}
+
+GamepadCommon::~GamepadCommon()
+{
+}
+
+void GamepadCommon::setAxes(unsigned count, const float* data)
{
- return FontFaceSet::from(document);
+ m_axes.resize(count);
+ if (count)
+ std::copy(data, data + count, m_axes.begin());
}
} // namespace WebCore
« no previous file with comments | « Source/modules/gamepad/GamepadCommon.h ('k') | Source/modules/gamepad/GamepadList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698