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

Unified Diff: chrome/common/sandbox_init_wrapper_win.cc

Issue 6598013: Make SandboxInterfaceInfo somewhat backwards compatible... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sandbox/src/sandbox_types.h » ('j') | sandbox/src/sandbox_types.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/sandbox_init_wrapper_win.cc
===================================================================
--- chrome/common/sandbox_init_wrapper_win.cc (revision 75565)
+++ chrome/common/sandbox_init_wrapper_win.cc (working copy)
@@ -10,13 +10,23 @@
#include "chrome/common/chrome_switches.h"
void SandboxInitWrapper::SetServices(sandbox::SandboxInterfaceInfo* info) {
- if (info) {
+ if (!info)
+ return;
+ if (info->legacy) {
+ // Looks like we are in the case when the new chrome.dll is being launched
+ // by the old chrome.exe, the old chrome exe has SandboxInterfaceInfo as a
+ // union, while now we have a struct.
+ // TODO(cpu): Reomove this nasty hack after M10 release.
rvargas (doing something else) 2011/02/25 22:26:17 typo
+ broker_services_ = reinterpret_cast<sandbox::BrokerServices*>(info->legacy);
+ target_services_ = reinterpret_cast<sandbox::TargetServices*>(info->legacy);
+ } else {
+ // Normal case, both the exe and the dll are the same version. Both
+ // interface pointers cannot be non-zero. A process can either be a target
+ // or a broker but not both.
broker_services_ = info->broker_services;
target_services_ = info->target_services;
+ DCHECK(!(target_services_ && broker_services_));
}
- // Both interface pointers cannot be non-zero. A process can either
- // be a target or a broker but not both.
- DCHECK(!(target_services_ && broker_services_));
}
bool SandboxInitWrapper::InitializeSandbox(const CommandLine& command_line,
« no previous file with comments | « no previous file | sandbox/src/sandbox_types.h » ('j') | sandbox/src/sandbox_types.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698