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

Side by Side Diff: content/app/content_main.cc

Issue 7857036: Fix use-after-free of command line data on Linux/CrOS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix typo Created 9 years, 3 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "content/app/content_main.h" 5 #include "content/app/content_main.h"
6 6
7 #include "base/at_exit.h" 7 #include "base/at_exit.h"
8 #include "base/base_switches.h" 8 #include "base/base_switches.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/debugger.h" 10 #include "base/debug/debugger.h"
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 // Get the new process type from the new command line. 256 // Get the new process type from the new command line.
257 std::string process_type = 257 std::string process_type =
258 command_line.GetSwitchValueASCII(switches::kProcessType); 258 command_line.GetSwitchValueASCII(switches::kProcessType);
259 259
260 for (size_t i = 0; i < arraysize(kMainFunctions); ++i) { 260 for (size_t i = 0; i < arraysize(kMainFunctions); ++i) {
261 if (process_type == kMainFunctions[i].name) 261 if (process_type == kMainFunctions[i].name)
262 return kMainFunctions[i].function(main_params); 262 return kMainFunctions[i].function(main_params);
263 } 263 }
264 264
265 if (delegate) 265 if (delegate)
266 return delegate->RunProcess(process_type, main_function_params); 266 return delegate->RunProcess(process_type, main_params);
267 267
268 NOTREACHED() << "Unknown zygote process type: " << process_type; 268 NOTREACHED() << "Unknown zygote process type: " << process_type;
269 return 1; 269 return 1;
270 } 270 }
271 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) 271 #endif // defined(OS_POSIX) && !defined(OS_MACOSX)
272 272
273 // Run the FooMain() for a given process type. 273 // Run the FooMain() for a given process type.
274 // If |process_type| is empty, runs BrowserMain(). 274 // If |process_type| is empty, runs BrowserMain().
275 // Returns the exit code for this process. 275 // Returns the exit code for this process.
276 int RunNamedProcessTypeMain(const std::string& process_type, 276 int RunNamedProcessTypeMain(const std::string& process_type,
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 _CrtDumpMemoryLeaks(); 488 _CrtDumpMemoryLeaks();
489 #endif // _CRTDBG_MAP_ALLOC 489 #endif // _CRTDBG_MAP_ALLOC
490 490
491 _Module.Term(); 491 _Module.Term();
492 #endif // OS_WIN 492 #endif // OS_WIN
493 493
494 return exit_code; 494 return exit_code;
495 } 495 }
496 496
497 } // namespace content 497 } // namespace content
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