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

Side by Side Diff: chrome_elf/blacklist/blacklist.cc

Issue 154653002: Breakpad coverage for chrome_elf start up (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments and catch crashes in blacklist intercept code Created 6 years, 10 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome_elf/blacklist/blacklist.h" 5 #include "chrome_elf/blacklist/blacklist.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "chrome_elf/blacklist/blacklist_interceptions.h" 10 #include "chrome_elf/blacklist/blacklist_interceptions.h"
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 delete[] g_troublesome_dlls[i]; 293 delete[] g_troublesome_dlls[i];
294 g_troublesome_dlls[i] = g_troublesome_dlls[blacklist_size - 1]; 294 g_troublesome_dlls[i] = g_troublesome_dlls[blacklist_size - 1];
295 g_troublesome_dlls[blacklist_size - 1] = NULL; 295 g_troublesome_dlls[blacklist_size - 1] = NULL;
296 return true; 296 return true;
297 } 297 }
298 } 298 }
299 return false; 299 return false;
300 } 300 }
301 301
302 bool Initialize(bool force) { 302 bool Initialize(bool force) {
303
robertshield 2014/02/10 18:43:14 nit: remove blank line
Cait (Slow) 2014/02/12 19:15:41 Done.
303 // Check to see that we found the functions we need in ntdll. 304 // Check to see that we found the functions we need in ntdll.
304 if (!InitializeInterceptImports()) 305 if (!InitializeInterceptImports())
305 return false; 306 return false;
306 307
307 // Check to see if this is a non-browser process, abort if so. 308 // Check to see if this is a non-browser process, abort if so.
308 if (IsNonBrowserProcess()) 309 if (IsNonBrowserProcess())
309 return false; 310 return false;
310 311
311 // Check to see if a beacon is present, abort if so. 312 // Check to see if a beacon is present, abort if so.
312 if (!force && !LeaveSetupBeacon()) 313 if (!force && !LeaveSetupBeacon())
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 sizeof(sandbox::ThunkData), 418 sizeof(sandbox::ThunkData),
418 NULL); 419 NULL);
419 #endif 420 #endif
420 delete thunk; 421 delete thunk;
421 422
422 // Mark the thunk storage as executable and prevent any future writes to it. 423 // Mark the thunk storage as executable and prevent any future writes to it.
423 page_executable = page_executable && VirtualProtect(&g_thunk_storage, 424 page_executable = page_executable && VirtualProtect(&g_thunk_storage,
424 sizeof(g_thunk_storage), 425 sizeof(g_thunk_storage),
425 PAGE_EXECUTE_READ, 426 PAGE_EXECUTE_READ,
426 &old_protect); 427 &old_protect);
427
428 RecordSuccessfulThunkSetup(&key); 428 RecordSuccessfulThunkSetup(&key);
429 429
430 return NT_SUCCESS(ret) && page_executable; 430 return NT_SUCCESS(ret) && page_executable;
431 } 431 }
432 432
433 } // namespace blacklist 433 } // namespace blacklist
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698