Make //mojo/common less of a dumping ground

This splits most of the loosely coupled code in //mojo/common out into
topical locations thusly:

data_pipe_utils                              -> //mojo/data_pipe_utils
message_pump_mojo & handle_watcher           -> //mojo/message_pump
mojo::Array <-> std::string converters       -> //mojo/converters/array_string
base type converters (string16/stringpiece)  -> //mojo/converters/base
url type converters                          -> //mojo/converters/url

and updates many references to only depend on the bit they are actually
using. The unit tests are moved to live next to their code (in
source_sets) but are still linked into mojo_common_unittests. This
patch doesn't change the namespace of anything to minimize actual code churn.

binding_set, interface_ptr_set and task_tracker are still in the
//mojo/common target and some other files in random targets are still
in the //mojo/common directory. Some (or possibly all) of these will
likely move to other locations in future patches.

R=viettrungluu@chromium.org

Review URL: https://codereview.chromium.org/1306923003 .
diff --git a/examples/browser/BUILD.gn b/examples/browser/BUILD.gn
index d6ab862..e9eec57 100644
--- a/examples/browser/BUILD.gn
+++ b/examples/browser/BUILD.gn
@@ -16,7 +16,6 @@
     "//base",
     "//examples/window_manager:bindings",
     "//mojo/application",
-    "//mojo/common",
     "//mojo/converters/geometry",
     "//mojo/services/geometry/public/interfaces",
     "//mojo/services/navigation/public/interfaces",
diff --git a/examples/browser/browser.cc b/examples/browser/browser.cc
index 0f18159..1481cb8 100644
--- a/examples/browser/browser.cc
+++ b/examples/browser/browser.cc
@@ -8,7 +8,6 @@
 #include "examples/browser/browser_host.mojom.h"
 #include "examples/window_manager/window_manager.mojom.h"
 #include "mojo/application/application_runner_chromium.h"
-#include "mojo/common/common_type_converters.h"
 #include "mojo/converters/geometry/geometry_type_converters.h"
 #include "mojo/public/c/system/main.h"
 #include "mojo/public/cpp/application/application_connection.h"
diff --git a/examples/forwarding_content_handler/BUILD.gn b/examples/forwarding_content_handler/BUILD.gn
index 4ca915f..985c49c 100644
--- a/examples/forwarding_content_handler/BUILD.gn
+++ b/examples/forwarding_content_handler/BUILD.gn
@@ -13,7 +13,7 @@
     "//base",
     "//mojo/application",
     "//mojo/application:content_handler",
-    "//mojo/common:common",
+    "//mojo/data_pipe_utils",
     "//mojo/public/cpp/bindings",
     "//mojo/public/cpp/utility",
     "//mojo/public/interfaces/application:application",
diff --git a/examples/forwarding_content_handler/forwarding_content_handler.cc b/examples/forwarding_content_handler/forwarding_content_handler.cc
index ef17ee3..d9c4118 100644
--- a/examples/forwarding_content_handler/forwarding_content_handler.cc
+++ b/examples/forwarding_content_handler/forwarding_content_handler.cc
@@ -6,7 +6,7 @@
 #include "base/memory/scoped_ptr.h"
 #include "mojo/application/application_runner_chromium.h"
 #include "mojo/application/content_handler_factory.h"
-#include "mojo/common/data_pipe_utils.h"
+#include "mojo/data_pipe_utils/data_pipe_utils.h"
 #include "mojo/public/c/system/main.h"
 #include "mojo/public/cpp/application/application_connection.h"
 #include "mojo/public/cpp/application/application_delegate.h"
diff --git a/examples/indirect_service/BUILD.gn b/examples/indirect_service/BUILD.gn
index 880dc5f..cf7d5d8 100644
--- a/examples/indirect_service/BUILD.gn
+++ b/examples/indirect_service/BUILD.gn
@@ -24,8 +24,8 @@
     ":bindings",
     "//base",
     "//mojo/application",
-    "//mojo/common",
     "//mojo/environment:chromium",
+    "//mojo/message_pump",
     "//mojo/public/cpp/bindings",
     "//mojo/public/cpp/utility",
   ]
diff --git a/examples/indirect_service/indirect_service_demo.cc b/examples/indirect_service/indirect_service_demo.cc
index b1d459b..85c1391 100644
--- a/examples/indirect_service/indirect_service_demo.cc
+++ b/examples/indirect_service/indirect_service_demo.cc
@@ -10,7 +10,7 @@
 #include "base/time/time.h"
 #include "examples/indirect_service/indirect_service_demo.mojom.h"
 #include "mojo/application/application_runner_chromium.h"
-#include "mojo/common/message_pump_mojo.h"
+#include "mojo/message_pump/message_pump_mojo.h"
 #include "mojo/public/c/system/main.h"
 #include "mojo/public/cpp/application/application_delegate.h"
 #include "mojo/public/cpp/application/application_impl.h"
diff --git a/examples/pdf_viewer/BUILD.gn b/examples/pdf_viewer/BUILD.gn
index d21cc1d..68b5b39 100644
--- a/examples/pdf_viewer/BUILD.gn
+++ b/examples/pdf_viewer/BUILD.gn
@@ -11,9 +11,9 @@
 
   deps = [
     "//examples/bitmap_uploader",
-    "//mojo/common",
     "//mojo/application",
     "//mojo/application:content_handler",
+    "//mojo/data_pipe_utils",
     "//mojo/public/cpp/bindings",
     "//mojo/public/cpp/utility",
     "//mojo/services/content_handler/public/interfaces",
diff --git a/examples/pdf_viewer/pdf_viewer.cc b/examples/pdf_viewer/pdf_viewer.cc
index 21e38d7..1eabbe6 100644
--- a/examples/pdf_viewer/pdf_viewer.cc
+++ b/examples/pdf_viewer/pdf_viewer.cc
@@ -7,7 +7,7 @@
 #include "examples/bitmap_uploader/bitmap_uploader.h"
 #include "mojo/application/application_runner_chromium.h"
 #include "mojo/application/content_handler_factory.h"
-#include "mojo/common/data_pipe_utils.h"
+#include "mojo/data_pipe_utils/data_pipe_utils.h"
 #include "mojo/public/c/system/main.h"
 #include "mojo/public/cpp/application/application_connection.h"
 #include "mojo/public/cpp/application/application_delegate.h"
diff --git a/examples/png_viewer/BUILD.gn b/examples/png_viewer/BUILD.gn
index 2204976..15fe4d1 100644
--- a/examples/png_viewer/BUILD.gn
+++ b/examples/png_viewer/BUILD.gn
@@ -11,9 +11,9 @@
 
   deps = [
     "//examples/bitmap_uploader",
-    "//mojo/common",
     "//mojo/application",
     "//mojo/application:content_handler",
+    "//mojo/data_pipe_utils",
     "//mojo/public/cpp/bindings",
     "//mojo/public/cpp/utility",
     "//mojo/services/content_handler/public/interfaces",
diff --git a/examples/png_viewer/png_viewer.cc b/examples/png_viewer/png_viewer.cc
index 8cd42f1..e29056a 100644
--- a/examples/png_viewer/png_viewer.cc
+++ b/examples/png_viewer/png_viewer.cc
@@ -11,7 +11,7 @@
 #include "examples/bitmap_uploader/bitmap_uploader.h"
 #include "mojo/application/application_runner_chromium.h"
 #include "mojo/application/content_handler_factory.h"
-#include "mojo/common/data_pipe_utils.h"
+#include "mojo/data_pipe_utils/data_pipe_utils.h"
 #include "mojo/public/c/system/main.h"
 #include "mojo/public/cpp/application/application_connection.h"
 #include "mojo/public/cpp/application/application_delegate.h"
diff --git a/examples/spinning_cube/BUILD.gn b/examples/spinning_cube/BUILD.gn
index 801e086..f8d3ecf 100644
--- a/examples/spinning_cube/BUILD.gn
+++ b/examples/spinning_cube/BUILD.gn
@@ -35,7 +35,6 @@
 
   deps = [
     "//base",
-    "//mojo/common",
     "//mojo/public/c/gpu",
     "//mojo/public/cpp/environment",
   ]
diff --git a/examples/spinning_cube/spinning_cube.cc b/examples/spinning_cube/spinning_cube.cc
index 5b97e11..ee20549 100644
--- a/examples/spinning_cube/spinning_cube.cc
+++ b/examples/spinning_cube/spinning_cube.cc
@@ -22,7 +22,6 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "mojo/common/common_type_converters.h"
 #include "mojo/public/cpp/environment/logging.h"
 
 namespace examples {
diff --git a/mojo/android/BUILD.gn b/mojo/android/BUILD.gn
index 8e0aacd..746a156 100644
--- a/mojo/android/BUILD.gn
+++ b/mojo/android/BUILD.gn
@@ -45,10 +45,10 @@
   deps = [
     ":system_java_jni_headers",
     "//base",
-    "//mojo/public/cpp/environment",
-    "//mojo/common:common",
+    "//mojo/message_pump",
     "//mojo/public/c/system:system",
     "//mojo/public/cpp/bindings:callback",
+    "//mojo/public/cpp/environment",
   ]
 }
 
@@ -125,13 +125,12 @@
     ":system_java_jni_headers",
     "//base",
     "//base/test/:test_support",
-    "//mojo/common",
-    "//mojo/edk/system",
-    "//mojo/public/cpp/bindings/tests:mojo_public_bindings_test_utils",
-    "//mojo/public/cpp/test_support:test_utils",
-    "//mojo/public/cpp/environment",
     "//mojo/edk/system",
     "//mojo/environment:chromium",
+    "//mojo/message_pump",
+    "//mojo/public/cpp/bindings/tests:mojo_public_bindings_test_utils",
+    "//mojo/public/cpp/environment",
+    "//mojo/public/cpp/test_support:test_utils",
   ]
   defines = [ "UNIT_TEST" ]
 }
diff --git a/mojo/android/javatests/mojo_test_case.cc b/mojo/android/javatests/mojo_test_case.cc
index 419d14d..2df0bc7 100644
--- a/mojo/android/javatests/mojo_test_case.cc
+++ b/mojo/android/javatests/mojo_test_case.cc
@@ -13,7 +13,7 @@
 #include "base/run_loop.h"
 #include "base/test/test_support_android.h"
 #include "jni/MojoTestCase_jni.h"
-#include "mojo/common/message_pump_mojo.h"
+#include "mojo/message_pump/message_pump_mojo.h"
 
 #include "mojo/public/cpp/environment/environment.h"
 
diff --git a/mojo/android/system/base_run_loop.cc b/mojo/android/system/base_run_loop.cc
index 3d05e30..f361a94 100644
--- a/mojo/android/system/base_run_loop.cc
+++ b/mojo/android/system/base_run_loop.cc
@@ -12,7 +12,7 @@
 #include "base/bind.h"
 #include "base/message_loop/message_loop.h"
 #include "jni/BaseRunLoop_jni.h"
