From 5b4f81709e8df8d953e2ad8496996fb0112b6186 Mon Sep 17 00:00:00 2001 From: Steve Block Date: Wed, 25 Nov 2009 11:14:04 +0000 Subject: Fixes use of statics of non-built-in types in Geolocation. The Mac build requires that only built-in types are used as statics. Change-Id: I69a3f063c5728d76a13f73b8b056187d5678e0ab --- WebCore/page/Geolocation.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'WebCore/page') diff --git a/WebCore/page/Geolocation.cpp b/WebCore/page/Geolocation.cpp index 556d22c..e0352dd 100644 --- a/WebCore/page/Geolocation.cpp +++ b/WebCore/page/Geolocation.cpp @@ -178,7 +178,9 @@ class CachedPositionManager { } static void setDatabasePath(String databasePath) { - s_databaseFile = databasePath + databaseName; + if (!s_databaseFile) + s_databaseFile = new String; + *s_databaseFile = 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 == 0) @@ -189,7 +191,7 @@ class CachedPositionManager { static PassRefPtr readFromDB() { SQLiteDatabase database; - if (!database.open(s_databaseFile)) + if (!s_databaseFile || !database.open(*s_databaseFile)) return 0; // Create the table here, such that even if we've just created the @@ -230,7 +232,7 @@ class CachedPositionManager { ASSERT(position); SQLiteDatabase database; - if (!database.open(s_databaseFile)) + if (!s_databaseFile || !database.open(*s_databaseFile)) return; SQLiteTransaction transaction(database); @@ -278,12 +280,12 @@ class CachedPositionManager { } static int s_instances; static RefPtr* s_cachedPosition; - static String s_databaseFile; + static String* s_databaseFile; }; int CachedPositionManager::s_instances = 0; RefPtr* CachedPositionManager::s_cachedPosition; -String CachedPositionManager::s_databaseFile; +String* CachedPositionManager::s_databaseFile = 0; Geolocation::Geolocation(Frame* frame) -- cgit v1.1