Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: chrome/app/client_util.cc

Issue 2844023: Previously we didn't pre-read at all if there was any configuration in the Ch... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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> 5 #include <windows.h>
6 #include <shlwapi.h> 6 #include <shlwapi.h>
7 7
8 #include "chrome/app/breakpad_win.h" 8 #include "chrome/app/breakpad_win.h"
9 #include "chrome/app/client_util.h" 9 #include "chrome/app/client_util.h"
10 #include "chrome/common/chrome_switches.h" 10 #include "chrome/common/chrome_switches.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 // Experimental pre-reading optimization 110 // Experimental pre-reading optimization
111 // The idea is to pre read significant portion of chrome.dll in advance 111 // The idea is to pre read significant portion of chrome.dll in advance
112 // so that subsequent hard page faults are avoided. 112 // so that subsequent hard page faults are avoided.
113 DWORD pre_read_size_mb = 0; 113 DWORD pre_read_size_mb = 0;
114 if (!cmd_line.HasSwitch(switches::kProcessType) && 114 if (!cmd_line.HasSwitch(switches::kProcessType) &&
115 (IsRunningHeadless() || InstallUtil::IsChromeFrameProcess())) { 115 (IsRunningHeadless() || InstallUtil::IsChromeFrameProcess())) {
116 HKEY key = NULL; 116 HKEY key = NULL;
117 if (::RegOpenKeyEx(HKEY_CURRENT_USER, L"Software\\Google\\ChromeFrame", 117 if (::RegOpenKeyEx(HKEY_CURRENT_USER, L"Software\\Google\\ChromeFrame",
118 0, KEY_QUERY_VALUE, &key) == ERROR_SUCCESS) { 118 0, KEY_QUERY_VALUE, &key) == ERROR_SUCCESS) {
119 DWORD unused = sizeof(pre_read_size_mb); 119 DWORD unused = sizeof(pre_read_size_mb);
120 RegQueryValueEx(key, L"PreRead", NULL, NULL, 120 if (::RegQueryValueEx(key, L"PreRead", NULL, NULL,
121 reinterpret_cast<LPBYTE>(&pre_read_size_mb), &unused); 121 reinterpret_cast<LPBYTE>(&pre_read_size_mb),
122 &unused) != ERROR_SUCCESS) {
123 pre_read_size_mb = 16; // Default
124 }
122 RegCloseKey(key); 125 RegCloseKey(key);
123 key = NULL; 126 key = NULL;
124 } else { 127 } else {
125 pre_read_size_mb = 16; // Read in first 16 MB by default. 128 pre_read_size_mb = 16; // Read in first 16 MB by default.
126 } 129 }
127 } 130 }
128 131
129 if (pre_read_size_mb) { 132 if (pre_read_size_mb) {
130 HANDLE chrome_dll = CreateFile(dir->c_str(), 133 HANDLE chrome_dll = CreateFile(dir->c_str(),
131 GENERIC_READ, 134 GENERIC_READ,
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 } 311 }
309 }; 312 };
310 313
311 MainDllLoader* MakeMainDllLoader() { 314 MainDllLoader* MakeMainDllLoader() {
312 #if defined(GOOGLE_CHROME_BUILD) 315 #if defined(GOOGLE_CHROME_BUILD)
313 return new ChromeDllLoader(); 316 return new ChromeDllLoader();
314 #else 317 #else
315 return new ChromiumDllLoader(); 318 return new ChromiumDllLoader();
316 #endif 319 #endif
317 } 320 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698