summaryrefslogtreecommitdiffstats
path: root/WebCore
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-02-11 17:28:32 +0000
committerSteve Block <steveblock@google.com>2010-02-23 12:01:53 +0000
commit602f856d9f84c00d87576a9d5314f42a695d9850 (patch)
tree58f580091a1ad2cb877e6b9cc31f0f878777504e /WebCore
parent41084a8fbaa3b6914ecfb085be8a9f32bebfb55b (diff)
downloadexternal_webkit-602f856d9f84c00d87576a9d5314f42a695d9850.zip
external_webkit-602f856d9f84c00d87576a9d5314f42a695d9850.tar.gz
external_webkit-602f856d9f84c00d87576a9d5314f42a695d9850.tar.bz2
Updates Android to final version of Geolocation position cache submitted to webkit.org
See http://trac.webkit.org/changeset/55142 Change-Id: I8fabc89b596b0e61e8ae389e07af2e898de3bad1
Diffstat (limited to 'WebCore')
-rw-r--r--WebCore/page/GeolocationPositionCache.cpp18
-rw-r--r--WebCore/page/GeolocationPositionCache.h4
2 files changed, 11 insertions, 11 deletions
diff --git a/WebCore/page/GeolocationPositionCache.cpp b/WebCore/page/GeolocationPositionCache.cpp
index 7bc361a..5796191 100644
--- a/WebCore/page/GeolocationPositionCache.cpp
+++ b/WebCore/page/GeolocationPositionCache.cpp
@@ -29,13 +29,14 @@
#include "Geoposition.h"
#include "SQLValue.h"
#include "SQLiteDatabase.h"
+#include "SQLiteFileSystem.h"
#include "SQLiteStatement.h"
#include "SQLiteTransaction.h"
namespace WebCore {
-static const char* databaseName = "/CachedPosition.db";
+static const char* databaseName = "CachedGeoposition.db";
int GeolocationPositionCache::s_instances = 0;
RefPtr<Geoposition>* GeolocationPositionCache::s_cachedPosition;
@@ -60,7 +61,6 @@ GeolocationPositionCache::~GeolocationPositionCache()
void GeolocationPositionCache::setCachedPosition(Geoposition* cachedPosition)
{
- // We do not take owenership from the caller, but add our own ref count.
*s_cachedPosition = cachedPosition;
}
@@ -69,11 +69,11 @@ Geoposition* GeolocationPositionCache::cachedPosition()
return s_cachedPosition->get();
}
-void GeolocationPositionCache::setDatabasePath(String databasePath)
+void GeolocationPositionCache::setDatabasePath(const String& databasePath)
{
if (!s_databaseFile)
s_databaseFile = new String;
- *s_databaseFile = databasePath + databaseName;
+ *s_databaseFile = SQLiteFileSystem::appendDatabaseFileNameToPath(databasePath, databaseName);
// If we don't have have a cached position, attempt to read one from the
// DB at the new path.
if (s_instances && !(*s_cachedPosition))
@@ -110,17 +110,17 @@ PassRefPtr<Geoposition> GeolocationPositionCache::readFromDB()
bool providesAltitudeAccuracy = statement.getColumnValue(4).type() != SQLValue::NullValue;
bool providesHeading = statement.getColumnValue(5).type() != SQLValue::NullValue;
bool providesSpeed = statement.getColumnValue(6).type() != SQLValue::NullValue;
- RefPtr<Coordinates> coordinates = Coordinates::create(statement.getColumnDouble(0), // latitude
- statement.getColumnDouble(1), // longitude
+ RefPtr<Coordinates> coordinates = Coordinates::create(statement.getColumnDouble(0), // latitude
+ statement.getColumnDouble(1), // longitude
providesAltitude, statement.getColumnDouble(2), // altitude
- statement.getColumnDouble(3), // accuracy
+ statement.getColumnDouble(3), // accuracy
providesAltitudeAccuracy, statement.getColumnDouble(4), // altitudeAccuracy
providesHeading, statement.getColumnDouble(5), // heading
providesSpeed, statement.getColumnDouble(6)); // speed
- return Geoposition::create(coordinates.release(), statement.getColumnInt64(7)); // timestamp
+ return Geoposition::create(coordinates.release(), statement.getColumnInt64(7)); // timestamp
}
-void GeolocationPositionCache::writeToDB(Geoposition* position)
+void GeolocationPositionCache::writeToDB(const Geoposition* position)
{
ASSERT(position);
diff --git a/WebCore/page/GeolocationPositionCache.h b/WebCore/page/GeolocationPositionCache.h
index 2dcfc57..c7f7e49 100644
--- a/WebCore/page/GeolocationPositionCache.h
+++ b/WebCore/page/GeolocationPositionCache.h
@@ -42,11 +42,11 @@ class GeolocationPositionCache {
void setCachedPosition(Geoposition*);
Geoposition* cachedPosition();
- static void setDatabasePath(String);
+ static void setDatabasePath(const String&);
private:
static PassRefPtr<Geoposition> readFromDB();
- static void writeToDB(Geoposition*);
+ static void writeToDB(const Geoposition*);
static int s_instances;
static RefPtr<Geoposition>* s_cachedPosition;