Merge branch 'chromium_upstream'
diff --git a/.gn b/.gn
index 853c59a..68c23ac 100644
--- a/.gn
+++ b/.gn
@@ -2,6 +2,8 @@
 # tree and to set startup options. For documentation on the values set in this
 # file, run "gn help dotfile" at the command line.
 
+root = "//sandbox:"
+
 # The location of the build configuration file.
 buildconfig = "//build/config/BUILDCONFIG.gn"
 
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..4df5f96
--- /dev/null
+++ b/README.md
@@ -0,0 +1,30 @@
+### Bauxite: a Linux sandbox toolkit
+
+Bauxite is an extraction of the Chromium sandbox into its own separate
+repository. The effort currently focuses on making the [Linux
+version](https://code.google.com/p/chromium/wiki/LinuxSandboxing) available.
+
+This early preview contains a lot of dependencies, most notably, Chromium's
+base/. We expect to reduce dependencies to a minimum in the future.
+
+Linux Build instructions:
+
+ * Install Chromium's
+   [depot_tools](https://www.chromium.org/developers/how-tos/install-depot-tools)
+   in your ```$PATH```
+ * Download GN
+```
+download_from_google_storage --no_resume --platform=linux* --no_auth --bucket chromium-gn -s src/buildtools/linux64/gn.sha1
+```
+ * Download the Clang compiler:
+```
+bash src/tools/clang/scripts/update.sh
+```
+ * Generate the Ninja files:
+```
+buildtools/linux64/gn gen out/Debug
+```
+ * Build sandbox_linux_unittests
+```
+ninja -C out/Debug sandbox_linux_unittests
+```
diff --git a/base/BUILD.gn b/base/BUILD.gn
index f4eb27f..bc544f4 100644
--- a/base/BUILD.gn
+++ b/base/BUILD.gn
@@ -893,7 +893,7 @@
   deps = [
     ":base",
     "//base/third_party/dynamic_annotations",
-    "//third_party/icu",
+    #"//third_party/icu",
   ]
 
   if (is_android && !is_debug) {
@@ -918,7 +918,7 @@
       ":base",
       "//base/test:test_support",
       "//base/test:test_support_perf",
-      "//testing/perf",
+      #"//testing/perf",
       "//testing/gtest",
     ]
 
@@ -947,7 +947,7 @@
       ]
       deps = [
         ":base",
-        "//third_party/icu:icuuc",
+        #"//third_party/icu:icuuc",
       ]
     }
 
@@ -1314,7 +1314,7 @@
     "//base/trace_event:trace_event_unittests",
     "//testing/gmock",
     "//testing/gtest",
-    "//third_party/icu",
+    #"//third_party/icu",
   ]
 
   # Allow more direct string conversions on platforms with native utf8
diff --git a/base/test/BUILD.gn b/base/test/BUILD.gn
index 91456db..41327a2 100644
--- a/base/test/BUILD.gn
+++ b/base/test/BUILD.gn
@@ -134,8 +134,8 @@
     "//base/third_party/dynamic_annotations",
     "//testing/gmock",
     "//testing/gtest",
