OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chromecast/browser/cast_browser_main_parts.h" | 5 #include "chromecast/browser/cast_browser_main_parts.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 // Also, implicit initialization can cause a long delay on the first | 292 // Also, implicit initialization can cause a long delay on the first |
293 // rendering if the font cache has to be regenerated for some reason. Doing it | 293 // rendering if the font cache has to be regenerated for some reason. Doing it |
294 // explicitly here helps in cases where the browser process is starting up in | 294 // explicitly here helps in cases where the browser process is starting up in |
295 // the background (resources have not yet been granted to cast) since it | 295 // the background (resources have not yet been granted to cast) since it |
296 // prevents the long delay the user would have seen on first rendering. Note | 296 // prevents the long delay the user would have seen on first rendering. Note |
297 // that future calls to FcInit() are safe no-ops per the FontConfig interface. | 297 // that future calls to FcInit() are safe no-ops per the FontConfig interface. |
298 FcInit(); | 298 FcInit(); |
299 #endif | 299 #endif |
300 } | 300 } |
301 | 301 |
302 int CastBrowserMainParts::PreCreateThreads() { | 302 int CastBrowserMainParts::PreCreateThreadsBegin() { |
303 #if defined(OS_ANDROID) | 303 #if defined(OS_ANDROID) |
304 // GPU process is started immediately after threads are created, requiring | 304 // GPU process is started immediately after threads are created, requiring |
305 // CrashDumpManager to be initialized beforehand. | 305 // CrashDumpManager to be initialized beforehand. |
306 base::FilePath crash_dumps_dir; | 306 base::FilePath crash_dumps_dir; |
307 if (!chromecast::CrashHandler::GetCrashDumpLocation(&crash_dumps_dir)) { | 307 if (!chromecast::CrashHandler::GetCrashDumpLocation(&crash_dumps_dir)) { |
308 LOG(ERROR) << "Could not find crash dump location."; | 308 LOG(ERROR) << "Could not find crash dump location."; |
309 } | 309 } |
310 cast_browser_process_->SetCrashDumpManager( | 310 cast_browser_process_->SetCrashDumpManager( |
311 make_scoped_ptr(new breakpad::CrashDumpManager(crash_dumps_dir))); | 311 make_scoped_ptr(new breakpad::CrashDumpManager(crash_dumps_dir))); |
312 #else | 312 #else |
(...skipping 20 matching lines...) Expand all Loading... |
333 content::ChildProcessSecurityPolicy::GetInstance()->RegisterWebSafeScheme( | 333 content::ChildProcessSecurityPolicy::GetInstance()->RegisterWebSafeScheme( |
334 kChromeResourceScheme); | 334 kChromeResourceScheme); |
335 return 0; | 335 return 0; |
336 } | 336 } |
337 | 337 |
338 void CastBrowserMainParts::PreMainMessageLoopRun() { | 338 void CastBrowserMainParts::PreMainMessageLoopRun() { |
339 #if !defined(OS_ANDROID) | 339 #if !defined(OS_ANDROID) |
340 // Set GL strings so GPU config code can make correct feature blacklisting/ | 340 // Set GL strings so GPU config code can make correct feature blacklisting/ |
341 // whitelisting decisions. | 341 // whitelisting decisions. |
342 // Note: SetGLStrings MUST be called after GpuDataManager::Initialize. | 342 // Note: SetGLStrings MUST be called after GpuDataManager::Initialize. |
| 343 // TODO(j.isorce) move SetGLStrings call to PreCreateThreadsEnd, i.e. before |
| 344 // launching the gpu process. |
343 scoped_ptr<CastSysInfo> sys_info = CreateSysInfo(); | 345 scoped_ptr<CastSysInfo> sys_info = CreateSysInfo(); |
344 content::GpuDataManager::GetInstance()->SetGLStrings( | 346 content::GpuDataManager::GetInstance()->SetGLStrings( |
345 sys_info->GetGlVendor(), sys_info->GetGlRenderer(), | 347 sys_info->GetGlVendor(), sys_info->GetGlRenderer(), |
346 sys_info->GetGlVersion()); | 348 sys_info->GetGlVersion()); |
347 #endif // !defined(OS_ANDROID) | 349 #endif // !defined(OS_ANDROID) |
348 | 350 |
349 scoped_refptr<PrefRegistrySimple> pref_registry(new PrefRegistrySimple()); | 351 scoped_refptr<PrefRegistrySimple> pref_registry(new PrefRegistrySimple()); |
350 metrics::RegisterPrefs(pref_registry.get()); | 352 metrics::RegisterPrefs(pref_registry.get()); |
351 cast_browser_process_->SetPrefService( | 353 cast_browser_process_->SetPrefService( |
352 PrefServiceHelper::CreatePrefService(pref_registry.get())); | 354 PrefServiceHelper::CreatePrefService(pref_registry.get())); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 #if defined(USE_AURA) | 453 #if defined(USE_AURA) |
452 aura::Env::DeleteInstance(); | 454 aura::Env::DeleteInstance(); |
453 #endif | 455 #endif |
454 | 456 |
455 DeregisterKillOnAlarm(); | 457 DeregisterKillOnAlarm(); |
456 #endif | 458 #endif |
457 } | 459 } |
458 | 460 |
459 } // namespace shell | 461 } // namespace shell |
460 } // namespace chromecast | 462 } // namespace chromecast |
OLD | NEW |