summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorIlia Kirianovskii <ilia.kirianovskii@lgepartner.com>2016-02-15 08:02:28 +0300
committerIlia Kirianovskii <ilia.kirianovskii@lgepartner.com>2016-03-10 13:04:02 +0000
commit623faac123fbabab5e12cbb6505178586172bdba (patch)
tree76d0083b81e73458f29780eebcf44427e1ebc010 /src/core
parent01568d42ca08d23528637ee906765b18e0f2b941 (diff)
Initialize lazy base::CPU when IO are allowed
We should initialize base::CPU to get it a chance to read /proc/cpuinfo when IO operations are allowed. So it prevents the following error on ARM platform: ``` [0204/071425:FATAL:thread_restrictions.cc(38)] Function marked as IO-only was called from a thread that disallows IO! If this thread really should be allowed to make IO calls, adjust the call to base::ThreadRestrictions::SetIOAllowed() in this thread's startup. ``` In the same manner it is done in ChromeMainDelegate::PreSandboxStartup. Change-Id: I1facd9d856a8dbfdf03ddbb1ab8d76d2efe69050 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Diffstat (limited to 'src/core')
-rw-r--r--src/core/content_main_delegate_qt.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/core/content_main_delegate_qt.cpp b/src/core/content_main_delegate_qt.cpp
index 0a7233853..e142436bc 100644
--- a/src/core/content_main_delegate_qt.cpp
+++ b/src/core/content_main_delegate_qt.cpp
@@ -52,6 +52,10 @@
#include "renderer/content_renderer_client_qt.h"
#include "web_engine_library_info.h"
+#if defined(ARCH_CPU_ARM_FAMILY) && (defined(OS_ANDROID) || defined(OS_LINUX))
+#include "base/cpu.h"
+#endif
+
#include <QLocale>
namespace QtWebEngineCore {
@@ -66,6 +70,12 @@ static base::StringPiece PlatformResourceProvider(int key) {
void ContentMainDelegateQt::PreSandboxStartup()
{
+#if defined(ARCH_CPU_ARM_FAMILY) && (defined(OS_ANDROID) || defined(OS_LINUX))
+ // Create an instance of the CPU class to parse /proc/cpuinfo and cache
+ // cpu_brand info.
+ base::CPU cpu_info;
+#endif
+
net::NetModule::SetResourceProvider(PlatformResourceProvider);
ui::ResourceBundle::InitSharedInstanceWithLocale(WebEngineLibraryInfo::getApplicationLocale(), 0, ui::ResourceBundle::LOAD_COMMON_RESOURCES);