summaryrefslogtreecommitdiffstats
path: root/src/core/web_engine_library_info.cpp
diff options
context:
space:
mode:
authorAndras Becsi <andras.becsi@digia.com>2014-02-13 12:13:15 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-13 14:28:04 +0100
commit514b9f71de89a14401e305f32c61fbad5759e5f2 (patch)
treeb28a799abaf06ac6eeaf7cb1de6c640fdda4d26f /src/core/web_engine_library_info.cpp
parent33237bd32f13fbabb7be248a1d46323c89edf57c (diff)
Fix path service assertions
Registering a path provider did not turn out to be a clean enough solution for overriding chromium paths because of debug assertions that require the key range not to collide with already registered path providers. Instead of patching chromium or using workarounds switch back to using PathService::Override and only replace the jni-based default PathProviderAndroid on embedded android. Change-Id: I4530bc8fa3eba36c0d2403729be9a792f3c2120f Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'src/core/web_engine_library_info.cpp')
-rw-r--r--src/core/web_engine_library_info.cpp28
1 files changed, 12 insertions, 16 deletions
diff --git a/src/core/web_engine_library_info.cpp b/src/core/web_engine_library_info.cpp
index 40cd7a1b7..67a466c90 100644
--- a/src/core/web_engine_library_info.cpp
+++ b/src/core/web_engine_library_info.cpp
@@ -138,31 +138,30 @@ namespace base {
// PathService registers PathProviderAndroid by default on Android.
bool PathProviderAndroid(int key, FilePath* result)
{
- return WebEngineLibraryInfo::pathProviderQt(key, result);
+ *result = WebEngineLibraryInfo::getPath(key);
+ return !(result->empty());
}
}
#endif // defined(OS_ANDROID)
-base::FilePath WebEngineLibraryInfo::repackedResourcesPath()
-{
- return toFilePath(location(QLibraryInfo::DataPath) % QStringLiteral("/qtwebengine_resources.pak"));
-}
-
-bool WebEngineLibraryInfo::pathProviderQt(int key, base::FilePath* result)
+base::FilePath WebEngineLibraryInfo::getPath(int key)
{
QString directory;
switch (key) {
+ case QT_RESOURCES_PAK:
+ return toFilePath(location(QLibraryInfo::DataPath) % QStringLiteral("/qtwebengine_resources.pak"));
case base::FILE_EXE:
case content::CHILD_PROCESS_EXE:
- *result = toFilePath(subProcessPath());
- return true;
+ return toFilePath(subProcessPath());
+#if defined(OS_POSIX)
case base::DIR_CACHE:
directory = QStandardPaths::writableLocation(QStandardPaths::CacheLocation);
break;
case base::DIR_HOME:
directory = QDir::homePath();
break;
+#endif
case base::DIR_USER_DESKTOP:
directory = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);
break;
@@ -174,18 +173,15 @@ bool WebEngineLibraryInfo::pathProviderQt(int key, base::FilePath* result)
break;
#endif
case content::DIR_MEDIA_LIBS:
- *result = toFilePath(pluginsPath());
- return true;
+ return toFilePath(pluginsPath());
case ui::DIR_LOCALES:
- *result = toFilePath(localesPath());
- return true;
+ return toFilePath(localesPath());
default:
// Note: the path system expects this function to override the default
// behavior. So no need to log an error if we don't support a given
// path. The system will just use the default.
- return false;
+ return base::FilePath();
}
- *result = toFilePath(directory.isEmpty() ? fallbackDir() : directory);
- return true;
+ return toFilePath(directory.isEmpty() ? fallbackDir() : directory);
}