-    "//third_party/libxml",
-    "//third_party/icu:icuuc",
+    #"//third_party/libxml",
+    #"//third_party/icu:icuuc",
   ]
 
   if (!is_posix) {
diff --git a/build/config/linux/BUILD.gn b/build/config/linux/BUILD.gn
index 3d65937..43dbaeb 100644
--- a/build/config/linux/BUILD.gn
+++ b/build/config/linux/BUILD.gn
@@ -6,12 +6,12 @@
 import("//build/config/features.gni")
 import("//build/config/sysroot.gni")
 import("//build/config/ui.gni")
-import("//tools/generate_library_loader/generate_library_loader.gni")
+#import("//tools/generate_library_loader/generate_library_loader.gni")
 
-gypi_values = exec_script("//build/gypi_to_gn.py",
-                          [ rebase_path("../../linux/system.gyp") ],
-                          "scope",
-                          [ "../../linux/system.gyp" ])
+#gypi_values = exec_script("//build/gypi_to_gn.py",
+#                          [ rebase_path("../../linux/system.gyp") ],
+#                          "scope",
+#                          [ "../../linux/system.gyp" ])
 
 config("sdk") {
   if (sysroot != "") {
@@ -35,6 +35,23 @@
   }
 }
 
+pkg_config("glib") {
+  packages = [
+    "glib-2.0",
+    "gmodule-2.0",
+    "gobject-2.0",
+    "gthread-2.0",
+  ]
+}
+
+config("libcap") {
+  libs = [ "cap" ]
+}
+
+
+
+if (false) {
+
 pkg_config("atk") {
   packages = [ "atk" ]
   atk_lib_dir = exec_script(pkg_config_script,
@@ -250,3 +267,4 @@
     ":udev1_loader",
   ]
 }
+}
diff --git a/sandbox/linux/BUILD.gn b/sandbox/linux/BUILD.gn
index 8496685..f09b19f 100644
--- a/sandbox/linux/BUILD.gn
+++ b/sandbox/linux/BUILD.gn
@@ -88,13 +88,16 @@
     ":sandbox",
     ":sandbox_linux_test_utils",
     "//base",
-    "//base/test:test_support",
+    #"//base/test:test_support",
     "//testing/gtest",
   ]
 
   if (is_linux) {
     # Don't use this on Android.
     libs = [ "rt" ]
+    defines = [ "SANDBOX_TEST_STANDALONE" ]
+  } else {
+    defines = [ "SANDBOX_TEST_STANDALONE" ]
   }
 
   if (compile_suid_client) {
@@ -124,7 +127,7 @@
     sources += [
       "integration_tests/namespace_unix_domain_socket_unittest.cc",
       "services/credentials_unittest.cc",
-      "services/namespace_sandbox_unittest.cc",
+      #"services/namespace_sandbox_unittest.cc",
       "services/namespace_utils_unittest.cc",
     ]
 
diff --git a/sandbox/linux/tests/main.cc b/sandbox/linux/tests/main.cc
index 687c8bb..b3ffde7 100644
--- a/sandbox/linux/tests/main.cc
+++ b/sandbox/linux/tests/main.cc
@@ -36,7 +36,7 @@
 }  // namespace
 }  // namespace sandbox
 
-#if defined(OS_ANDROID)
+#if defined(SANDBOX_TEST_STANDALONE)
 void UnitTestAssertHandler(const std::string& str) {
   _exit(1);
 }
@@ -44,9 +44,10 @@
 
 int main(int argc, char* argv[]) {
   base::CommandLine::Init(argc, argv);
-  std::string client_func =
+  std::string client_func;
+  /*=
       base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
-          switches::kTestChildProcess);
+          switches::kTestChildProcess);*/
   if (!client_func.empty()) {
     base::AtExitManager exit_manager;
     return multi_process_function_list::InvokeChildProcessTest(client_func);
@@ -55,7 +56,7 @@
   base::FilePath orig_cwd;
   CHECK(GetCurrentDirectory(&orig_cwd));
 
-#if defined(OS_ANDROID)
+#if defined(SANDBOX_TEST_STANDALONE)
   // The use of Callbacks requires an AtExitManager.
   base::AtExitManager exit_manager;
   testing::InitGoogleTest(&argc, argv);
@@ -69,7 +70,7 @@
   // additional side effect of getting rid of gtest warnings about fork()
   // safety.
   ::testing::FLAGS_gtest_death_test_style = "threadsafe";
-#if defined(OS_ANDROID)
+#if defined(SANDBOX_TEST_STANDALONE)
   int tests_result = RUN_ALL_TESTS();
 #else
   int tests_result = base::RunUnitTestsUsingBaseTestSuite(argc, argv);
diff --git a/tools/bauxite/chromium_to_bauxite.sh b/tools/bauxite/chromium_to_bauxite.sh
new file mode 100644
index 0000000..b2956b5
--- /dev/null
+++ b/tools/bauxite/chromium_to_bauxite.sh
@@ -0,0 +1,20 @@
+#!/usr/bin/env bash
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# This is a helper to "merge" the required chromium file to Bauxite's
+# "upstream_chromium" branch.
+
+set -e
+
+DEST=bauxite
+# Chromium src directory. Can be retrieved with
+# "fetch --nohooks --no-history chromium"
+SRC="src"
+
+rsync -a -R --delete "$SRC/AUTHORS" "$SRC/LICENSE" "$SRC/.gn" "$SRC/base" \
+"$SRC/build" "$SRC/buildtools/linux64" "$SRC/sandbox" "$SRC/testing/gtest" \
+"$SRC/testing/multiprocess_func_list.cc" "$SRC/testing/multiprocess_func_list.h" \
+"$SRC/testing/test.gni" "$SRC/third_party/libevent" "$SRC/third_party/lss" \
+"$SRC/third_party/modp_b64" "$SRC/tools/clang/scripts" "$DEST"