-#include "mojo/common/message_pump_mojo.h"
+#include "mojo/message_pump/message_pump_mojo.h"
 
 namespace mojo {
 namespace android {
diff --git a/mojo/application/BUILD.gn b/mojo/application/BUILD.gn
index f28c13b..35cb345 100644
--- a/mojo/application/BUILD.gn
+++ b/mojo/application/BUILD.gn
@@ -13,7 +13,7 @@
   ]
   deps = [
     "//base",
-    "//mojo/common",
+    "//mojo/message_pump",
     "//mojo/public/cpp/system",
     "//mojo/environment:chromium",
   ]
@@ -27,8 +27,8 @@
   deps = [
     ":application",
     "//base",
-    "//mojo/common",
     "//mojo/environment:chromium",
+    "//mojo/message_pump",
     "//mojo/public/interfaces/application",
     "//mojo/services/content_handler/public/interfaces",
     "//mojo/services/network/public/interfaces",
diff --git a/mojo/application/application_runner_chromium.cc b/mojo/application/application_runner_chromium.cc
index 451d448..d54f4b2 100644
--- a/mojo/application/application_runner_chromium.cc
+++ b/mojo/application/application_runner_chromium.cc
@@ -9,7 +9,7 @@
 #include "base/debug/stack_trace.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/message_loop/message_loop.h"
-#include "mojo/common/message_pump_mojo.h"
+#include "mojo/message_pump/message_pump_mojo.h"
 #include "mojo/public/cpp/application/application_delegate.h"
 #include "mojo/public/cpp/application/application_impl.h"
 
diff --git a/mojo/application/content_handler_factory.cc b/mojo/application/content_handler_factory.cc
index 1231001..9594fdb 100644
--- a/mojo/application/content_handler_factory.cc
+++ b/mojo/application/content_handler_factory.cc
@@ -13,7 +13,7 @@
 #include "base/threading/platform_thread.h"
 #include "base/trace_event/trace_event.h"
 #include "mojo/application/application_runner_chromium.h"
-#include "mojo/common/message_pump_mojo.h"
+#include "mojo/message_pump/message_pump_mojo.h"
 #include "mojo/public/cpp/application/application_connection.h"
 #include "mojo/public/cpp/application/application_delegate.h"
 #include "mojo/public/cpp/application/application_impl.h"
diff --git a/mojo/common/BUILD.gn b/mojo/common/BUILD.gn
index 748eb4f..2420060 100644
--- a/mojo/common/BUILD.gn
+++ b/mojo/common/BUILD.gn
@@ -5,54 +5,25 @@
 import("//mojo/public/tools/bindings/mojom.gni")
 import("//testing/test.gni")
 
-component("common") {
-  output_name = "mojo_common_lib"
-
+source_set("common") {
   sources = [
     "binding_set.h",
-    "common_type_converters.cc",
-    "common_type_converters.h",
-    "data_pipe_drainer.cc",
-    "data_pipe_drainer.h",
-    "data_pipe_file_utils.cc",
-    "data_pipe_utils.cc",
-    "data_pipe_utils.h",
-    "data_pipe_utils_internal.h",
-    "handle_watcher.cc",
-    "handle_watcher.h",
     "interface_ptr_set.h",
-    "message_pump_mojo.cc",
-    "message_pump_mojo.h",
-    "message_pump_mojo_handler.h",
     "task_tracker.cc",
     "task_tracker.h",
-    "time_helper.cc",
-    "time_helper.h",
   ]
 
-  if (is_nacl) {
-    sources -= [ "data_pipe_file_utils.cc" ]
-  }
-
   deps = [
     "//base",
-    "//base/third_party/dynamic_annotations",
-    "//mojo/public/c/system",
     "//mojo/public/cpp/bindings",
-    "//mojo/public/cpp/environment:environment",
-    "//mojo/public/cpp/system",
-    "//url",
   ]
 }
 
 test("mojo_common_unittests") {
   sources = [
     "binding_set_unittest.cc",
-    "common_type_converters_unittest.cc",
-    "data_pipe_utils_unittest.cc",
-    "handle_watcher_unittest.cc",
+    "callback_binding_unittest.cc",
     "interface_ptr_set_unittest.cc",
-    "message_pump_mojo_unittest.cc",
     "task_tracker_unittest.cc",
   ]
 
@@ -61,10 +32,15 @@
     ":test_interfaces",
     "//base",
     "//base/test:test_support",
-    "//base:message_loop_tests",
+    "//mojo/converters/array_string:tests",
+    "//mojo/converters/base:tests",
+    "//mojo/converters/url:tests",
+    "//mojo/data_pipe_utils:tests",
     "//mojo/edk/test:run_all_unittests",
     "//mojo/edk/test:test_support",
     "//mojo/environment:chromium",
+    "//mojo/message_pump",
+    "//mojo/message_pump:tests",
     "//mojo/public/cpp/bindings",
     "//mojo/public/cpp/bindings:callback",
     "//mojo/public/cpp/system",
diff --git a/mojo/common/binding_set_unittest.cc b/mojo/common/binding_set_unittest.cc
index 421a405..c37053e 100644
--- a/mojo/common/binding_set_unittest.cc
+++ b/mojo/common/binding_set_unittest.cc
@@ -5,8 +5,8 @@
 #include "mojo/common/binding_set.h"
 
 #include "base/message_loop/message_loop.h"
-#include "mojo/common/message_pump_mojo.h"
 #include "mojo/common/test_interfaces.mojom.h"
+#include "mojo/message_pump/message_pump_mojo.h"
 #include "mojo/public/cpp/bindings/binding.h"
 #include "mojo/public/cpp/bindings/interface_request.h"
 #include "testing/gtest/include/gtest/gtest.h"
diff --git a/mojo/common/callback_binding_unittest.cc b/mojo/common/callback_binding_unittest.cc
new file mode 100644
index 0000000..aa59856
--- /dev/null
+++ b/mojo/common/callback_binding_unittest.cc
@@ -0,0 +1,104 @@
+// Copyright 2013 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.
+
+#include "base/bind.h"
+#include "mojo/public/cpp/bindings/callback.h"
+#include "mojo/public/cpp/bindings/map.h"
+#include "mojo/public/cpp/bindings/string.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace {
+
+struct RunnableNoArgs {
+  RunnableNoArgs(int* calls) : calls(calls) {}
+  void Run() const { (*calls)++; }
+
+  int* calls;
+};
+
+TEST(CallbackBindingTest, BaseBindToMojoCallbackNoParams) {
+  mojo::Callback<void()> cb;
+  int calls = 0;
+  RunnableNoArgs r(&calls);
+  cb = r;
+  cb.Run();
+  EXPECT_EQ(1, calls);
+
+  cb = base::Bind(&RunnableNoArgs::Run, base::Unretained(&r));
+  cb.Run();
+  EXPECT_EQ(2, calls);
+}
+
+struct RunnableOnePrimitiveArg {
+  explicit RunnableOnePrimitiveArg(int* calls) : calls(calls) {}
+  void Run(int a) const { (*calls)++; }
+
+  int* calls;
+};
+
+TEST(CallbackBindingTest, BaseBindToMojoCallbackPrimitiveParam) {
+  mojo::Callback<void(int)> mojo_callback;
+  int calls = 0;
+  RunnableOnePrimitiveArg r(&calls);
+  mojo_callback = r;
+  mojo_callback.Run(0);
+  EXPECT_EQ(1, calls);
+
+  base::Callback<void(int)> base_callback =
+      base::Bind(&RunnableOnePrimitiveArg::Run, base::Unretained(&r));
+  mojo_callback = base_callback;
+  mojo_callback.Run(0);
+  EXPECT_EQ(2, calls);
+}
+
+struct RunnableOneMojoStringParam {
+  explicit RunnableOneMojoStringParam(int* calls) : calls(calls) {}
+  void Run(const mojo::String& s) const { (*calls)++; }
+
+  int* calls;
+};
+
+TEST(CallbackBindingTest, BaseBindToMojoCallbackMojoStringParam) {
+  // The mojo type is a callback on mojo::String, but it'll expect to invoke
+  // callbacks with a parameter of type 'const Mojo::String&'.
+  mojo::Callback<void(mojo::String)> mojo_callback;
+  int calls = 0;
+  RunnableOneMojoStringParam r(&calls);
+  mojo_callback = r;
+  mojo_callback.Run(0);
+  EXPECT_EQ(1, calls);
+
+  base::Callback<void(const mojo::String&)> base_callback =
+      base::Bind(&RunnableOneMojoStringParam::Run, base::Unretained(&r));
+  mojo_callback = base_callback;
+  mojo_callback.Run(0);
+  EXPECT_EQ(2, calls);
+}
+
+using ExampleMoveOnlyType = mojo::Map<int, int>;
+
+struct RunnableOneMoveOnlyParam {
+  explicit RunnableOneMoveOnlyParam(int* calls) : calls(calls) {}
+
+  void Run(ExampleMoveOnlyType m) const { (*calls)++; }
+  int* calls;
+};
+
+TEST(CallbackBindingTest, BaseBindToMoveOnlyParam) {
+  mojo::Callback<void(ExampleMoveOnlyType)> mojo_callback;
+  int calls = 0;
+  RunnableOneMoveOnlyParam r(&calls);
+  mojo_callback = r;
+  ExampleMoveOnlyType m;
+  mojo_callback.Run(m.Clone());
+  EXPECT_EQ(1, calls);
+
+  base::Callback<void(ExampleMoveOnlyType)> base_callback =
+      base::Bind(&RunnableOneMoveOnlyParam::Run, base::Unretained(&r));
+  mojo_callback = base_callback;
+  mojo_callback.Run(m.Clone());
+  EXPECT_EQ(2, calls);
+}
+
+}  // namespace
diff --git a/mojo/common/common_type_converters.cc b/mojo/common/common_type_converters.cc
deleted file mode 100644
index 114b409..0000000
--- a/mojo/common/common_type_converters.cc
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright 2013 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.
-
-#include "mojo/common/common_type_converters.h"
-
-#include <string>
-
-#include "base/strings/utf_string_conversions.h"
-#include "url/gurl.h"
-
-namespace mojo {
-
-// static
-String TypeConverter<String, base::StringPiece>::Convert(
-    const base::StringPiece& input) {
-  if (input.empty()) {
-    char c = 0;
-    return String(&c, 0);
-  }
-  return String(input.data(), input.size());
-}
-// static
-base::StringPiece TypeConverter<base::StringPiece, String>::Convert(
-    const String& input) {
-  return input.get();
-}
-
-// static
-String TypeConverter<String, base::string16>::Convert(
-    const base::string16& input) {
-  return TypeConverter<String, base::StringPiece>::Convert(
-      base::UTF16ToUTF8(input));
-}
-// static
-base::string16 TypeConverter<base::string16, String>::Convert(
-    const String& input) {
-  return base::UTF8ToUTF16(input.To<base::StringPiece>());
-}
-
-String TypeConverter<String, GURL>::Convert(const GURL& input) {
-  return String(input.spec());
-}
-
-GURL TypeConverter<GURL, String>::Convert(const String& input) {
-  return GURL(input.get());
-}
-
-std::string TypeConverter<std::string, Array<uint8_t> >::Convert(
-    const Array<uint8_t>& input) {
-  if (input.is_null())
-    return std::string();
-
-  return std::string(reinterpret_cast<const char*>(&input.front()),
-                     input.size());
-}
-
-Array<uint8_t> TypeConverter<Array<uint8_t>, std::string>::Convert(
-    const std::string& input) {
-  Array<uint8_t> result(input.size());
-  memcpy(&result.front(), input.c_str(), input.size());
-  return result.Pass();
-}
-
-}  // namespace mojo
diff --git a/mojo/common/common_type_converters.h b/mojo/common/common_type_converters.h
deleted file mode 100644
index 9bd21e8..0000000
--- a/mojo/common/common_type_converters.h
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright 2013 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.
-
-#ifndef MOJO_COMMON_COMMON_TYPE_CONVERTERS_H_
-#define MOJO_COMMON_COMMON_TYPE_CONVERTERS_H_
-
-#include "base/strings/string16.h"
-#include "base/strings/string_piece.h"
-#include "mojo/public/cpp/bindings/array.h"
-#include "mojo/public/cpp/bindings/string.h"
-#include "mojo/public/cpp/bindings/type_converter.h"
-
-class GURL;
-
-namespace mojo {
-
-template <>
-struct TypeConverter<String, base::StringPiece> {
-  static String Convert(const base::StringPiece& input);
-};
-
-template <>
-struct TypeConverter<base::StringPiece, String> {
-  static base::StringPiece Convert(const String& input);
-};
-
-template <>
-struct TypeConverter<String, base::string16> {
-  static String Convert(const base::string16& input);
-};
-
-template <>
-struct TypeConverter<base::string16, String> {
-  static base::string16 Convert(const String& input);
-};
-
-template <>
-struct TypeConverter<String, GURL> {
-  static String Convert(const GURL& input);
-};
-
-template <>
-struct TypeConverter<GURL, String> {
-  static GURL Convert(const String& input);
-};
-
-// TODO(erg): In the very long term, we will want to remove conversion between
-// std::strings and arrays of unsigned bytes. However, there is too much code
-// across chrome which uses std::string as a bag of bytes that we probably
-// don't want to roll this function at each callsite.
-template <>
-struct TypeConverter<std::string, Array<uint8_t>> {
-  static std::string Convert(const Array<uint8_t>& input);
-};
-
-template <>
-struct TypeConverter<Array<uint8_t>, std::string> {
-  static Array<uint8_t> Convert(const std::string& input);
-};
-
-}  // namespace mojo
-
-#endif  // MOJO_COMMON_COMMON_TYPE_CONVERTERS_H_
diff --git a/mojo/common/common_type_converters_unittest.cc b/mojo/common/common_type_converters_unittest.cc
deleted file mode 100644
index 4a360bd..0000000
--- a/mojo/common/common_type_converters_unittest.cc
+++ /dev/null
@@ -1,203 +0,0 @@
-// Copyright 2013 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.
-
-#include "mojo/common/common_type_converters.h"
-
-#include "base/bind.h"
-#include "base/strings/utf_string_conversions.h"
-#include "mojo/public/cpp/bindings/callback.h"
-#include "mojo/public/cpp/bindings/map.h"
-#include "testing/gtest/include/gtest/gtest.h"
-#include "url/gurl.h"
-
-namespace mojo {
-namespace common {
-namespace test {
-namespace {
-
-void ExpectEqualsStringPiece(const std::string& expected,
-                             const base::StringPiece& str) {
-  EXPECT_EQ(expected, str.as_string());
-}
-
-void ExpectEqualsMojoString(const std::string& expected,
-                            const String& str) {
-  EXPECT_EQ(expected, str.get());
-}
-
-void ExpectEqualsString16(const base::string16& expected,
-                          const base::string16& actual) {
-  EXPECT_EQ(expected, actual);
-}
-
-void ExpectEqualsMojoString(const base::string16& expected,
-                            const String& str) {
-  EXPECT_EQ(expected, str.To<base::string16>());
-}
-
-TEST(CommonTypeConvertersTest, StringPiece) {
-  std::string kText("hello world");
-
-  base::StringPiece string_piece(kText);
-  String mojo_string(String::From(string_piece));
-
-  ExpectEqualsMojoString(kText, mojo_string);
-  ExpectEqualsStringPiece(kText, mojo_string.To<base::StringPiece>());
-
-  // Test implicit construction and conversion:
-  ExpectEqualsMojoString(kText, String::From(string_piece));
-  ExpectEqualsStringPiece(kText, mojo_string.To<base::StringPiece>());
-
-  // Test null String:
-  base::StringPiece empty_string_piece = String().To<base::StringPiece>();
-  EXPECT_TRUE(empty_string_piece.empty());
-}
-
-TEST(CommonTypeConvertersTest, String16) {
-  const base::string16 string16(base::ASCIIToUTF16("hello world"));
-  const String mojo_string(String::From(string16));
-
-  ExpectEqualsMojoString(string16, mojo_string);
-  EXPECT_EQ(string16, mojo_string.To<base::string16>());
-
-  // Test implicit construction and conversion:
-  ExpectEqualsMojoString(string16, String::From(string16));
-  ExpectEqualsString16(string16, mojo_string.To<base::string16>());
-
-  // Test empty string conversion.
-  ExpectEqualsMojoString(base::string16(), String::From(base::string16()));
-}
-
-TEST(CommonTypeConvertersTest, URL) {
-  GURL url("mojo:foo");
-  String mojo_string(String::From(url));
-
-  ASSERT_EQ(url.spec(), mojo_string);
-  EXPECT_EQ(url.spec(), mojo_string.To<GURL>().spec());
-  EXPECT_EQ(url.spec(), String::From(url));
-
-  GURL invalid = String().To<GURL>();
-  ASSERT_TRUE(invalid.spec().empty());
-
-  String string_from_invalid = String::From(invalid);
-  EXPECT_FALSE(string_from_invalid.is_null());
-  ASSERT_EQ(0U, string_from_invalid.size());
-}
-
-TEST(CommonTypeConvertersTest, ArrayUint8ToStdString) {
-  Array<uint8_t> data(4);
-  data[0] = 'd';
-  data[1] = 'a';
-  data[2] = 't';
-  data[3] = 'a';
-
-  EXPECT_EQ("data", data.To<std::string>());
-}
-
-TEST(CommonTypeConvertersTest, StdStringToArrayUint8) {
-  std::string input("data");
-  Array<uint8_t> data = Array<uint8_t>::From(input);
-
-  ASSERT_EQ(4ul, data.size());
-  EXPECT_EQ('d', data[0]);
-  EXPECT_EQ('a', data[1]);
-  EXPECT_EQ('t', data[2]);
-  EXPECT_EQ('a', data[3]);
-}
-
-struct RunnableNoArgs {
-  RunnableNoArgs(int* calls) : calls(calls) {}
-  void Run() const { (*calls)++; }
-
-  int* calls;
-};
-
-TEST(CommonTypeConvertersTest, BaseBindToMojoCallbackNoParams) {
-  mojo::Callback<void()> cb;
-  int calls = 0;
-  RunnableNoArgs r(&calls);
-  cb = r;
-  cb.Run();
-  EXPECT_EQ(1, calls);
-
-  cb = base::Bind(&RunnableNoArgs::Run, base::Unretained(&r));
-  cb.Run();
-  EXPECT_EQ(2, calls);
-}
-
-struct RunnableOnePrimitiveArg {
-  explicit RunnableOnePrimitiveArg(int* calls) : calls(calls) {}
-  void Run(int a) const { (*calls)++; }
-
-  int* calls;
-};
-
-TEST(CommonTypeConvertersTest, BaseBindToMojoCallbackPrimitiveParam) {
-  mojo::Callback<void(int)> mojo_callback;
-  int calls = 0;
-  RunnableOnePrimitiveArg r(&calls);
-  mojo_callback = r;
-  mojo_callback.Run(0);
-  EXPECT_EQ(1, calls);
-
-  base::Callback<void(int)> base_callback =
-      base::Bind(&RunnableOnePrimitiveArg::Run, base::Unretained(&r));
-  mojo_callback = base_callback;
-  mojo_callback.Run(0);
-  EXPECT_EQ(2, calls);
-}
-
-struct RunnableOneMojoStringParam {
-  explicit RunnableOneMojoStringParam(int* calls) : calls(calls) {}
-  void Run(const String& s) const { (*calls)++; }
-
-  int* calls;
-};
-
-TEST(CommonTypeConvertersTest, BaseBindToMojoCallbackMojoStringParam) {
-  // The mojo type is a callback on mojo::String, but it'll expect to invoke
-  // callbacks with a parameter of type 'const Mojo::String&'.
-  mojo::Callback<void(mojo::String)> mojo_callback;
-  int calls = 0;
-  RunnableOneMojoStringParam r(&calls);
-  mojo_callback = r;
-  mojo_callback.Run(0);
-  EXPECT_EQ(1, calls);
-
-  base::Callback<void(const mojo::String&)> base_callback =
-      base::Bind(&RunnableOneMojoStringParam::Run, base::Unretained(&r));
-  mojo_callback = base_callback;
-  mojo_callback.Run(0);
-  EXPECT_EQ(2, calls);
-}
-
-using ExampleMoveOnlyType = Map<int, int>;
-
-struct RunnableOneMoveOnlyParam {
-  explicit RunnableOneMoveOnlyParam(int* calls) : calls(calls) {}
-
-  void Run(ExampleMoveOnlyType m) const { (*calls)++; }
-  int* calls;
-};
-
-TEST(CommonTypeConvertersTest, BaseBindToMoveOnlyParam) {
-  mojo::Callback<void(ExampleMoveOnlyType)> mojo_callback;
-  int calls = 0;
-  RunnableOneMoveOnlyParam r(&calls);
-  mojo_callback = r;
-  ExampleMoveOnlyType m;
-  mojo_callback.Run(m.Clone());
-  EXPECT_EQ(1, calls);
-
-  base::Callback<void(ExampleMoveOnlyType)> base_callback =
-      base::Bind(&RunnableOneMoveOnlyParam::Run, base::Unretained(&r));
-  mojo_callback = base_callback;
-  mojo_callback.Run(m.Clone());
-  EXPECT_EQ(2, calls);
-}
-
-}  // namespace
-}  // namespace test
-}  // namespace common
-}  // namespace mojo
diff --git a/mojo/common/interface_ptr_set_unittest.cc b/mojo/common/interface_ptr_set_unittest.cc
index 8edd4ca..848b268 100644
--- a/mojo/common/interface_ptr_set_unittest.cc
+++ b/mojo/common/interface_ptr_set_unittest.cc
@@ -5,8 +5,8 @@
 #include "mojo/common/interface_ptr_set.h"
 
 #include "base/message_loop/message_loop.h"
-#include "mojo/common/message_pump_mojo.h"
 #include "mojo/common/test_interfaces.mojom.h"
+#include "mojo/message_pump/message_pump_mojo.h"
 #include "mojo/public/cpp/bindings/binding.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
diff --git a/mojo/converters/array_string/BUILD.gn b/mojo/converters/array_string/BUILD.gn
new file mode 100644
index 0000000..8a36103
--- /dev/null
+++ b/mojo/converters/array_string/BUILD.gn
@@ -0,0 +1,28 @@
+# Copyright 2015 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.
+
+source_set("array_string") {
+  sources = [
+    "array_string_type_converters.cc",
+    "array_string_type_converters.h",
+  ]
+
+  deps = [
+    "//base",
+    "//mojo/public/cpp/bindings",
+  ]
+}
+
+source_set("tests") {
+  testonly = true
+  sources = [
+    "array_string_type_converters_unittest.cc",
+  ]
+
+  deps = [
+    ":array_string",
+    "//base",
+    "//testing/gtest",
+  ]
+}
diff --git a/mojo/converters/array_string/array_string_type_converters.cc b/mojo/converters/array_string/array_string_type_converters.cc
new file mode 100644
index 0000000..02019f0
--- /dev/null
+++ b/mojo/converters/array_string/array_string_type_converters.cc
@@ -0,0 +1,29 @@
+// Copyright 2013 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.
+
+#include "mojo/converters/array_string/array_string_type_converters.h"
+
+#include <string>
+
+#include "base/strings/utf_string_conversions.h"
+
+namespace mojo {
+
+std::string TypeConverter<std::string, Array<uint8_t>>::Convert(
+    const Array<uint8_t>& input) {
+  if (input.is_null())
+    return std::string();
+
+  return std::string(reinterpret_cast<const char*>(&input.front()),
+                     input.size());
+}
+
+Array<uint8_t> TypeConverter<Array<uint8_t>, std::string>::Convert(
+    const std::string& input) {
+  Array<uint8_t> result(input.size());
+  memcpy(&result.front(), input.c_str(), input.size());
+  return result.Pass();
+}
+
+}  // namespace mojo
diff --git a/mojo/converters/array_string/array_string_type_converters.h b/mojo/converters/array_string/array_string_type_converters.h
new file mode 100644
index 0000000..f5e1996
--- /dev/null
+++ b/mojo/converters/array_string/array_string_type_converters.h
@@ -0,0 +1,32 @@
+// Copyright 2013 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.
+
+#ifndef MOJO_CONVERTERS_ARRAY_STRING_ARRAY_STRING_TYPE_CONVERTERS_H_
+#define MOJO_CONVERTERS_ARRAY_STRING_ARRAY_STRING_TYPE_CONVERTERS_H_
+
+#include "base/strings/string16.h"
+#include "base/strings/string_piece.h"
+#include "mojo/public/cpp/bindings/array.h"
+#include "mojo/public/cpp/bindings/string.h"
+#include "mojo/public/cpp/bindings/type_converter.h"
+
+namespace mojo {
+
+// TODO(erg): In the very long term, we will want to remove conversion between
+// std::strings and arrays of unsigned bytes. However, there is too much code
+// across chrome which uses std::string as a bag of bytes that we probably
+// don't want to roll this function at each callsite.
+template <>
+struct TypeConverter<std::string, Array<uint8_t>> {
+  static std::string Convert(const Array<uint8_t>& input);
+};
+
+template <>
+struct TypeConverter<Array<uint8_t>, std::string> {
+  static Array<uint8_t> Convert(const std::string& input);
+};
+
+}  // namespace mojo
+
+#endif  // MOJO_CONVERTERS_ARRAY_STRING_ARRAY_STRING_TYPE_CONVERTERS_H_
diff --git a/mojo/converters/array_string/array_string_type_converters_unittest.cc b/mojo/converters/array_string/array_string_type_converters_unittest.cc
new file mode 100644
index 0000000..a28f571
--- /dev/null
+++ b/mojo/converters/array_string/array_string_type_converters_unittest.cc
@@ -0,0 +1,38 @@
+// Copyright 2013 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.
+
+#include "mojo/converters/array_string/array_string_type_converters.h"
+
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace mojo {
+namespace common {
+namespace test {
+namespace {
+
+TEST(CommonTypeConvertersTest, ArrayUint8ToStdString) {
+  Array<uint8_t> data(4);
+  data[0] = 'd';
+  data[1] = 'a';
+  data[2] = 't';
+  data[3] = 'a';
+
+  EXPECT_EQ("data", data.To<std::string>());
+}
+
+TEST(CommonTypeConvertersTest, StdStringToArrayUint8) {
+  std::string input("data");
+  Array<uint8_t> data = Array<uint8_t>::From(input);
+
+  ASSERT_EQ(4ul, data.size());
+  EXPECT_EQ('d', data[0]);
+  EXPECT_EQ('a', data[1]);
+  EXPECT_EQ('t', data[2]);
+  EXPECT_EQ('a', data[3]);
+}
+
+}  // namespace
+}  // namespace test
+}  // namespace common
+}  // namespace mojo
diff --git a/mojo/converters/base/BUILD.gn b/mojo/converters/base/BUILD.gn
new file mode 100644
index 0000000..3779edf
--- /dev/null
+++ b/mojo/converters/base/BUILD.gn
@@ -0,0 +1,30 @@
+# Copyright 2015 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.
+
+source_set("base") {
+  sources = [
+    "base_type_converters.cc",
+    "base_type_converters.h",
+  ]
+
+  deps = [
+    "//base",
+    "//mojo/public/cpp/bindings",
+  ]
+}
+
+source_set("tests") {
+  testonly = true
+
+  sources = [
+    "base_type_converters_unittest.cc",
+  ]
+
+  deps = [
+    ":base",
+    "//base",
+    "//mojo/public/cpp/bindings",
+    "//testing/gtest",
+  ]
+}
diff --git a/mojo/converters/base/base_type_converters.cc b/mojo/converters/base/base_type_converters.cc
new file mode 100644
index 0000000..d4649ce
--- /dev/null
+++ b/mojo/converters/base/base_type_converters.cc
@@ -0,0 +1,40 @@
+// Copyright 2015 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.
+
+#include "mojo/converters/base/base_type_converters.h"
+
+#include <string>
+
+#include "base/strings/utf_string_conversions.h"
+
+namespace mojo {
+
+// static
+String TypeConverter<String, base::StringPiece>::Convert(
+    const base::StringPiece& input) {
+  if (input.empty()) {
+    char c = 0;
+    return String(&c, 0);
+  }
+  return String(input.data(), input.size());
+}
+// static
+base::StringPiece TypeConverter<base::StringPiece, String>::Convert(
+    const String& input) {
+  return input.get();
+}
+
+// static
+String TypeConverter<String, base::string16>::Convert(
+    const base::string16& input) {
+  return TypeConverter<String, base::StringPiece>::Convert(
+      base::UTF16ToUTF8(input));
+}
+// static
+base::string16 TypeConverter<base::string16, String>::Convert(
+    const String& input) {
+  return base::UTF8ToUTF16(input.To<base::StringPiece>());
+}
+
+}  // namespace mojo
diff --git a/mojo/converters/base/base_type_converters.h b/mojo/converters/base/base_type_converters.h
new file mode 100644
index 0000000..c83bc90
--- /dev/null
+++ b/mojo/converters/base/base_type_converters.h
@@ -0,0 +1,38 @@
+// Copyright 2015 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.
+
+#ifndef MOJO_CONVERTERS_BASE_BASE_TYPE_CONVERTERS_H_
+#define MOJO_CONVERTERS_BASE_BASE_TYPE_CONVERTERS_H_
+
+#include "base/strings/string16.h"
+#include "base/strings/string_piece.h"
+#include "mojo/public/cpp/bindings/array.h"
+#include "mojo/public/cpp/bindings/string.h"
+#include "mojo/public/cpp/bindings/type_converter.h"
+
+namespace mojo {
+
+template <>
+struct TypeConverter<String, base::StringPiece> {
+  static String Convert(const base::StringPiece& input);
+};
+
+template <>
+struct TypeConverter<base::StringPiece, String> {
+  static base::StringPiece Convert(const String& input);
+};
+
+template <>
+struct TypeConverter<String, base::string16> {
+  static String Convert(const base::string16& input);
+};
+
+template <>
+struct TypeConverter<base::string16, String> {
+  static base::string16 Convert(const String& input);
+};
+
+}  // namespace mojo
+
+#endif  // MOJO_CONVERTERS_BASE_BASE_TYPE_CONVERTERS_H_
diff --git a/mojo/converters/base/base_type_converters_unittest.cc b/mojo/converters/base/base_type_converters_unittest.cc
new file mode 100644
index 0000000..351eebc
--- /dev/null
+++ b/mojo/converters/base/base_type_converters_unittest.cc
@@ -0,0 +1,66 @@
+// Copyright 2013 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.
+
+#include "mojo/converters/base/base_type_converters.h"
+
+#include "base/bind.h"
+#include "base/strings/utf_string_conversions.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace mojo {
+namespace {
+
+void ExpectEqualsStringPiece(const std::string& expected,
+                             const base::StringPiece& str) {
+  EXPECT_EQ(expected, str.as_string());
+}
+
+void ExpectEqualsMojoString(const std::string& expected, const String& str) {
+  EXPECT_EQ(expected, str.get());
+}
+
+void ExpectEqualsString16(const base::string16& expected,
+                          const base::string16& actual) {
+  EXPECT_EQ(expected, actual);
+}
+
+void ExpectEqualsMojoString(const base::string16& expected, const String& str) {
+  EXPECT_EQ(expected, str.To<base::string16>());
+}
+
+TEST(BaseTypeConvertersTest, StringPiece) {
+  std::string kText("hello world");
+
+  base::StringPiece string_piece(kText);
+  String mojo_string(String::From(string_piece));
+
+  ExpectEqualsMojoString(kText, mojo_string);
+  ExpectEqualsStringPiece(kText, mojo_string.To<base::StringPiece>());
+
+  // Test implicit construction and conversion:
+  ExpectEqualsMojoString(kText, String::From(string_piece));
+  ExpectEqualsStringPiece(kText, mojo_string.To<base::StringPiece>());
+
+  // Test null String:
+  base::StringPiece empty_string_piece = String().To<base::StringPiece>();
+  EXPECT_TRUE(empty_string_piece.empty());
+}
+
+TEST(BaseTypeConvertersTest, String16) {
+  const base::string16 string16(base::ASCIIToUTF16("hello world"));
+  const String mojo_string(String::From(string16));
+
+  ExpectEqualsMojoString(string16, mojo_string);
+  EXPECT_EQ(string16, mojo_string.To<base::string16>());
+
+  // Test implicit construction and conversion:
+  ExpectEqualsMojoString(string16, String::From(string16));
+  ExpectEqualsString16(string16, mojo_string.To<base::string16>());
+
+  // Test empty string conversion.
+  ExpectEqualsMojoString(base::string16(), String::From(base::string16()));
+}
+
+}  // namespace
+}  // namespace mojo
diff --git a/mojo/converters/url/BUILD.gn b/mojo/converters/url/BUILD.gn
new file mode 100644
index 0000000..4082c67
--- /dev/null
+++ b/mojo/converters/url/BUILD.gn
@@ -0,0 +1,30 @@
+# Copyright 2015 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.
+
+source_set("url") {
+  sources = [
+    "url_type_converters.cc",
+    "url_type_converters.h",
+  ]
+
+  deps = [
+    "//mojo/public/cpp/bindings",
+    "//url",
+  ]
+}
+
+source_set("tests") {
+  testonly = true
+
+  sources = [
+    "url_type_converters_unittest.cc",
+  ]
+
+  deps = [
+    ":url",
+    "//mojo/public/cpp/bindings",
+    "//testing/gtest",
+    "//url",
+  ]
+}
diff --git a/mojo/converters/url/url_type_converters.cc b/mojo/converters/url/url_type_converters.cc
new file mode 100644
index 0000000..8b504ff
--- /dev/null
+++ b/mojo/converters/url/url_type_converters.cc
@@ -0,0 +1,19 @@
+// Copyright 2015 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.
+
+#include "mojo/converters/url/url_type_converters.h"
+
+#include "url/gurl.h"
+
+namespace mojo {
+
+String TypeConverter<String, GURL>::Convert(const GURL& input) {
+  return String(input.spec());
+}
+
+GURL TypeConverter<GURL, String>::Convert(const String& input) {
+  return GURL(input.get());
+}
+
+}  // namespace mojo
diff --git a/mojo/converters/url/url_type_converters.h b/mojo/converters/url/url_type_converters.h
new file mode 100644
index 0000000..7842d54
--- /dev/null
+++ b/mojo/converters/url/url_type_converters.h
@@ -0,0 +1,26 @@
+// Copyright 2015 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.
+
+#ifndef MOJO_CONVERTERS_URL_URL_TYPE_CONVERTERS_H_
+#define MOJO_CONVERTERS_URL_URL_TYPE_CONVERTERS_H_
+
+#include "mojo/public/cpp/bindings/type_converter.h"
+#include "mojo/public/cpp/bindings/string.h"
+
+class GURL;
+
+namespace mojo {
+template <>
+struct TypeConverter<String, GURL> {
+  static String Convert(const GURL& input);
+};
+
+template <>
+struct TypeConverter<GURL, String> {
+  static GURL Convert(const String& input);
+};
+
+}  // namespace mojo
+
+#endif  // MOJO_CONVERTERS_URL_URL_TYPE_CONVERTERS_H_
diff --git a/mojo/converters/url/url_type_converters_unittest.cc b/mojo/converters/url/url_type_converters_unittest.cc
new file mode 100644
index 0000000..bc94074
--- /dev/null
+++ b/mojo/converters/url/url_type_converters_unittest.cc
@@ -0,0 +1,31 @@
+// Copyright 2015 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.
+
+#include "mojo/converters/url/url_type_converters.h"
+
+#include "mojo/public/cpp/bindings/string.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "url/gurl.h"
+
+namespace mojo {
+namespace {
+
+TEST(UrlTypeConvertersTest, URL) {
+  GURL url("mojo:foo");
+  String mojo_string(String::From(url));
+
+  ASSERT_EQ(url.spec(), mojo_string);
+  EXPECT_EQ(url.spec(), mojo_string.To<GURL>().spec());
+  EXPECT_EQ(url.spec(), String::From(url));
+
+  GURL invalid = String().To<GURL>();
+  ASSERT_TRUE(invalid.spec().empty());
+
+  String string_from_invalid = String::From(invalid);
+  EXPECT_FALSE(string_from_invalid.is_null());
+  ASSERT_EQ(0U, string_from_invalid.size());
+}
+
+}  // namespace
+}  // namespace mojo
diff --git a/mojo/dart/embedder/BUILD.gn b/mojo/dart/embedder/BUILD.gn
index 97f441f..bb1c512 100644
--- a/mojo/dart/embedder/BUILD.gn
+++ b/mojo/dart/embedder/BUILD.gn
@@ -43,7 +43,7 @@
     "//dart/runtime:libdart",
     "//dart/runtime/bin:libdart_embedder_noio",
     "//third_party/dart-pkg",
-    "//mojo/common",
+    "//mojo/message_pump",
     "//mojo/public/c/system",
     "//mojo/public/cpp/system",
     "//mojo/services/network/public/interfaces",
diff --git a/mojo/dart/embedder/dart_controller.cc b/mojo/dart/embedder/dart_controller.cc
index eb9c05e..ad86db9 100644
--- a/mojo/dart/embedder/dart_controller.cc
+++ b/mojo/dart/embedder/dart_controller.cc
@@ -13,11 +13,11 @@
 #include "base/sys_info.h"
 #include "dart/runtime/include/dart_api.h"
 #include "dart/runtime/include/dart_native_api.h"
-#include "mojo/common/message_pump_mojo.h"
 #include "mojo/dart/embedder/builtin.h"
 #include "mojo/dart/embedder/dart_controller.h"
 #include "mojo/dart/embedder/mojo_dart_state.h"
 #include "mojo/dart/embedder/vmservice.h"
+#include "mojo/message_pump/message_pump_mojo.h"
 #include "mojo/public/c/system/core.h"
 #include "tonic/dart_converter.h"
 #include "tonic/dart_debugger.h"
diff --git a/mojo/data_pipe_utils/BUILD.gn b/mojo/data_pipe_utils/BUILD.gn
new file mode 100644
index 0000000..d9b5dea
--- /dev/null
+++ b/mojo/data_pipe_utils/BUILD.gn
@@ -0,0 +1,39 @@
+# Copyright 2015 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.
+
+source_set("data_pipe_utils") {
+  sources = [
+    "data_pipe_drainer.cc",
+    "data_pipe_drainer.h",
+    "data_pipe_file_utils.cc",
+    "data_pipe_utils.cc",
+    "data_pipe_utils.h",
+    "data_pipe_utils_internal.h",
+  ]
+
+  if (is_nacl) {
+    sources -= [ "data_pipe_file_utils.cc" ]
+  }
+
+  deps = [
+    "//base",
+    "//mojo/message_pump",
+    "//mojo/public/cpp/environment:environment",
+    "//mojo/public/cpp/system",
+  ]
+}
+
+source_set("tests") {
+  testonly = true
+
+  sources = [
+    "data_pipe_utils_unittest.cc",
+  ]
+
+  deps = [
+    ":data_pipe_utils",
+    "//base",
+    "//testing/gtest",
+  ]
+}
diff --git a/mojo/common/data_pipe_drainer.cc b/mojo/data_pipe_utils/data_pipe_drainer.cc
similarity index 73%
rename from mojo/common/data_pipe_drainer.cc
rename to mojo/data_pipe_utils/data_pipe_drainer.cc
index 5477109..8ed8b2d 100644
--- a/mojo/common/data_pipe_drainer.cc
+++ b/mojo/data_pipe_utils/data_pipe_drainer.cc
@@ -2,7 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "mojo/common/data_pipe_drainer.h"
+#include "mojo/data_pipe_utils/data_pipe_drainer.h"
+
 #include "base/bind.h"
 
 namespace mojo {
@@ -10,21 +11,18 @@
 
 DataPipeDrainer::DataPipeDrainer(Client* client,
                                  mojo::ScopedDataPipeConsumerHandle source)
-    : client_(client),
-      source_(source.Pass()),
-      weak_factory_(this) {
+    : client_(client), source_(source.Pass()), weak_factory_(this) {
   DCHECK(client_);
   ReadData();
 }
 
-DataPipeDrainer::~DataPipeDrainer() {
-}
+DataPipeDrainer::~DataPipeDrainer() {}
 
 void DataPipeDrainer::ReadData() {
   const void* buffer = nullptr;
   uint32_t num_bytes = 0;
-  MojoResult rv = BeginReadDataRaw(source_.get(),
-      &buffer, &num_bytes, MOJO_READ_DATA_FLAG_NONE);
+  MojoResult rv = BeginReadDataRaw(source_.get(), &buffer, &num_bytes,
+                                   MOJO_READ_DATA_FLAG_NONE);
   if (rv == MOJO_RESULT_OK) {
     client_->OnDataAvailable(buffer, num_bytes);
     EndReadDataRaw(source_.get(), num_bytes);
@@ -39,8 +37,8 @@
 }
 
 void DataPipeDrainer::WaitForData() {
-  handle_watcher_.Start(source_.get(),
-      MOJO_HANDLE_SIGNAL_READABLE, MOJO_DEADLINE_INDEFINITE,
+  handle_watcher_.Start(
+      source_.get(), MOJO_HANDLE_SIGNAL_READABLE, MOJO_DEADLINE_INDEFINITE,
       base::Bind(&DataPipeDrainer::WaitComplete, weak_factory_.GetWeakPtr()));
 }
 
diff --git a/mojo/common/data_pipe_drainer.h b/mojo/data_pipe_utils/data_pipe_drainer.h
similarity index 80%
rename from mojo/common/data_pipe_drainer.h
rename to mojo/data_pipe_utils/data_pipe_drainer.h
index c9669be..80cb933 100644
--- a/mojo/common/data_pipe_drainer.h
+++ b/mojo/data_pipe_utils/data_pipe_drainer.h
@@ -2,11 +2,11 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef MOJO_COMMON_DATA_PIPE_DRAINER_H_
-#define MOJO_COMMON_DATA_PIPE_DRAINER_H_
+#ifndef MOJO_DATA_PIPE_UTILS_DATA_PIPE_DRAINER_H_
+#define MOJO_DATA_PIPE_UTILS_DATA_PIPE_DRAINER_H_
 
 #include "base/memory/weak_ptr.h"
-#include "mojo/common/handle_watcher.h"
+#include "mojo/message_pump/handle_watcher.h"
 #include "mojo/public/cpp/system/core.h"
 
 namespace mojo {
@@ -20,7 +20,7 @@
     virtual void OnDataComplete() = 0;
 
    protected:
-    virtual ~Client() { }
+    virtual ~Client() {}
   };
 
   DataPipeDrainer(Client*, mojo::ScopedDataPipeConsumerHandle source);
@@ -43,4 +43,4 @@
 }  // namespace common
 }  // namespace mojo
 
-#endif  // MOJO_COMMON_DATA_PIPE_DRAINER_H_
+#endif  // MOJO_DATA_PIPE_UTILS_DATA_PIPE_DRAINER_H_
diff --git a/mojo/common/data_pipe_file_utils.cc b/mojo/data_pipe_utils/data_pipe_file_utils.cc
similarity index 98%
rename from mojo/common/data_pipe_file_utils.cc
rename to mojo/data_pipe_utils/data_pipe_file_utils.cc
index aa14225..e37c8df 100644
--- a/mojo/common/data_pipe_file_utils.cc
+++ b/mojo/data_pipe_utils/data_pipe_file_utils.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "mojo/common/data_pipe_utils.h"
+#include "mojo/data_pipe_utils/data_pipe_utils.h"
 
 #include <stdio.h>
 
@@ -14,7 +14,7 @@
 #include "base/files/scoped_file.h"
 #include "base/location.h"
 #include "base/trace_event/trace_event.h"
-#include "mojo/common/data_pipe_utils_internal.h"
+#include "mojo/data_pipe_utils/data_pipe_utils_internal.h"
 #include "mojo/public/cpp/environment/async_waiter.h"
 
 namespace mojo {
diff --git a/mojo/common/data_pipe_utils.cc b/mojo/data_pipe_utils/data_pipe_utils.cc
similarity index 82%
rename from mojo/common/data_pipe_utils.cc
rename to mojo/data_pipe_utils/data_pipe_utils.cc
index daaef2c..af9f206 100644
--- a/mojo/common/data_pipe_utils.cc
+++ b/mojo/data_pipe_utils/data_pipe_utils.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "mojo/common/data_pipe_utils.h"
+#include "mojo/data_pipe_utils/data_pipe_utils.h"
 
 #include <stdio.h>
 
@@ -10,18 +10,19 @@
 #include "base/task_runner_util.h"
 #include "base/threading/platform_thread.h"
 #include "base/trace_event/trace_event.h"
-#include "mojo/common/data_pipe_utils_internal.h"
+#include "mojo/data_pipe_utils/data_pipe_utils_internal.h"
 
 namespace mojo {
 namespace common {
 
-bool BlockingCopyHelper(ScopedDataPipeConsumerHandle source,
+bool BlockingCopyHelper(
+    ScopedDataPipeConsumerHandle source,
     const base::Callback<size_t(const void*, uint32_t)>& write_bytes) {
   for (;;) {
     const void* buffer = nullptr;
     uint32_t num_bytes = 0;
-    MojoResult result = BeginReadDataRaw(
-        source.get(), &buffer, &num_bytes, MOJO_READ_DATA_FLAG_NONE);
+    MojoResult result = BeginReadDataRaw(source.get(), &buffer, &num_bytes,
+                                         MOJO_READ_DATA_FLAG_NONE);
     if (result == MOJO_RESULT_OK) {
       size_t bytes_written = write_bytes.Run(buffer, num_bytes);
       if (bytes_written < num_bytes) {
@@ -39,10 +40,8 @@
         return false;
       }
     } else if (result == MOJO_RESULT_SHOULD_WAIT) {
-      result = Wait(source.get(),
-                    MOJO_HANDLE_SIGNAL_READABLE,
-                    MOJO_DEADLINE_INDEFINITE,
-                    nullptr);
+      result = Wait(source.get(), MOJO_HANDLE_SIGNAL_READABLE,
+                    MOJO_DEADLINE_INDEFINITE, nullptr);
       if (result != MOJO_RESULT_OK) {
         // If the producer handle was closed, then treat as EOF.
         return result == MOJO_RESULT_FAILED_PRECONDITION;
@@ -60,13 +59,14 @@
 
 namespace {
 
-size_t CopyToStringHelper(
-    std::string* result, const void* buffer, uint32_t num_bytes) {
+size_t CopyToStringHelper(std::string* result,
+                          const void* buffer,
+                          uint32_t num_bytes) {
   result->append(static_cast<const char*>(buffer), num_bytes);
   return num_bytes;
 }
 
-} // namespace
+}  // namespace
 
 // TODO(hansmuller): Add a max_size parameter.
 bool BlockingCopyToString(ScopedDataPipeConsumerHandle source,
@@ -74,8 +74,8 @@
   TRACE_EVENT0("data_pipe_utils", "BlockingCopyToString");
   CHECK(result);
   result->clear();
-  return BlockingCopyHelper(
-      source.Pass(), base::Bind(&CopyToStringHelper, result));
+  return BlockingCopyHelper(source.Pass(),
+                            base::Bind(&CopyToStringHelper, result));
 }
 
 bool BlockingCopyFromString(const std::string& source,
diff --git a/mojo/common/data_pipe_utils.h b/mojo/data_pipe_utils/data_pipe_utils.h
similarity index 92%
rename from mojo/common/data_pipe_utils.h
rename to mojo/data_pipe_utils/data_pipe_utils.h
index 08e6fa0..289fe12 100644
--- a/mojo/common/data_pipe_utils.h
+++ b/mojo/data_pipe_utils/data_pipe_utils.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef MOJO_SHELL_DATA_PIPE_UTILS_H_
-#define MOJO_SHELL_DATA_PIPE_UTILS_H_
+#ifndef MOJO_DATA_PIPE_UTILS_DATA_PIPE_UTILS_H_
+#define MOJO_DATA_PIPE_UTILS_DATA_PIPE_UTILS_H_
 
 #include <string>
 
@@ -51,4 +51,4 @@
 }  // namespace common
 }  // namespace mojo
 
-#endif  // MOJO_SHELL_DATA_PIPE_UTILS_H_
+#endif  // MOJO_DATA_PIPE_UTILS_DATA_PIPE_UTILS_H_
diff --git a/mojo/common/data_pipe_utils_internal.h b/mojo/data_pipe_utils/data_pipe_utils_internal.h
similarity index 75%
rename from mojo/common/data_pipe_utils_internal.h
rename to mojo/data_pipe_utils/data_pipe_utils_internal.h
index 26164ec..40086fb 100644
--- a/mojo/common/data_pipe_utils_internal.h
+++ b/mojo/data_pipe_utils/data_pipe_utils_internal.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef MOJO_COMMON_DATA_PIPE_UTILS_INTERNAL_H_
-#define MOJO_COMMON_DATA_PIPE_UTILS_INTERNAL_H_
+#ifndef MOJO_DATA_PIPE_UTILS_DATA_PIPE_UTILS_INTERNAL_H_
+#define MOJO_DATA_PIPE_UTILS_DATA_PIPE_UTILS_INTERNAL_H_
 
 #include "base/callback_forward.h"
 #include "mojo/public/cpp/system/core.h"
@@ -19,4 +19,4 @@
 }  // namespace common
 }  // namespace mojo
 
-#endif  // MOJO_COMMON_DATA_PIPE_UTILS_INTERNAL_H_
+#endif  // MOJO_DATA_PIPE_UTILS_DATA_PIPE_UTILS_INTERNAL_H_
diff --git a/mojo/common/data_pipe_utils_unittest.cc b/mojo/data_pipe_utils/data_pipe_utils_unittest.cc
similarity index 97%
rename from mojo/common/data_pipe_utils_unittest.cc
rename to mojo/data_pipe_utils/data_pipe_utils_unittest.cc
index edfc2c4..6c0f600 100644
--- a/mojo/common/data_pipe_utils_unittest.cc
+++ b/mojo/data_pipe_utils/data_pipe_utils_unittest.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "mojo/common/data_pipe_utils.h"
+#include "mojo/data_pipe_utils/data_pipe_utils.h"
 
 #include "base/bind.h"
 #include "base/files/file_util.h"
diff --git a/mojo/environment/BUILD.gn b/mojo/environment/BUILD.gn
index 5371935..5c7a9f0 100644
--- a/mojo/environment/BUILD.gn
+++ b/mojo/environment/BUILD.gn
@@ -3,8 +3,6 @@
 # found in the LICENSE file.
 
 source_set("chromium") {
-  output_name = "mojo_environment_chromium"
-
   sources = [
     "default_async_waiter.cc",
     "default_async_waiter.h",
@@ -27,6 +25,7 @@
     "//base",
     "//base/third_party/dynamic_annotations",
     "//mojo/common",
+    "//mojo/message_pump",
     "//mojo/public/c/environment",
     "//mojo/public/cpp/bindings:callback",
     "//mojo/public/cpp/environment",
diff --git a/mojo/environment/default_async_waiter.cc b/mojo/environment/default_async_waiter.cc
index 863cfe3..014e5c1 100644
--- a/mojo/environment/default_async_waiter.cc
+++ b/mojo/environment/default_async_waiter.cc
@@ -5,7 +5,7 @@
 #include "mojo/environment/default_async_waiter.h"
 
 #include "base/bind.h"
-#include "mojo/common/handle_watcher.h"
+#include "mojo/message_pump/handle_watcher.h"
 #include "mojo/public/c/environment/async_waiter.h"
 
 namespace mojo {
diff --git a/mojo/message_pump/BUILD.gn b/mojo/message_pump/BUILD.gn
new file mode 100644
index 0000000..14daad6
--- /dev/null
+++ b/mojo/message_pump/BUILD.gn
@@ -0,0 +1,39 @@
+# Copyright 2015 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.
+
+source_set("message_pump") {
+  sources = [
+    "handle_watcher.cc",
+    "handle_watcher.h",
+    "message_pump_mojo.cc",
+    "message_pump_mojo.h",
+    "message_pump_mojo_handler.h",
+    "time_helper.cc",
+    "time_helper.h",
+  ]
+
+  deps = [
+    "//base",
+    "//mojo/public/cpp/system",
+  ]
+}
+
+source_set("tests") {
+  testonly = true
+
+  sources = [
+    "handle_watcher_unittest.cc",
+    "message_pump_mojo_unittest.cc",
+  ]
+
+  deps = [
+    ":message_pump",
+    "//base",
+    "//base/test:test_support",
+    "//base:message_loop_tests",
+    "//mojo/public/cpp/system",
+    "//mojo/public/cpp/test_support:test_utils",
+    "//testing/gtest",
+  ]
+}
diff --git a/mojo/common/handle_watcher.cc b/mojo/message_pump/handle_watcher.cc
similarity index 98%
rename from mojo/common/handle_watcher.cc
rename to mojo/message_pump/handle_watcher.cc
index c7fa81f..2465579 100644
--- a/mojo/common/handle_watcher.cc
+++ b/mojo/message_pump/handle_watcher.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "mojo/common/handle_watcher.h"
+#include "mojo/message_pump/handle_watcher.h"
 
 #include <map>
 
@@ -20,9 +20,9 @@
 #include "base/threading/thread.h"
 #include "base/threading/thread_restrictions.h"
 #include "base/time/time.h"
-#include "mojo/common/message_pump_mojo.h"
-#include "mojo/common/message_pump_mojo_handler.h"
-#include "mojo/common/time_helper.h"
+#include "mojo/message_pump/message_pump_mojo.h"
+#include "mojo/message_pump/message_pump_mojo_handler.h"
+#include "mojo/message_pump/time_helper.h"
 
 namespace mojo {
 namespace common {
diff --git a/mojo/common/handle_watcher.h b/mojo/message_pump/handle_watcher.h
similarity index 92%
rename from mojo/common/handle_watcher.h
rename to mojo/message_pump/handle_watcher.h
index fb89716..f024d94 100644
--- a/mojo/common/handle_watcher.h
+++ b/mojo/message_pump/handle_watcher.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef MOJO_COMMON_HANDLE_WATCHER_H_
-#define MOJO_COMMON_HANDLE_WATCHER_H_
+#ifndef MOJO_MESSAGE_PUMP_HANDLE_WATCHER_H_
+#define MOJO_MESSAGE_PUMP_HANDLE_WATCHER_H_
 
 #include "base/basictypes.h"
 #include "base/callback_forward.h"
@@ -60,4 +60,4 @@
 }  // namespace common
 }  // namespace mojo
 
-#endif  // MOJO_COMMON_HANDLE_WATCHER_H_
+#endif  // MOJO_MESSAGE_PUMP_HANDLE_WATCHER_H_
diff --git a/mojo/common/handle_watcher_unittest.cc b/mojo/message_pump/handle_watcher_unittest.cc
similarity index 98%
rename from mojo/common/handle_watcher_unittest.cc
rename to mojo/message_pump/handle_watcher_unittest.cc
index 46d2a27..36f15ac 100644
--- a/mojo/common/handle_watcher_unittest.cc
+++ b/mojo/message_pump/handle_watcher_unittest.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "mojo/common/handle_watcher.h"
+#include "mojo/message_pump/handle_watcher.h"
 
 #include <string>
 
@@ -13,8 +13,8 @@
 #include "base/run_loop.h"
 #include "base/test/simple_test_tick_clock.h"
 #include "base/threading/thread.h"
-#include "mojo/common/message_pump_mojo.h"
-#include "mojo/common/time_helper.h"
+#include "mojo/message_pump/message_pump_mojo.h"
+#include "mojo/message_pump/time_helper.h"
 #include "mojo/public/cpp/system/core.h"
 #include "mojo/public/cpp/test_support/test_utils.h"
 #include "testing/gtest/include/gtest/gtest.h"
diff --git a/mojo/common/message_pump_mojo.cc b/mojo/message_pump/message_pump_mojo.cc
similarity index 98%
rename from mojo/common/message_pump_mojo.cc
rename to mojo/message_pump/message_pump_mojo.cc
index 544960b..e7f7d10 100644
--- a/mojo/common/message_pump_mojo.cc
+++ b/mojo/message_pump/message_pump_mojo.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "mojo/common/message_pump_mojo.h"
+#include "mojo/message_pump/message_pump_mojo.h"
 
 #include <algorithm>
 #include <vector>
@@ -12,8 +12,8 @@
 #include "base/logging.h"
 #include "base/threading/thread_local.h"
 #include "base/time/time.h"
-#include "mojo/common/message_pump_mojo_handler.h"
-#include "mojo/common/time_helper.h"
+#include "mojo/message_pump/message_pump_mojo_handler.h"
+#include "mojo/message_pump/time_helper.h"
 
 namespace mojo {
 namespace common {
diff --git a/mojo/common/message_pump_mojo.h b/mojo/message_pump/message_pump_mojo.h
similarity index 96%
rename from mojo/common/message_pump_mojo.h
rename to mojo/message_pump/message_pump_mojo.h
index fc1e40b..522b0e5 100644
--- a/mojo/common/message_pump_mojo.h
+++ b/mojo/message_pump/message_pump_mojo.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef MOJO_COMMON_MESSAGE_PUMP_MOJO_H_
-#define MOJO_COMMON_MESSAGE_PUMP_MOJO_H_
+#ifndef MOJO_MESSAGE_PUMP_MESSAGE_PUMP_MOJO_H_
+#define MOJO_MESSAGE_PUMP_MESSAGE_PUMP_MOJO_H_
 
 #include <map>
 #include <utility>
@@ -135,4 +135,4 @@
 }  // namespace common
 }  // namespace mojo
 
-#endif  // MOJO_COMMON_MESSAGE_PUMP_MOJO_H_
+#endif  // MOJO_MESSAGE_PUMP_MESSAGE_PUMP_MOJO_H_
diff --git a/mojo/common/message_pump_mojo_handler.h b/mojo/message_pump/message_pump_mojo_handler.h
similarity index 79%
rename from mojo/common/message_pump_mojo_handler.h
rename to mojo/message_pump/message_pump_mojo_handler.h
index b55132d..3a4eccc 100644
--- a/mojo/common/message_pump_mojo_handler.h
+++ b/mojo/message_pump/message_pump_mojo_handler.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef MOJO_COMMON_MESSAGE_PUMP_MOJO_HANDLER_H_
-#define MOJO_COMMON_MESSAGE_PUMP_MOJO_HANDLER_H_
+#ifndef MOJO_MESSAGE_PUMP_MESSAGE_PUMP_MOJO_HANDLER_H_
+#define MOJO_MESSAGE_PUMP_MESSAGE_PUMP_MOJO_HANDLER_H_
 
 #include "mojo/public/cpp/system/core.h"
 
@@ -25,4 +25,4 @@
 }  // namespace common
 }  // namespace mojo
 
-#endif  // MOJO_COMMON_MESSAGE_PUMP_MOJO_HANDLER_H_
+#endif  // MOJO_MESSAGE_PUMP_MESSAGE_PUMP_MOJO_HANDLER_H_
diff --git a/mojo/common/message_pump_mojo_unittest.cc b/mojo/message_pump/message_pump_mojo_unittest.cc
similarity index 96%
rename from mojo/common/message_pump_mojo_unittest.cc
rename to mojo/message_pump/message_pump_mojo_unittest.cc
index 09cbe54..687d5f3 100644
--- a/mojo/common/message_pump_mojo_unittest.cc
+++ b/mojo/message_pump/message_pump_mojo_unittest.cc
@@ -2,11 +2,11 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "mojo/common/message_pump_mojo.h"
+#include "mojo/message_pump/message_pump_mojo.h"
 
 #include "base/message_loop/message_loop_test.h"
 #include "base/run_loop.h"
-#include "mojo/common/message_pump_mojo_handler.h"
+#include "mojo/message_pump/message_pump_mojo_handler.h"
 #include "mojo/public/cpp/system/core.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
diff --git a/mojo/common/time_helper.cc b/mojo/message_pump/time_helper.cc
similarity index 93%
rename from mojo/common/time_helper.cc
rename to mojo/message_pump/time_helper.cc
index 36fd087..ffd667e 100644
--- a/mojo/common/time_helper.cc
+++ b/mojo/message_pump/time_helper.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "mojo/common/time_helper.h"
+#include "mojo/message_pump/time_helper.h"
 
 #include "base/time/tick_clock.h"
 
diff --git a/mojo/common/time_helper.h b/mojo/message_pump/time_helper.h
similarity index 83%
rename from mojo/common/time_helper.h
rename to mojo/message_pump/time_helper.h
index 84029ec..dfdc7bb 100644
--- a/mojo/common/time_helper.h
+++ b/mojo/message_pump/time_helper.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef MOJO_COMMON_TIME_HELPER_H_
-#define MOJO_COMMON_TIME_HELPER_H_
+#ifndef MOJO_MESSAGE_PUMP_TIME_HELPER_H_
+#define MOJO_MESSAGE_PUMP_TIME_HELPER_H_
 
 #include "base/time/time.h"
 
@@ -30,4 +30,4 @@
 }  // namespace common
 }  // namespace mojo
 
-#endif  // MOJO_COMMON_TIME_HELPER_H_
+#endif  // MOJO_MESSAGE_PUMP_TIME_HELPER_H_
diff --git a/mojo/tests/BUILD.gn b/mojo/tests/BUILD.gn
index 03411fe..a752534 100644
--- a/mojo/tests/BUILD.gn
+++ b/mojo/tests/BUILD.gn
@@ -8,11 +8,11 @@
 test("mojo_task_tracker_perftests") {
   deps = [
     "//base/test:test_support",
-    "//mojo/common",
     "//mojo/edk/system",
     "//mojo/edk/test:test_support",
     "//mojo/edk/test:test_support_impl",
     "//mojo/environment:chromium",
+    "//mojo/message_pump",
     "//mojo/public/c/test_support",
     "//mojo/public/cpp/bindings",
     "//mojo/public/cpp/bindings:callback",
diff --git a/mojo/tests/task_tracker_perftest.cc b/mojo/tests/task_tracker_perftest.cc
index a2ffdb3..ff3e07e 100644
--- a/mojo/tests/task_tracker_perftest.cc
+++ b/mojo/tests/task_tracker_perftest.cc
@@ -8,7 +8,7 @@
 #include "base/message_loop/message_loop.h"
 #include "base/timer/elapsed_timer.h"
 #include "base/tracked_objects.h"
-#include "mojo/common/message_pump_mojo.h"
+#include "mojo/message_pump/message_pump_mojo.h"
 #include "mojo/public/cpp/bindings/binding.h"
 #include "mojo/public/cpp/environment/environment.h"
 #include "mojo/public/cpp/environment/task_tracker.h"
diff --git a/services/asset_bundle/BUILD.gn b/services/asset_bundle/BUILD.gn
index 8d98859..7c38a37 100644
--- a/services/asset_bundle/BUILD.gn
+++ b/services/asset_bundle/BUILD.gn
@@ -16,7 +16,7 @@
 
   deps = [
     "//base",
-    "//mojo/common",
+    "//mojo/data_pipe_utils",
     "//mojo/public/cpp/bindings:callback",
     "//mojo/public/cpp/system",
     "//mojo/services/asset_bundle/public/interfaces",
@@ -32,7 +32,6 @@
   deps = [
     "//base",
     "//mojo/application",
-    "//mojo/common",
     "//mojo/public/cpp/application",
     "//mojo/public/cpp/bindings:callback",
     "//mojo/public/cpp/system",
@@ -54,7 +53,7 @@
     "//base",
     "//mojo/application",
     "//mojo/application:test_support",
-    "//mojo/common",
+    "//mojo/data_pipe_utils",
     "//mojo/public/cpp/bindings",
     "//mojo/services/asset_bundle/public/interfaces",
     "//third_party/zlib:zip",
diff --git a/services/asset_bundle/asset_bundle_apptest.cc b/services/asset_bundle/asset_bundle_apptest.cc
index 4fd9849..c449796 100644
--- a/services/asset_bundle/asset_bundle_apptest.cc
+++ b/services/asset_bundle/asset_bundle_apptest.cc
@@ -7,8 +7,7 @@
 #include "base/files/file_util.h"
 #include "base/files/scoped_temp_dir.h"
 #include "base/run_loop.h"
-#include "mojo/common/common_type_converters.h"
-#include "mojo/common/data_pipe_utils.h"
+#include "mojo/data_pipe_utils/data_pipe_utils.h"
 #include "mojo/public/cpp/application/application_impl.h"
 #include "mojo/public/cpp/application/application_test_base.h"
 #include "mojo/services/asset_bundle/public/interfaces/asset_bundle.mojom.h"
diff --git a/services/asset_bundle/asset_bundle_impl.cc b/services/asset_bundle/asset_bundle_impl.cc
index 0c3bd34..8776641 100644
--- a/services/asset_bundle/asset_bundle_impl.cc
+++ b/services/asset_bundle/asset_bundle_impl.cc
@@ -8,7 +8,7 @@
 #include "base/files/file_path.h"
 #include "base/files/file_util.h"
 #include "base/logging.h"
-#include "mojo/common/data_pipe_utils.h"
+#include "mojo/data_pipe_utils/data_pipe_utils.h"
 
 namespace mojo {
 namespace asset_bundle {
diff --git a/services/asset_bundle/asset_unpacker_job.h b/services/asset_bundle/asset_unpacker_job.h
index 66c2b33..ed7cddc 100644
--- a/services/asset_bundle/asset_unpacker_job.h
+++ b/services/asset_bundle/asset_unpacker_job.h
@@ -9,7 +9,7 @@
 #include "base/macros.h"
 #include "base/memory/weak_ptr.h"
 #include "base/task_runner.h"
-#include "mojo/common/data_pipe_utils.h"
+#include "mojo/data_pipe_utils/data_pipe_utils.h"
 #include "mojo/public/cpp/bindings/interface_request.h"
 #include "mojo/services/asset_bundle/public/interfaces/asset_bundle.mojom.h"
 
diff --git a/services/clipboard/BUILD.gn b/services/clipboard/BUILD.gn
index 0955fb8..e986122 100644
--- a/services/clipboard/BUILD.gn
+++ b/services/clipboard/BUILD.gn
@@ -14,7 +14,6 @@
   deps = [
     "//base",
     "//mojo/application",
-    "//mojo/common",
     "//mojo/environment:chromium",
     "//mojo/public/cpp/bindings",
     "//mojo/public/cpp/bindings:callback",
@@ -35,7 +34,7 @@
     "//base",
     "//mojo/application",
     "//mojo/application:test_support",
-    "//mojo/common",
+    "//mojo/converters/array_string",
     "//mojo/public/cpp/bindings",
     "//mojo/services/clipboard/public/interfaces",
   ]
diff --git a/services/clipboard/clipboard_apptest.cc b/services/clipboard/clipboard_apptest.cc
index fbaa19b..b4691da 100644
--- a/services/clipboard/clipboard_apptest.cc
+++ b/services/clipboard/clipboard_apptest.cc
@@ -4,7 +4,7 @@
 
 #include "base/bind.h"
 #include "base/run_loop.h"
-#include "mojo/common/common_type_converters.h"
+#include "mojo/converters/array_string/array_string_type_converters.h"
 #include "mojo/public/cpp/application/application_impl.h"
 #include "mojo/public/cpp/application/application_test_base.h"
 #include "mojo/services/clipboard/public/interfaces/clipboard.mojom.h"
diff --git a/services/dart/BUILD.gn b/services/dart/BUILD.gn
index e710642..81d5cff 100644
--- a/services/dart/BUILD.gn
+++ b/services/dart/BUILD.gn
@@ -40,7 +40,7 @@
     "//mojo/application:application",
     "//mojo/application:content_handler",
     "//mojo/dart/embedder:dart_controller_no_snapshot",
-    "//mojo/common",
+    "//mojo/data_pipe_utils",
     "//mojo/common:tracing_impl",
     "//mojo/environment:chromium",
     "//mojo/public/cpp/system",
diff --git a/services/dart/dart_app.cc b/services/dart/dart_app.cc
index 029e86f..7d223f8 100644
--- a/services/dart/dart_app.cc
+++ b/services/dart/dart_app.cc
@@ -10,9 +10,9 @@
 #include "base/logging.h"
 #include "base/message_loop/message_loop.h"
 #include "base/path_service.h"
-#include "mojo/common/data_pipe_utils.h"
 #include "mojo/dart/embedder/dart_controller.h"
 #include "mojo/dart/embedder/mojo_dart_state.h"
+#include "mojo/data_pipe_utils/data_pipe_utils.h"
 #include "mojo/public/cpp/bindings/interface_request.h"
 #include "third_party/zlib/google/zip_reader.h"
 #include "url/gurl.h"
diff --git a/services/debugger/BUILD.gn b/services/debugger/BUILD.gn
index f55602e..0e78eb5 100644
--- a/services/debugger/BUILD.gn
+++ b/services/debugger/BUILD.gn
@@ -17,7 +17,7 @@
     "//base",
     "//base/allocator",
     "//mojo/application",
-    "//mojo/common",
+    "//mojo/data_pipe_utils",
     "//mojo/public/cpp/bindings",
     "//mojo/public/cpp/system",
     "//mojo/public/cpp/utility",
diff --git a/services/debugger/debugger.cc b/services/debugger/debugger.cc
index ccf131a..b03aa42 100644
--- a/services/debugger/debugger.cc
+++ b/services/debugger/debugger.cc
@@ -9,7 +9,7 @@
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/stringprintf.h"
 #include "mojo/application/application_runner_chromium.h"
-#include "mojo/common/data_pipe_utils.h"
+#include "mojo/data_pipe_utils/data_pipe_utils.h"
 #include "mojo/public/c/system/main.h"
 #include "mojo/public/cpp/application/application_delegate.h"
 #include "mojo/public/cpp/application/application_impl.h"
diff --git a/services/debugger/trace_collector.h b/services/debugger/trace_collector.h
index 43ea771..fe9cc8b 100644
--- a/services/debugger/trace_collector.h
+++ b/services/debugger/trace_collector.h
@@ -8,7 +8,7 @@
 #include <vector>
 
 #include "base/callback.h"
-#include "mojo/common/data_pipe_drainer.h"
+#include "mojo/data_pipe_utils/data_pipe_drainer.h"
 
 namespace debugger {
 
diff --git a/services/http_server/BUILD.gn b/services/http_server/BUILD.gn
index bd3d597..7bc38bb 100644
--- a/services/http_server/BUILD.gn
+++ b/services/http_server/BUILD.gn
@@ -21,6 +21,7 @@
   deps = [
     "//base",
     "//mojo/common",
+    "//mojo/data_pipe_utils",
     "//mojo/public/cpp/application:standalone",
     "//mojo/public/cpp/bindings",
     "//mojo/public/cpp/environment",
@@ -53,7 +54,7 @@
     "//base",
     "//mojo/application",
     "//mojo/application:test_support",
-    "//mojo/common",
+    "//mojo/data_pipe_utils",
     "//mojo/public/cpp/bindings:callback",
     "//mojo/public/cpp/environment",
     "//mojo/public/cpp/system",
diff --git a/services/http_server/http_server_apptest.cc b/services/http_server/http_server_apptest.cc
index 9827d42..58f1ff4 100644
--- a/services/http_server/http_server_apptest.cc
+++ b/services/http_server/http_server_apptest.cc
@@ -5,7 +5,7 @@
 #include "base/bind.h"
 #include "base/run_loop.h"
 #include "base/strings/stringprintf.h"
-#include "mojo/common/data_pipe_utils.h"
+#include "mojo/data_pipe_utils/data_pipe_utils.h"
 #include "mojo/public/cpp/application/application_impl.h"
 #include "mojo/public/cpp/application/application_test_base.h"
 #include "mojo/public/cpp/system/macros.h"
diff --git a/services/js/BUILD.gn b/services/js/BUILD.gn
index 8e39ac0..c58ac14 100644
--- a/services/js/BUILD.gn
+++ b/services/js/BUILD.gn
@@ -25,11 +25,11 @@
   deps = [
     "//base:i18n",
     "//mojo/application",
-    "//mojo/application:application",
     "//mojo/application:content_handler",
-    "//mojo/common",
+    "//mojo/data_pipe_utils",
     "//mojo/edk/js/",
     "//mojo/environment:chromium",
+    "//mojo/message_pump",
     "//mojo/public/cpp/system",
     "//mojo/public/cpp/utility",
     "//mojo/public/interfaces/application",
diff --git a/services/js/js_app.cc b/services/js/js_app.cc
index ada7d20..0dcb942 100644
--- a/services/js/js_app.cc
+++ b/services/js/js_app.cc
@@ -9,7 +9,7 @@
 #include "gin/converter.h"
 #include "gin/modules/module_registry.h"
 #include "gin/try_catch.h"
-#include "mojo/common/data_pipe_utils.h"
+#include "mojo/data_pipe_utils/data_pipe_utils.h"
 #include "mojo/edk/js/core.h"
 #include "mojo/edk/js/handle.h"
 #include "mojo/edk/js/support.h"
diff --git a/services/js/js_app_message_loop_observers.h b/services/js/js_app_message_loop_observers.h
index ad2a4d2..4cdbd7d 100644
--- a/services/js/js_app_message_loop_observers.h
+++ b/services/js/js_app_message_loop_observers.h
@@ -6,7 +6,7 @@
 #define SERVICES_JS_JS_APP_MESSAGE_LOOP_OBSERVERS_H_
 
 #include "base/message_loop/message_loop.h"
-#include "mojo/common/message_pump_mojo.h"
+#include "mojo/message_pump/message_pump_mojo.h"
 #include "v8/include/v8.h"
 
 namespace js {
diff --git a/services/nacl/BUILD.gn b/services/nacl/BUILD.gn
index 3d2403a..39ae0f6 100644
--- a/services/nacl/BUILD.gn
+++ b/services/nacl/BUILD.gn
@@ -15,7 +15,8 @@
       "//base",
       "//mojo/application:application",
       "//mojo/application:content_handler",
-      "//mojo/common",
+      "//mojo/data_pipe_utils",
+      "//mojo/message_pump",
       "//mojo/public/platform/native:system_impl_private",
       "//mojo/services/network/public/interfaces",
       "//nacl_bindings:monacl_sel",
diff --git a/services/nacl/content_handler_main.cc b/services/nacl/content_handler_main.cc
index 4d1a4fa..776ebd8 100644
--- a/services/nacl/content_handler_main.cc
+++ b/services/nacl/content_handler_main.cc
@@ -8,8 +8,8 @@
 #include "build/build_config.h"
 #include "mojo/application/application_runner_chromium.h"
 #include "mojo/application/content_handler_factory.h"
-#include "mojo/common/data_pipe_utils.h"
-#include "mojo/common/message_pump_mojo.h"
+#include "mojo/data_pipe_utils/data_pipe_utils.h"
+#include "mojo/message_pump/message_pump_mojo.h"
 #include "mojo/public/c/system/main.h"
 #include "mojo/public/cpp/application/application_connection.h"
 #include "mojo/public/cpp/application/application_delegate.h"
diff --git a/services/python/content_handler/BUILD.gn b/services/python/content_handler/BUILD.gn
index ce7059e..43563c0 100644
--- a/services/python/content_handler/BUILD.gn
+++ b/services/python/content_handler/BUILD.gn
@@ -22,14 +22,13 @@
     "//base",
     "//base:i18n",
     "//mojo/application",
-    "//mojo/application:application",
     "//mojo/application:content_handler",
+    "//mojo/data_pipe_utils",
     "//mojo/environment:chromium",
-    "//mojo/common",
     "//mojo/public/c/system:for_shared_library",
     "//mojo/public/cpp/utility",
-    "//mojo/public/python:system_embedded",
     "//mojo/public/python:python_common",
+    "//mojo/public/python:system_embedded",
     "//mojo/services/content_handler/public/interfaces",
     "//third_party/zlib:zip",
     "//url:url",
@@ -64,7 +63,7 @@
   deps = [
     "//base",
     "//mojo/environment:chromium",
-    "//mojo/common",
+    "//mojo/message_pump",
     "//mojo/public/c/system:for_shared_library",
     "//mojo/public/cpp/system",
     "//mojo/public/cpp/utility",
diff --git a/services/python/content_handler/content_handler_main.cc b/services/python/content_handler/content_handler_main.cc
index 54245da..d05de8b 100644
--- a/services/python/content_handler/content_handler_main.cc
+++ b/services/python/content_handler/content_handler_main.cc
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include <python2.7/Python.h>
 #include <dlfcn.h>
+#include <python2.7/Python.h>
 
 #include "base/files/file_path.h"
 #include "base/files/scoped_temp_dir.h"
@@ -12,8 +12,7 @@
 #include "base/strings/stringprintf.h"
 #include "mojo/application/application_runner_chromium.h"
 #include "mojo/application/content_handler_factory.h"
-#include "mojo/common/common_type_converters.h"
-#include "mojo/common/data_pipe_utils.h"
+#include "mojo/data_pipe_utils/data_pipe_utils.h"
 #include "mojo/public/c/system/main.h"
 #include "mojo/public/cpp/application/application_delegate.h"
 #include "mojo/public/cpp/application/application_impl.h"
diff --git a/services/python/content_handler/python_system_impl_helper.cc b/services/python/content_handler/python_system_impl_helper.cc
index a48174a..8b4bed2 100644
--- a/services/python/content_handler/python_system_impl_helper.cc
+++ b/services/python/content_handler/python_system_impl_helper.cc
@@ -8,7 +8,7 @@
 
 #include "base/bind.h"
 #include "base/location.h"
-#include "mojo/common/message_pump_mojo.h"
+#include "mojo/message_pump/message_pump_mojo.h"
 #include "mojo/public/python/src/common.h"
 
 namespace {
diff --git a/services/python/mojo_url_redirector/BUILD.gn b/services/python/mojo_url_redirector/BUILD.gn
index deeb1e2..73afcc9 100644
--- a/services/python/mojo_url_redirector/BUILD.gn
+++ b/services/python/mojo_url_redirector/BUILD.gn
@@ -37,7 +37,7 @@
     "//base",
     "//mojo/application",
     "//mojo/application:test_support",
-    "//mojo/common",
+    "//mojo/data_pipe_utils",
     "//mojo/services/http_server/public/cpp",
     "//mojo/services/http_server/public/interfaces",
     "//mojo/services/network/public/interfaces",
diff --git a/services/python/mojo_url_redirector/mojo_url_redirector_apptest.cc b/services/python/mojo_url_redirector/mojo_url_redirector_apptest.cc
index be6b58f..71fed90 100644
--- a/services/python/mojo_url_redirector/mojo_url_redirector_apptest.cc
+++ b/services/python/mojo_url_redirector/mojo_url_redirector_apptest.cc
@@ -7,7 +7,7 @@
 #include "base/run_loop.h"
 #include "base/strings/string_split.h"
 #include "base/strings/stringprintf.h"
-#include "mojo/common/data_pipe_utils.h"
+#include "mojo/data_pipe_utils/data_pipe_utils.h"
 #include "mojo/public/cpp/application/application_impl.h"
 #include "mojo/public/cpp/application/application_test_base.h"
 #include "mojo/services/http_server/public/cpp/http_server_util.h"
diff --git a/services/reaper/BUILD.gn b/services/reaper/BUILD.gn
index 3be1edc..15bd11a 100644
--- a/services/reaper/BUILD.gn
+++ b/services/reaper/BUILD.gn
@@ -53,7 +53,6 @@
     "//base",
     "//mojo/application",
     "//mojo/application:test_support",
-    "//mojo/common",
     "//mojo/public/cpp/bindings",
   ]
 
diff --git a/services/reaper/reaper_apptest.cc b/services/reaper/reaper_apptest.cc
index 244afcd..3f1a7ac 100644
--- a/services/reaper/reaper_apptest.cc
+++ b/services/reaper/reaper_apptest.cc
@@ -4,7 +4,6 @@
 
 #include "base/bind.h"
 #include "base/run_loop.h"
-#include "mojo/common/common_type_converters.h"
 #include "mojo/public/cpp/application/application_impl.h"
 #include "mojo/public/cpp/application/application_test_base.h"
 #include "mojo/public/cpp/bindings/strong_binding.h"
diff --git a/services/tracing/BUILD.gn b/services/tracing/BUILD.gn
index 373229d..0ac1bb6 100644
--- a/services/tracing/BUILD.gn
+++ b/services/tracing/BUILD.gn
@@ -20,6 +20,7 @@
     "//base",
     "//mojo/application",
     "//mojo/common",
+    "//mojo/data_pipe_utils",
     "//mojo/public/cpp/application",
     "//mojo/public/cpp/system",
     "//mojo/services/tracing/public/interfaces",
diff --git a/services/tracing/trace_data_sink.cc b/services/tracing/trace_data_sink.cc
index d1fe936..ee6faa6 100644
--- a/services/tracing/trace_data_sink.cc
+++ b/services/tracing/trace_data_sink.cc
@@ -5,7 +5,7 @@
 #include "services/tracing/trace_data_sink.h"
 
 #include "base/logging.h"
-#include "mojo/common/data_pipe_utils.h"
+#include "mojo/data_pipe_utils/data_pipe_utils.h"
 
 using mojo::common::BlockingCopyFromString;
 
diff --git a/services/url_response_disk_cache/BUILD.gn b/services/url_response_disk_cache/BUILD.gn
index 92a4a32..2cb04bb 100644
--- a/services/url_response_disk_cache/BUILD.gn
+++ b/services/url_response_disk_cache/BUILD.gn
@@ -19,7 +19,7 @@
     ":bindings",
     "//base",
     "//mojo/application",
-    "//mojo/common",
+    "//mojo/data_pipe_utils",
     "//mojo/environment:chromium",
     "//mojo/public/cpp/application",
     "//mojo/public/cpp/system",
@@ -49,7 +49,6 @@
     "//base",
     "//mojo/application",
     "//mojo/application:test_support",
-    "//mojo/common",
     "//mojo/public/cpp/bindings",
     "//mojo/public/cpp/system:system",
     "//mojo/services/network/public/interfaces:interfaces",
diff --git a/services/url_response_disk_cache/url_response_disk_cache_impl.cc b/services/url_response_disk_cache/url_response_disk_cache_impl.cc
index d7b8f20..22f066d 100644
--- a/services/url_response_disk_cache/url_response_disk_cache_impl.cc
+++ b/services/url_response_disk_cache/url_response_disk_cache_impl.cc
@@ -17,7 +17,7 @@
 #include "base/strings/string_util.h"
 #include "base/strings/stringprintf.h"
 #include "base/trace_event/trace_event.h"
-#include "mojo/common/data_pipe_utils.h"
+#include "mojo/data_pipe_utils/data_pipe_utils.h"
 #include "mojo/public/cpp/application/application_connection.h"
 #include "mojo/public/cpp/bindings/lib/fixed_buffer.h"
 #include "services/url_response_disk_cache/url_response_disk_cache_entry.mojom.h"
diff --git a/services/view_manager/BUILD.gn b/services/view_manager/BUILD.gn
index 1825aa8..b2ef6d3 100644
--- a/services/view_manager/BUILD.gn
+++ b/services/view_manager/BUILD.gn
@@ -76,7 +76,6 @@
     "//cc/surfaces",
     "//cc/surfaces:surface_id",
     "//mojo/application",
-    "//mojo/common",
     "//mojo/converters/geometry",
     "//mojo/converters/input_events",
     "//mojo/converters/surfaces",
@@ -106,7 +105,7 @@
 
   deps = [
     "//base",
-    "//mojo/common",
+    "//mojo/converters/array_string",
     "//mojo/public/cpp/bindings:bindings",
     "//mojo/services/geometry/public/interfaces",
     "//mojo/services/view_manager/public/cpp",
diff --git a/services/view_manager/test_change_tracker.cc b/services/view_manager/test_change_tracker.cc
index 11b0b39..3bb241d 100644
--- a/services/view_manager/test_change_tracker.cc
+++ b/services/view_manager/test_change_tracker.cc
@@ -6,7 +6,7 @@
 
 #include "base/strings/string_util.h"
 #include "base/strings/stringprintf.h"
-#include "mojo/common/common_type_converters.h"
+#include "mojo/converters/array_string/array_string_type_converters.h"
 #include "mojo/services/view_manager/public/cpp/util.h"
 
 using mojo::Array;
diff --git a/shell/BUILD.gn b/shell/BUILD.gn
index e0e7919..d231e4d 100644
--- a/shell/BUILD.gn
+++ b/shell/BUILD.gn
@@ -49,12 +49,12 @@
 if (!mojo_use_prebuilt_mojo_shell) {
   shell_common_deps = [
     ":parent_lib",
-    "crash",
     "//base",
     "//base/allocator",
     "//build/config/sanitizers:deps",
-    "//mojo/common",
     "//mojo/environment:chromium",
+    "//mojo/message_pump",
+    "//shell/crash",
   ]
   shell_common_data_deps = [ ":mojo_shell_child" ]
 
@@ -100,9 +100,9 @@
       "//base",
       "//base/allocator",
       "//build/config/sanitizers:deps",
-      "//mojo/common",
       "//mojo/edk/system",
       "//mojo/environment:chromium",
+      "//mojo/message_pump",
     ]
   }
 }  # !mojo_use_prebuilt_mojo_shell
@@ -161,6 +161,7 @@
     "//mojo/application",
     "//mojo/common",
     "//mojo/common:tracing_impl",
+    "//mojo/data_pipe_utils",
     "//mojo/edk/system",
     "//mojo/public/cpp/bindings",
     "//mojo/public/interfaces/application",
@@ -486,16 +487,17 @@
   deps = [
     ":parent_lib",
     "//base",
-    "//base:i18n",
     "//base/test:test_support",
-    "//testing/gtest",
-    "//url",
+    "//base:i18n",
     "//mojo/common",
     "//mojo/edk/system",
     "//mojo/environment:chromium",
+    "//mojo/message_pump",
     "//mojo/public/cpp/bindings",
     "//services/test_service:bindings",
     "//shell/application_manager",
+    "//testing/gtest",
+    "//url",
   ]
 
   data_deps = [
@@ -551,7 +553,7 @@
     "//base",
     "//mojo/application",
     "//mojo/application:test_support",
-    "//mojo/common:common",
+    "//mojo/data_pipe_utils",
     "//mojo/public/cpp/bindings:callback",
     "//mojo/public/cpp/environment",
     "//mojo/public/cpp/system:system",
diff --git a/shell/android/android_handler.cc b/shell/android/android_handler.cc
index 170e0fc..9523446 100644
--- a/shell/android/android_handler.cc
+++ b/shell/android/android_handler.cc
@@ -17,7 +17,7 @@
 #include "base/strings/string_number_conversions.h"
 #include "base/trace_event/trace_event.h"
 #include "jni/AndroidHandler_jni.h"
-#include "mojo/common/data_pipe_utils.h"
+#include "mojo/data_pipe_utils/data_pipe_utils.h"
 #include "mojo/public/c/system/main.h"
 #include "mojo/public/cpp/application/application_impl.h"
 #include "shell/android/run_android_application_function.h"
diff --git a/shell/android/main.cc b/shell/android/main.cc
index 50f7213..75006bd 100644
--- a/shell/android/main.cc
+++ b/shell/android/main.cc
@@ -24,7 +24,7 @@
 #include "base/task_runner_util.h"
 #include "base/threading/simple_thread.h"
 #include "jni/ShellService_jni.h"
-#include "mojo/common/message_pump_mojo.h"
+#include "mojo/message_pump/message_pump_mojo.h"
 #include "mojo/services/network/public/interfaces/network_service.mojom.h"
 #include "mojo/services/window_manager/public/interfaces/window_manager.mojom.h"
 #include "shell/android/android_handler_loader.h"
diff --git a/shell/application_manager/BUILD.gn b/shell/application_manager/BUILD.gn
index 64f930b..b51332a 100644
--- a/shell/application_manager/BUILD.gn
+++ b/shell/application_manager/BUILD.gn
@@ -30,10 +30,11 @@
 
   public_deps = [
     "//base",
-    "//mojo/common",
+    "//mojo/converters/url",
+    "//mojo/data_pipe_utils",
     "//mojo/public/interfaces/application:application",
-    "//mojo/services/authentication/public/interfaces",
     "//mojo/services/authenticating_url_loader_interceptor/public/interfaces",
+    "//mojo/services/authentication/public/interfaces",
     "//mojo/services/network/public/interfaces",
     "//mojo/services/url_response_disk_cache/public/interfaces",
     "//url",
@@ -60,7 +61,6 @@
     ":test_bindings",
     "//base",
     "//mojo/application",
-    "//mojo/common",
     "//mojo/edk/test:run_all_unittests",
     "//mojo/environment:chromium",
     "//mojo/public/cpp/application",
diff --git a/shell/application_manager/local_fetcher.cc b/shell/application_manager/local_fetcher.cc
index a975b0f..ce75385 100644
--- a/shell/application_manager/local_fetcher.cc
+++ b/shell/application_manager/local_fetcher.cc
@@ -4,6 +4,8 @@
 
 #include "shell/application_manager/local_fetcher.h"
 
+#include <sys/stat.h>
+
 #include "base/bind.h"
 #include "base/files/file_enumerator.h"
 #include "base/files/file_util.h"
@@ -12,9 +14,8 @@
 #include "base/strings/stringprintf.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/trace_event/trace_event.h"
-#include "mojo/common/common_type_converters.h"
-#include "mojo/common/data_pipe_utils.h"
-#include <sys/stat.h>
+#include "mojo/converters/url/url_type_converters.h"
+#include "mojo/data_pipe_utils/data_pipe_utils.h"
 #include "url/url_util.h"
 
 namespace shell {
diff --git a/shell/application_manager/network_fetcher.cc b/shell/application_manager/network_fetcher.cc
index eff1646..31caa19 100644
--- a/shell/application_manager/network_fetcher.cc
+++ b/shell/application_manager/network_fetcher.cc
@@ -18,8 +18,8 @@
 #include "base/trace_event/trace_event.h"
 #include "crypto/secure_hash.h"
 #include "crypto/sha2.h"
-#include "mojo/common/common_type_converters.h"
-#include "mojo/common/data_pipe_utils.h"
+#include "mojo/converters/url/url_type_converters.h"
+#include "mojo/data_pipe_utils/data_pipe_utils.h"
 #include "shell/application_manager/data_pipe_peek.h"
 
 namespace shell {
diff --git a/shell/application_manager/shell_impl.cc b/shell/application_manager/shell_impl.cc
index 131383e..8ca4e4d 100644
--- a/shell/application_manager/shell_impl.cc
+++ b/shell/application_manager/shell_impl.cc
@@ -4,7 +4,7 @@
 
 #include "shell/application_manager/shell_impl.h"
 
-#include "mojo/common/common_type_converters.h"
+#include "mojo/converters/url/url_type_converters.h"
 #include "mojo/services/content_handler/public/interfaces/content_handler.mojom.h"
 #include "shell/application_manager/application_manager.h"
 
diff --git a/shell/child_main.cc b/shell/child_main.cc
index 05abbc6..bc6559b 100644
--- a/shell/child_main.cc
+++ b/shell/child_main.cc
@@ -20,12 +20,12 @@
 #include "base/thread_task_runner_handle.h"
 #include "base/threading/thread.h"
 #include "base/threading/thread_checker.h"
-#include "mojo/common/message_pump_mojo.h"
 #include "mojo/edk/embedder/embedder.h"
 #include "mojo/edk/embedder/platform_channel_pair.h"
 #include "mojo/edk/embedder/scoped_platform_handle.h"
 #include "mojo/edk/embedder/simple_platform_support.h"
 #include "mojo/edk/embedder/slave_process_delegate.h"
+#include "mojo/message_pump/message_pump_mojo.h"
 #include "mojo/public/cpp/bindings/binding.h"
 #include "mojo/public/cpp/system/core.h"
 #include "shell/child_controller.mojom.h"
diff --git a/shell/child_process_host_unittest.cc b/shell/child_process_host_unittest.cc
index d4dc4a8..d4f22cc 100644
--- a/shell/child_process_host_unittest.cc
+++ b/shell/child_process_host_unittest.cc
@@ -10,7 +10,7 @@
 #include "base/macros.h"
 #include "base/message_loop/message_loop.h"
 #include "build/build_config.h"
-#include "mojo/common/message_pump_mojo.h"
+#include "mojo/message_pump/message_pump_mojo.h"
 #include "mojo/public/c/system/types.h"
 #include "mojo/public/cpp/system/message_pipe.h"
 #include "shell/context.h"
diff --git a/shell/context_unittest.cc b/shell/context_unittest.cc
index a22f205..e842e61 100644
--- a/shell/context_unittest.cc
+++ b/shell/context_unittest.cc
@@ -7,7 +7,7 @@
 #include "base/files/file_path.h"
 #include "base/message_loop/message_loop.h"
 #include "build/build_config.h"
-#include "mojo/common/message_pump_mojo.h"
+#include "mojo/message_pump/message_pump_mojo.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace shell {
diff --git a/shell/crash/BUILD.gn b/shell/crash/BUILD.gn
index 81013e7..f351037 100644
--- a/shell/crash/BUILD.gn
+++ b/shell/crash/BUILD.gn
@@ -18,7 +18,7 @@
 
   deps = [
     "//base",
-    "//mojo/common",
+    "//mojo/data_pipe_utils",
     "//mojo/services/network/public/interfaces",
     "//third_party/breakpad:client",
   ]
@@ -32,9 +32,10 @@
   deps = [
     ":crash",
     "//base",
-    "//mojo/common",
+    "//mojo/data_pipe_utils",
     "//mojo/edk/test:run_all_unittests",
     "//mojo/environment:chromium",
+    "//mojo/message_pump",
     "//mojo/services/network/public/interfaces",
     "//testing/gtest",
   ]
diff --git a/shell/crash/crash_upload.cc b/shell/crash/crash_upload.cc
index e6cd016..a67da91 100644
--- a/shell/crash/crash_upload.cc
+++ b/shell/crash/crash_upload.cc
@@ -11,7 +11,7 @@
 #include "base/location.h"
 #include "base/strings/string_util.h"
 #include "base/task_runner_util.h"
-#include "mojo/common/data_pipe_utils.h"
+#include "mojo/data_pipe_utils/data_pipe_utils.h"
 #include "mojo/services/network/public/interfaces/url_loader.mojom.h"
 
 namespace breakpad {
diff --git a/shell/crash/crash_upload_unittests.cc b/shell/crash/crash_upload_unittests.cc
index 1d9e611..ee2750a 100644
--- a/shell/crash/crash_upload_unittests.cc
+++ b/shell/crash/crash_upload_unittests.cc
@@ -9,8 +9,8 @@
 #include "base/message_loop/message_loop.h"
 #include "base/run_loop.h"
 #include "base/strings/stringprintf.h"
-#include "mojo/common/data_pipe_utils.h"
-#include "mojo/common/message_pump_mojo.h"
+#include "mojo/data_pipe_utils/data_pipe_utils.h"
+#include "mojo/message_pump/message_pump_mojo.h"
 #include "mojo/public/cpp/bindings/binding.h"
 #include "mojo/services/network/public/interfaces/network_service.mojom.h"
 #include "shell/crash/crash_upload.h"
diff --git a/shell/shell_apptest.cc b/shell/shell_apptest.cc
index 4720d0e..2a5a5df 100644
--- a/shell/shell_apptest.cc
+++ b/shell/shell_apptest.cc
@@ -10,7 +10,7 @@
 #include "base/run_loop.h"
 #include "base/strings/string_util.h"
 #include "base/strings/stringprintf.h"
-#include "mojo/common/data_pipe_utils.h"
+#include "mojo/data_pipe_utils/data_pipe_utils.h"
 #include "mojo/public/cpp/application/application_impl.h"
 #include "mojo/public/cpp/application/application_test_base.h"
 #include "mojo/public/cpp/system/macros.h"
diff --git a/shell/tracer.h b/shell/tracer.h
index 8a1b57d..0299e65 100644
--- a/shell/tracer.h
+++ b/shell/tracer.h
@@ -12,8 +12,8 @@
 #include "base/callback.h"
 #include "base/macros.h"
 #include "base/memory/ref_counted_memory.h"
-#include "mojo/common/data_pipe_drainer.h"
 #include "mojo/common/trace_provider_impl.h"
+#include "mojo/data_pipe_utils/data_pipe_drainer.h"
 #include "mojo/services/tracing/public/interfaces/tracing.mojom.h"
 
 namespace shell {
diff --git a/tonic/BUILD.gn b/tonic/BUILD.gn
index 3cb1324..5b72df7 100644
--- a/tonic/BUILD.gn
+++ b/tonic/BUILD.gn
@@ -60,9 +60,11 @@
   deps = [
     "//base",
     "//build/config/sanitizers:deps",
-    "//mojo/common",
+    "//mojo/data_pipe_utils",
+    "//mojo/message_pump",
     "//mojo/public/cpp/system",
     "//mojo/services/network/public/interfaces",
+    "//url",
   ]
 
   public_deps = [
diff --git a/tonic/dart_library_loader.cc b/tonic/dart_library_loader.cc
index 24d075c..4b0d2df 100644
--- a/tonic/dart_library_loader.cc
+++ b/tonic/dart_library_loader.cc
@@ -6,7 +6,7 @@
 
 #include "base/callback.h"
 #include "base/trace_event/trace_event.h"
-#include "mojo/common/data_pipe_drainer.h"
+#include "mojo/data_pipe_utils/data_pipe_drainer.h"
 #include "tonic/dart_api_scope.h"
 #include "tonic/dart_converter.h"
 #include "tonic/dart_dependency_catcher.h"
diff --git a/tonic/dart_library_provider_files.cc b/tonic/dart_library_provider_files.cc
index 21c7b86..dc82512 100644
--- a/tonic/dart_library_provider_files.cc
+++ b/tonic/dart_library_provider_files.cc
@@ -8,7 +8,7 @@
 #include "base/files/file_util.h"
 #include "base/strings/string_util.h"
 #include "base/threading/worker_pool.h"
-#include "mojo/common/data_pipe_utils.h"
+#include "mojo/data_pipe_utils/data_pipe_utils.h"
 #include "tonic/dart_converter.h"
 
 namespace tonic {
diff --git a/tonic/dart_script_loader_sync.cc b/tonic/dart_script_loader_sync.cc
index 76b11fe..46fddf5 100644
--- a/tonic/dart_script_loader_sync.cc
+++ b/tonic/dart_script_loader_sync.cc
@@ -7,7 +7,7 @@
 #include "base/callback.h"
 #include "base/run_loop.h"
 #include "base/trace_event/trace_event.h"
-#include "mojo/common/message_pump_mojo.h"
+#include "mojo/message_pump/message_pump_mojo.h"
 #include "tonic/dart_api_scope.h"
 #include "tonic/dart_converter.h"
 #include "tonic/dart_dependency_catcher.h"
diff --git a/tonic/dart_snapshot_loader.h b/tonic/dart_snapshot_loader.h
index 6c08421..08c0bf2 100644
--- a/tonic/dart_snapshot_loader.h
+++ b/tonic/dart_snapshot_loader.h
@@ -11,7 +11,7 @@
 #include "base/macros.h"
 #include "base/memory/weak_ptr.h"
 #include "dart/runtime/include/dart_api.h"
-#include "mojo/common/data_pipe_drainer.h"
+#include "mojo/data_pipe_utils/data_pipe_drainer.h"
 
 namespace tonic {
 class DartState;