| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <windows.h> // NOLINT | 5 #include <windows.h> // NOLINT |
| 6 #include <shlwapi.h> // NOLINT | 6 #include <shlwapi.h> // NOLINT |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <userenv.h> // NOLINT | 8 #include <userenv.h> // NOLINT |
| 9 | 9 |
| 10 #include "chrome/app/main_dll_loader_win.h" | 10 #include "chrome/app/main_dll_loader_win.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 // Loads |module| after setting the CWD to |module|'s directory. Returns a | 61 // Loads |module| after setting the CWD to |module|'s directory. Returns a |
| 62 // reference to the loaded module on success, or null on error. | 62 // reference to the loaded module on success, or null on error. |
| 63 HMODULE LoadModuleWithDirectory(const base::FilePath& module) { | 63 HMODULE LoadModuleWithDirectory(const base::FilePath& module) { |
| 64 ::SetCurrentDirectoryW(module.DirName().value().c_str()); | 64 ::SetCurrentDirectoryW(module.DirName().value().c_str()); |
| 65 | 65 |
| 66 // Get pre-read options from the PreRead field trial. | 66 // Get pre-read options from the PreRead field trial. |
| 67 bool trial_no_pre_read = false; | 67 bool trial_no_pre_read = false; |
| 68 bool trial_high_priority = false; | 68 bool trial_high_priority = false; |
| 69 bool trial_only_if_cold = false; | 69 bool trial_only_if_cold = false; |
| 70 bool trial_prefetch_virtual_memory = false; | 70 bool trial_prefetch_virtual_memory = false; |
| 71 bool ignored; |
| 71 startup_metric_utils::GetPreReadOptions( | 72 startup_metric_utils::GetPreReadOptions( |
| 72 BrowserDistribution::GetDistribution()->GetRegistryPath(), | 73 BrowserDistribution::GetDistribution()->GetRegistryPath(), |
| 73 &trial_no_pre_read, &trial_high_priority, &trial_only_if_cold, | 74 &trial_no_pre_read, &trial_high_priority, &trial_only_if_cold, |
| 74 &trial_prefetch_virtual_memory); | 75 &trial_prefetch_virtual_memory, &ignored); |
| 75 | 76 |
| 76 // Pre-read the binary to warm the memory caches (avoids a lot of random IO). | 77 // Pre-read the binary to warm the memory caches (avoids a lot of random IO). |
| 77 if (!trial_no_pre_read) { | 78 if (!trial_no_pre_read) { |
| 78 base::ThreadPriority previous_priority = base::ThreadPriority::NORMAL; | 79 base::ThreadPriority previous_priority = base::ThreadPriority::NORMAL; |
| 79 if (trial_high_priority) { | 80 if (trial_high_priority) { |
| 80 previous_priority = base::PlatformThread::GetCurrentThreadPriority(); | 81 previous_priority = base::PlatformThread::GetCurrentThreadPriority(); |
| 81 base::PlatformThread::SetCurrentThreadPriority( | 82 base::PlatformThread::SetCurrentThreadPriority( |
| 82 base::ThreadPriority::DISPLAY); | 83 base::ThreadPriority::DISPLAY); |
| 83 } | 84 } |
| 84 | 85 |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 } | 391 } |
| 391 }; | 392 }; |
| 392 | 393 |
| 393 MainDllLoader* MakeMainDllLoader() { | 394 MainDllLoader* MakeMainDllLoader() { |
| 394 #if defined(GOOGLE_CHROME_BUILD) | 395 #if defined(GOOGLE_CHROME_BUILD) |
| 395 return new ChromeDllLoader(); | 396 return new ChromeDllLoader(); |
| 396 #else | 397 #else |
| 397 return new ChromiumDllLoader(); | 398 return new ChromiumDllLoader(); |
| 398 #endif | 399 #endif |
| 399 } | 400 } |
| OLD | NEW |