Reland http://codereview.chromium.org/8233039/ with a fix
so that mac works.

[email protected]
BUG=90442
TEST=

Review URL: http://codereview.chromium.org/8276015

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105439 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi
index 47128a0..aba0a91 100644
--- a/chrome/chrome_tests.gypi
+++ b/chrome/chrome_tests.gypi
@@ -527,6 +527,7 @@
         'test/base/chrome_test_launcher.cc',
         'test/base/view_event_test_base.cc',
         'test/base/view_event_test_base.h',
+        '../content/app/startup_helper_win.cc',
         '../content/test/test_launcher.cc',
         '../content/test/test_launcher.h',
       ],
@@ -2530,6 +2531,7 @@
         # TODO(craig): Rename this and run from base_unittests when the test
         # is safe to run there. See http://crbug.com/78722 for details.
         '../base/files/file_path_watcher_browsertest.cc',
+        '../content/app/startup_helper_win.cc',
         '../content/browser/child_process_security_policy_browsertest.cc',
         '../content/browser/device_orientation/device_orientation_browsertest.cc',
         '../content/browser/download/mhtml_generation_browsertest.cc',
@@ -2798,6 +2800,7 @@
         'app/chrome_dll.rc',
         'browser/safe_browsing/safe_browsing_test.cc',
         'test/base/chrome_test_launcher.cc',
+        '../content/app/startup_helper_win.cc',
         '../content/test/test_launcher.cc',
         '../content/test/test_launcher.h',
       ],
@@ -3251,6 +3254,7 @@
         'browser/sync/test/integration/two_client_typed_urls_sync_test.cc',
         'browser/sync/test/integration/typed_urls_helper.cc',
         'browser/sync/test/integration/typed_urls_helper.h',
+        '../content/app/startup_helper_win.cc',
         '../content/test/test_launcher.cc',
         '../content/test/test_launcher.h',
       ],
@@ -3375,6 +3379,7 @@
         'browser/sync/test/integration/typed_urls_helper.h',
         'test/base/chrome_test_launcher.cc',
         'test/data/resource.rc',
+        '../content/app/startup_helper_win.cc',
         '../content/test/test_launcher.cc',
         '../content/test/test_launcher.h',
       ],
@@ -3481,6 +3486,7 @@
         'browser/gpu_crash_browsertest.cc',
         'test/base/chrome_test_launcher.cc',
         'test/gpu/webgl_conformance_tests.cc',
+        '../content/app/startup_helper_win.cc',
         '../content/test/test_launcher.cc',
         '../content/test/test_launcher.h',
         '<(test_list_out_dir)/webgl_conformance_test_list_autogen.h',
diff --git a/content/app/startup_helper_win.h b/content/app/startup_helper_win.h
index b870798b..e20b638 100644
--- a/content/app/startup_helper_win.h
+++ b/content/app/startup_helper_win.h
@@ -6,8 +6,6 @@
 #define CONTENT_APP_STARTUP_HELPER_WIN_H_
 #pragma once
 
-#include "content/common/content_export.h"
-
 class CommandLine;
 
 namespace sandbox {
@@ -18,9 +16,11 @@
 // will want to call at startup.
 namespace content {
 
-// Initializes the sandbox code and turns on DEP.
-CONTENT_EXPORT void InitializeSandboxInfo(
-    sandbox::SandboxInterfaceInfo* sandbox_info);
+// Initializes the sandbox code and turns on DEP. Note: This function
+// must be *statically* linked into the executable (along with the static
+// sandbox library); it will not work correctly if it is exported from a
+// DLL and linked in.
+void InitializeSandboxInfo(sandbox::SandboxInterfaceInfo* sandbox_info);
 
 // Register the invalid param handler and pure call handler to be able to
 // notify breakpad when it happens.
diff --git a/content/content_shell.gypi b/content/content_shell.gypi
index c818460..7d28c2c 100644
--- a/content/content_shell.gypi
+++ b/content/content_shell.gypi
@@ -118,6 +118,7 @@
         '..',
       ],
       'sources': [
+        'app/startup_helper_win.cc',
         'shell/shell_main.cc',
       ],
       'msvs_settings': {
@@ -142,6 +143,11 @@
             },
           },
         }],
+        ['OS == "win" or (toolkit_uses_gtk == 1 and selinux == 0)', {
+          'dependencies': [
+            '../sandbox/sandbox.gyp:sandbox',
+          ],
+        }],
       ],
     },
   ],
diff --git a/content/content_tests.gypi b/content/content_tests.gypi
index 3dd46d5..8844740 100644
--- a/content/content_tests.gypi
+++ b/content/content_tests.gypi
@@ -114,6 +114,7 @@
         '..',
       ],
       'sources': [
+        'app/startup_helper_win.cc',
         'browser/appcache/chrome_appcache_service_unittest.cc',
         'browser/browser_thread_unittest.cc',
         'browser/browser_url_handler_unittest.cc',
@@ -214,6 +215,11 @@
             'closure_blocks_leopard_compat',
           ],
         }],
+        ['OS == "win" or (toolkit_uses_gtk == 1 and selinux == 0)', {
+          'dependencies': [
+            '../sandbox/sandbox.gyp:sandbox',
+          ],
+        }],
       ],
     },
     {
@@ -241,6 +247,7 @@
         'HAS_OUT_OF_PROC_TEST_RUNNER',
       ],
       'sources': [
+        'app/startup_helper_win.cc',
         'test/content_browser_test.h',
         'test/content_browser_test.cc',
         'test/content_test_launcher.cc',
@@ -269,7 +276,6 @@
             '<(DEPTH)/net/net.gyp:net_resources',
             '<(DEPTH)/webkit/support/webkit_support.gyp:webkit_resources',
             '<(DEPTH)/webkit/support/webkit_support.gyp:webkit_strings',
-            '../sandbox/sandbox.gyp:sandbox',
           ],
           'configurations': {
             'Debug_Base': {
@@ -286,6 +292,11 @@
             '../base/allocator/allocator.gyp:allocator',
           ],
         }],
+        ['OS == "win" or (toolkit_uses_gtk == 1 and selinux == 0)', {
+          'dependencies': [
+            '../sandbox/sandbox.gyp:sandbox',
+          ],
+        }],
       ],
     },
   ],