Deprecate mojo/public/c/system/core.h.

Convert the places where we include it.

I'll leave core.h in temporarily, to make rolling/updating consumers
easier, but it should eventually be removed.

R=jamesr@chromium.org

Review URL: https://codereview.chromium.org/1779353002 .
diff --git a/mojo/android/system/core_impl.cc b/mojo/android/system/core_impl.cc
index 0a80e60..e67a540 100644
--- a/mojo/android/system/core_impl.cc
+++ b/mojo/android/system/core_impl.cc
@@ -14,7 +14,11 @@
 #include "base/message_loop/message_loop.h"
 #include "jni/CoreImpl_jni.h"
 #include "mojo/public/c/environment/async_waiter.h"
-#include "mojo/public/c/system/core.h"
+#include "mojo/public/c/system/buffer.h"
+#include "mojo/public/c/system/data_pipe.h"
+#include "mojo/public/c/system/functions.h"
+#include "mojo/public/c/system/message_pipe.h"
+#include "mojo/public/c/system/types.h"
 #include "mojo/public/cpp/environment/environment.h"
 
 namespace {
diff --git a/mojo/dart/embedder/dart_controller.cc b/mojo/dart/embedder/dart_controller.cc
index 763da06..c2fb24e 100644
--- a/mojo/dart/embedder/dart_controller.cc
+++ b/mojo/dart/embedder/dart_controller.cc
@@ -19,7 +19,7 @@
 #include "mojo/dart/embedder/observatory_archive.h"
 #include "mojo/dart/embedder/vmservice.h"
 #include "mojo/message_pump/message_pump_mojo.h"
-#include "mojo/public/c/system/core.h"
+#include "mojo/public/c/system/types.h"
 #include "mojo/public/platform/dart/dart_handle_watcher.h"
 #include "tonic/dart_converter.h"
 #include "tonic/dart_debugger.h"
diff --git a/mojo/nacl/sfi/nacl_bindings/mojo_irt.c b/mojo/nacl/sfi/nacl_bindings/mojo_irt.c
index 6ff4931..a62c446 100644
--- a/mojo/nacl/sfi/nacl_bindings/mojo_irt.c
+++ b/mojo/nacl/sfi/nacl_bindings/mojo_irt.c
@@ -8,7 +8,10 @@
 #include <stdio.h>
 #include <string.h>
 
-#include "mojo/public/c/system/core.h"
+#include "mojo/public/c/system/buffer.h"
+#include "mojo/public/c/system/data_pipe.h"
+#include "mojo/public/c/system/message_pipe.h"
+#include "mojo/public/c/system/types.h"
 #include "mojo/public/platform/nacl/mojo_irt.h"
 #include "native_client/src/public/chrome_main.h"
 #include "native_client/src/public/imc_syscalls.h"
diff --git a/mojo/nacl/sfi/nacl_bindings/mojo_syscall.cc b/mojo/nacl/sfi/nacl_bindings/mojo_syscall.cc
index 54cd6fc..6e0f76e 100644
--- a/mojo/nacl/sfi/nacl_bindings/mojo_syscall.cc
+++ b/mojo/nacl/sfi/nacl_bindings/mojo_syscall.cc
@@ -10,7 +10,10 @@
 #include <stdio.h>
 
 #include "mojo/nacl/sfi/nacl_bindings/mojo_syscall_internal.h"
-#include "mojo/public/c/system/core.h"
+#include "mojo/public/c/system/buffer.h"
+#include "mojo/public/c/system/data_pipe.h"
+#include "mojo/public/c/system/message_pipe.h"
+#include "mojo/public/c/system/types.h"
 #include "mojo/public/platform/native/system_impl_private.h"
 #include "native_client/src/public/chrome_main.h"
 #include "native_client/src/public/nacl_app.h"
diff --git a/mojo/nacl/sfi/nacl_bindings_generator/libmojo.cc.tmpl b/mojo/nacl/sfi/nacl_bindings_generator/libmojo.cc.tmpl
index 0b641b5..13280e7 100644
--- a/mojo/nacl/sfi/nacl_bindings_generator/libmojo.cc.tmpl
+++ b/mojo/nacl/sfi/nacl_bindings_generator/libmojo.cc.tmpl
@@ -6,7 +6,11 @@
 
 #include <stdlib.h>
 
-#include "mojo/public/c/system/core.h"
+#include "mojo/public/c/system/buffer.h"
+#include "mojo/public/c/system/data_pipe.h"
+#include "mojo/public/c/system/functions.h"
+#include "mojo/public/c/system/message_pipe.h"
+#include "mojo/public/c/system/types.h"
 #include "{{platform_dir}}/mojo_irt.h"
 #include "native_client/src/untrusted/irt/irt.h"
 
diff --git a/mojo/nacl/sfi/nacl_bindings_generator/mojo_irt.c.tmpl b/mojo/nacl/sfi/nacl_bindings_generator/mojo_irt.c.tmpl
index 7885751..224b145 100644
--- a/mojo/nacl/sfi/nacl_bindings_generator/mojo_irt.c.tmpl
+++ b/mojo/nacl/sfi/nacl_bindings_generator/mojo_irt.c.tmpl
@@ -7,7 +7,10 @@
 #include <stdio.h>
 #include <string.h>
 
-#include "mojo/public/c/system/core.h"
+#include "mojo/public/c/system/buffer.h"
+#include "mojo/public/c/system/data_pipe.h"
+#include "mojo/public/c/system/message_pipe.h"
+#include "mojo/public/c/system/types.h"
 #include "{{platform_dir}}/mojo_irt.h"
 #include "native_client/src/public/chrome_main.h"
 #include "native_client/src/public/imc_syscalls.h"
diff --git a/mojo/nacl/sfi/nacl_bindings_generator/mojo_syscall.cc.tmpl b/mojo/nacl/sfi/nacl_bindings_generator/mojo_syscall.cc.tmpl
index 9f856ff..ad6d0cc 100644
--- a/mojo/nacl/sfi/nacl_bindings_generator/mojo_syscall.cc.tmpl
+++ b/mojo/nacl/sfi/nacl_bindings_generator/mojo_syscall.cc.tmpl
@@ -9,7 +9,10 @@
 #include <stdio.h>
 
 #include "{{bindings_dir}}/mojo_syscall_internal.h"
-#include "mojo/public/c/system/core.h"
+#include "mojo/public/c/system/buffer.h"
+#include "mojo/public/c/system/data_pipe.h"
+#include "mojo/public/c/system/message_pipe.h"
+#include "mojo/public/c/system/types.h"
 #include "mojo/public/platform/native/system_impl_private.h"
 #include "native_client/src/public/chrome_main.h"
 #include "native_client/src/public/nacl_app.h"
diff --git a/mojo/public/c/system/core.h b/mojo/public/c/system/core.h
index a7d2e69..f88352e 100644
--- a/mojo/public/c/system/core.h
+++ b/mojo/public/c/system/core.h
@@ -2,6 +2,10 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+// DEPRECATED -- do not use: include individual header files instead.
+//
+// TODO(vtl): Delete this header file.
+//
 // This is a catch-all header that includes everything.
 //
 // Note: This header should be compilable as C.
diff --git a/mojo/public/c/system/tests/core_perftest.cc b/mojo/public/c/system/tests/core_perftest.cc
index 29dbfc0..1013406 100644
--- a/mojo/public/c/system/tests/core_perftest.cc
+++ b/mojo/public/c/system/tests/core_perftest.cc
@@ -4,8 +4,6 @@
 
 // This tests the performance of the C API.
 
-#include "mojo/public/c/system/core.h"
-
 #include <assert.h>
 #include <stdint.h>
 #include <stdio.h>
@@ -14,7 +12,9 @@
 #include <functional>
 #include <thread>
 
-#include "mojo/public/cpp/system/functions.h"
+#include "mojo/public/c/system/functions.h"
+#include "mojo/public/c/system/message_pipe.h"
+#include "mojo/public/c/system/types.h"
 #include "mojo/public/cpp/system/macros.h"
 #include "mojo/public/cpp/test_support/test_support.h"
 #include "testing/gtest/include/gtest/gtest.h"
@@ -30,7 +30,7 @@
   static const size_t kGranularity = 100u;
   static const MojoTimeTicks kPerftestTimeMicroseconds = 3 * 1000000;
 
-  const MojoTimeTicks start_time = mojo::GetTimeTicksNow();
+  const MojoTimeTicks start_time = MojoGetTimeTicksNow();
   MojoTimeTicks end_time;
   size_t iterations = 0u;
   do {
@@ -38,7 +38,7 @@
       single_iteration();
     iterations += kGranularity;
 
-    end_time = mojo::GetTimeTicksNow();
+    end_time = MojoGetTimeTicksNow();
   } while (end_time - start_time < kPerftestTimeMicroseconds);
 
   mojo::test::LogPerfResult(test_name, sub_test_name,
diff --git a/mojo/public/c/system/tests/core_unittest.cc b/mojo/public/c/system/tests/core_unittest.cc
index f34517f..a1a8936 100644
--- a/mojo/public/c/system/tests/core_unittest.cc
+++ b/mojo/public/c/system/tests/core_unittest.cc
@@ -4,10 +4,13 @@
 
 // This file tests the C API.
 
-#include "mojo/public/c/system/core.h"
-
 #include <string.h>
 
+#include "mojo/public/c/system/buffer.h"
+#include "mojo/public/c/system/data_pipe.h"
+#include "mojo/public/c/system/functions.h"
+#include "mojo/public/c/system/message_pipe.h"
+#include "mojo/public/c/system/types.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace mojo {
diff --git a/mojo/public/c/system/tests/core_unittest_pure_c.c b/mojo/public/c/system/tests/core_unittest_pure_c.c
index d5978a9..3b9e0fd 100644
--- a/mojo/public/c/system/tests/core_unittest_pure_c.c
+++ b/mojo/public/c/system/tests/core_unittest_pure_c.c
@@ -12,8 +12,10 @@
 // Include all the header files that are meant to be compilable as C. Start with
 // core.h, since it's the most important one.
 #include "mojo/public/c/environment/async_waiter.h"
-#include "mojo/public/c/system/core.h"
+#include "mojo/public/c/system/functions.h"
 #include "mojo/public/c/system/macros.h"
+#include "mojo/public/c/system/message_pipe.h"
+#include "mojo/public/c/system/types.h"
 
 // The joys of the C preprocessor....
 #define STRINGIFY(x) #x
@@ -76,7 +78,7 @@
 
   EXPECT_EQ(MOJO_RESULT_OK,
             MojoWriteMessage(handle0, kHello, (uint32_t)sizeof(kHello), NULL,
-                             0u, MOJO_WRITE_DATA_FLAG_NONE));
+                             0u, MOJO_WRITE_MESSAGE_FLAG_NONE));
 
   struct MojoHandleSignalsState state;
   EXPECT_EQ(MOJO_RESULT_OK, MojoWait(handle1, MOJO_HANDLE_SIGNAL_READABLE,
diff --git a/mojo/public/cpp/system/handle.h b/mojo/public/cpp/system/handle.h
index 8958008..7b88c1e 100644
--- a/mojo/public/cpp/system/handle.h
+++ b/mojo/public/cpp/system/handle.h
@@ -47,8 +47,8 @@
 //
 // Wrapper functions:
 //
-// We provide simple wrappers for the |Mojo...()| functions (in
-// mojo/public/c/system/core.h -- see that file for details on individual
+// We provide simple wrappers for the |Mojo...()| functions (declared in various
+// mojo/public/c/system/*.h -- see those file for details on individual
 // functions).
 //
 // The general guideline is functions that imply ownership transfer of a handle
diff --git a/mojo/public/go/system/core.go b/mojo/public/go/system/core.go
index 9e29cff..201fcad 100644
--- a/mojo/public/go/system/core.go
+++ b/mojo/public/go/system/core.go
@@ -13,7 +13,7 @@
 var core coreImpl
 
 // Core is an interface giving access to the base operations.
-// See |src/mojo/public/c/system/core.h| for the underlying api.
+// See |mojo/public/c/system/*.h| for the underlying API.
 type Core interface {
 	// AcquireNativeHandle acquires a handle from the native side. The handle
 	// will be owned by the returned object and must not be closed outside of
diff --git a/mojo/public/java/system/src/org/chromium/mojo/system/Core.java b/mojo/public/java/system/src/org/chromium/mojo/system/Core.java
index ba0e5c6..1c8a0b7 100644
--- a/mojo/public/java/system/src/org/chromium/mojo/system/Core.java
+++ b/mojo/public/java/system/src/org/chromium/mojo/system/Core.java
@@ -7,8 +7,8 @@
 import java.util.List;
 
 /**
- * Core mojo interface giving access to the base operations. See |src/mojo/public/c/system/core.h|
- * for the underlying api.
+ * Core mojo interface giving access to the base operations. See |mojo/public/c/system/*.h| for the
+ * underlying API.
  */
 public interface Core {
 
diff --git a/mojo/public/js/core.js b/mojo/public/js/core.js
index b89a956..0791912 100644
--- a/mojo/public/js/core.js
+++ b/mojo/public/js/core.js
@@ -7,8 +7,8 @@
 // Note: This file is for documentation purposes only. The code here is not
 // actually executed. The real module is implemented natively in Mojo.
 //
-// This module provides the JavaScript bindings for mojo/public/c/system/core.h.
-// Refer to that file for more detailed documentation for equivalent methods.
+// This module provides the JavaScript bindings for mojo/public/c/system/*.h.
+// Refer to those files for more detailed documentation for equivalent methods.
 
 while (1);
 
diff --git a/mojo/public/platform/dart/dart_handle_watcher.h b/mojo/public/platform/dart/dart_handle_watcher.h
index bfefc19..d896463 100644
--- a/mojo/public/platform/dart/dart_handle_watcher.h
+++ b/mojo/public/platform/dart/dart_handle_watcher.h
@@ -11,7 +11,7 @@
 
 #include "dart/runtime/include/dart_api.h"
 
-#include "mojo/public/c/system/core.h"
+#include "mojo/public/c/system/types.h"
 #include "mojo/public/cpp/environment/logging.h"
 #include "mojo/public/cpp/system/macros.h"
 
diff --git a/mojo/public/platform/dart/mojo_natives.cc b/mojo/public/platform/dart/mojo_natives.cc
index 859b6e5..bc5eba9 100644
--- a/mojo/public/platform/dart/mojo_natives.cc
+++ b/mojo/public/platform/dart/mojo_natives.cc
@@ -9,7 +9,11 @@
 #include <vector>
 
 #include "dart/runtime/include/dart_api.h"
-#include "mojo/public/c/system/core.h"
+#include "mojo/public/c/system/buffer.h"
+#include "mojo/public/c/system/data_pipe.h"
+#include "mojo/public/c/system/functions.h"
+#include "mojo/public/c/system/message_pipe.h"
+#include "mojo/public/c/system/types.h"
 #include "mojo/public/cpp/environment/logging.h"
 #include "mojo/public/cpp/system/core.h"
 #include "mojo/public/cpp/system/macros.h"
diff --git a/mojo/public/platform/nacl/libmojo.cc b/mojo/public/platform/nacl/libmojo.cc
index f217b0c..8747ccc 100644
--- a/mojo/public/platform/nacl/libmojo.cc
+++ b/mojo/public/platform/nacl/libmojo.cc
@@ -7,7 +7,11 @@
 
 #include <stdlib.h>
 
-#include "mojo/public/c/system/core.h"
+#include "mojo/public/c/system/buffer.h"
+#include "mojo/public/c/system/data_pipe.h"
+#include "mojo/public/c/system/functions.h"
+#include "mojo/public/c/system/message_pipe.h"
+#include "mojo/public/c/system/types.h"
 #include "mojo/public/platform/nacl/mojo_irt.h"
 #include "native_client/src/untrusted/irt/irt.h"
 
diff --git a/mojo/public/platform/native/system_impl_private.h b/mojo/public/platform/native/system_impl_private.h
index 63472b1..b1cf300 100644
--- a/mojo/public/platform/native/system_impl_private.h
+++ b/mojo/public/platform/native/system_impl_private.h
@@ -7,6 +7,9 @@
 #ifndef MOJO_PUBLIC_PLATFORM_NATIVE_SYSTEM_IMPL_PRIVATE_H_
 #define MOJO_PUBLIC_PLATFORM_NATIVE_SYSTEM_IMPL_PRIVATE_H_
 
+#include "mojo/public/c/system/buffer.h"
+#include "mojo/public/c/system/data_pipe.h"
+#include "mojo/public/c/system/message_pipe.h"
 #include "mojo/public/c/system/types.h"
 
 // This interface provides the Mojo system API, but with the ability to confine
diff --git a/mojo/public/platform/native/system_impl_private_thunks.h b/mojo/public/platform/native/system_impl_private_thunks.h
index bb050fa..c46f0d2 100644
--- a/mojo/public/platform/native/system_impl_private_thunks.h
+++ b/mojo/public/platform/native/system_impl_private_thunks.h
@@ -7,7 +7,10 @@
 #ifndef MOJO_PUBLIC_PLATFORM_NATIVE_SYSTEM_IMPL_PRIVATE_THUNKS_H_
 #define MOJO_PUBLIC_PLATFORM_NATIVE_SYSTEM_IMPL_PRIVATE_THUNKS_H_
 
-#include "mojo/public/c/system/core.h"
+#include "mojo/public/c/system/buffer.h"
+#include "mojo/public/c/system/data_pipe.h"
+#include "mojo/public/c/system/message_pipe.h"
+#include "mojo/public/c/system/types.h"
 #include "mojo/public/platform/native/system_impl_private.h"
 
 // Structure used to bind the basic Mojo Core functions of a DSO to those of
@@ -17,8 +20,8 @@
 #pragma pack(push, 8)
 struct MojoSystemImplControlThunksPrivate {
   size_t size;  // Should be set to sizeof(MojoSystemImplThunks).
-  MojoSystemImpl (*GetDefaultSystemImpl)();
-  MojoSystemImpl (*CreateSystemImpl)();
+  MojoSystemImpl (*GetDefaultSystemImpl)(void);
+  MojoSystemImpl (*CreateSystemImpl)(void);
   MojoResult (*TransferHandle)(MojoSystemImpl from_system,
                                MojoHandle handle,
                                MojoSystemImpl to_system,
@@ -149,7 +152,6 @@
       MojoSystemImplUnmapBuffer};
   return system_thunks;
 }
-
 #endif
 
 #endif  // MOJO_PUBLIC_PLATFORM_NATIVE_SYSTEM_IMPL_PRIVATE_THUNKS_H_
diff --git a/mojo/public/platform/native/system_impl_private_unittest.cc b/mojo/public/platform/native/system_impl_private_unittest.cc
index 756d877..9640d35 100644
--- a/mojo/public/platform/native/system_impl_private_unittest.cc
+++ b/mojo/public/platform/native/system_impl_private_unittest.cc
@@ -6,7 +6,6 @@
 
 #include <string.h>
 
-#include "mojo/public/c/system/core.h"
 #include "mojo/public/platform/native/system_impl_private.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
diff --git a/mojo/public/platform/native/system_thunks.h b/mojo/public/platform/native/system_thunks.h
index 0d9a244..c09370c 100644
--- a/mojo/public/platform/native/system_thunks.h
+++ b/mojo/public/platform/native/system_thunks.h
@@ -9,7 +9,11 @@
 
 #include <stddef.h>
 
-#include "mojo/public/c/system/core.h"
+#include "mojo/public/c/system/buffer.h"
+#include "mojo/public/c/system/data_pipe.h"
+#include "mojo/public/c/system/functions.h"
+#include "mojo/public/c/system/message_pipe.h"
+#include "mojo/public/c/system/types.h"
 
 // The embedder needs to bind the basic Mojo Core functions of a DSO to those of
 // the embedder when loading a DSO that is dependent on mojo_system.
diff --git a/mojo/public/platform/native_cgo/system_cgo.go b/mojo/public/platform/native_cgo/system_cgo.go
index c6373fb..7c35c5e 100644
--- a/mojo/public/platform/native_cgo/system_cgo.go
+++ b/mojo/public/platform/native_cgo/system_cgo.go
@@ -4,7 +4,12 @@
 
 package native_cgo
 
-//#include "mojo/public/c/system/core.h"
+//#include "mojo/public/c/system/buffer.h"
+//#include "mojo/public/c/system/data_pipe.h"
+//#include "mojo/public/c/system/functions.h"
+//#include "mojo/public/c/system/message_pipe.h"
+//#include "mojo/public/c/system/types.h"
+//
 // // These functions are used to 8-byte align C structs.
 // MojoResult CreateSharedBuffer(struct MojoCreateSharedBufferOptions* options,
 //     uint64_t num_bytes, MojoHandle* handle) {
diff --git a/mojo/public/python/c_async_waiter.pxd b/mojo/public/python/c_async_waiter.pxd
index e2c3048..e0e00f0 100644
--- a/mojo/public/python/c_async_waiter.pxd
+++ b/mojo/public/python/c_async_waiter.pxd
@@ -7,7 +7,7 @@
 from libc.stdint cimport intptr_t, uint32_t, uint64_t
 
 
-cdef extern from "mojo/public/c/system/core.h" nogil:
+cdef extern from "mojo/public/c/system/types.h" nogil:
   ctypedef uint32_t MojoHandle
   ctypedef uint64_t MojoDeadline
   ctypedef uint32_t MojoHandleSignals
diff --git a/mojo/public/python/c_core.pxd b/mojo/public/python/c_core.pxd
index fd8fb89..f8198aa 100644
--- a/mojo/public/python/c_core.pxd
+++ b/mojo/public/python/c_core.pxd
@@ -13,8 +13,7 @@
 from cpython.mem cimport PyMem_Malloc, PyMem_Free
 from libc.stdint cimport int32_t, int64_t, uint32_t, uint64_t, uintptr_t
 
-cdef extern from "mojo/public/c/system/core.h" nogil:
-  # types.h
+cdef extern from "mojo/public/c/system/types.h" nogil:
   ctypedef int64_t MojoTimeTicks
 
   ctypedef uint32_t MojoHandle
@@ -53,7 +52,7 @@
     MojoHandleSignals satisfied_signals
     MojoHandleSignals satisfiable_signals
 
-  # functions.h
+cdef extern from "mojo/public/c/system/functions.h" nogil:
   MojoTimeTicks MojoGetTimeTicksNow()
   MojoResult MojoClose(MojoHandle handle)
   MojoResult MojoWait "MojoWait"(MojoHandle handle,
@@ -67,7 +66,7 @@
                                          uint32_t* result_index,
                                          MojoHandleSignalsState* signals_states)
 
-  # message_pipe.h
+cdef extern from "mojo/public/c/system/message_pipe.h" nogil:
   ctypedef uint32_t MojoCreateMessagePipeOptionsFlags
   const MojoCreateMessagePipeOptionsFlags MOJO_CREATE_MESSAGE_PIPE_OPTIONS_FLAG_NONE
 
@@ -103,7 +102,7 @@
       uint32_t* num_handles,
       MojoReadMessageFlags flags)
 
-  # data_pipe.h
+cdef extern from "mojo/public/c/system/data_pipe.h" nogil:
   ctypedef uint32_t MojoCreateDataPipeOptionsFlags
   const MojoCreateDataPipeOptionsFlags MOJO_CREATE_DATA_PIPE_OPTIONS_FLAG_NONE
 
@@ -163,7 +162,7 @@
       MojoHandle data_pipe_consumer_handle,
       uint32_t num_bytes_read)
 
-  # buffer.h
+cdef extern from "mojo/public/c/system/buffer.h" nogil:
   ctypedef uint32_t MojoCreateSharedBufferOptionsFlags
   const MojoCreateSharedBufferOptionsFlags MOJO_CREATE_SHARED_BUFFER_OPTIONS_FLAG_NONE
 
diff --git a/services/js/system/mojo_runner_delegate.h b/services/js/system/mojo_runner_delegate.h
index 2a5b8e5..95b9f74 100644
--- a/services/js/system/mojo_runner_delegate.h
+++ b/services/js/system/mojo_runner_delegate.h
@@ -7,7 +7,7 @@
 
 #include "base/macros.h"
 #include "gin/modules/module_runner_delegate.h"
-#include "mojo/public/c/system/core.h"
+#include "mojo/public/c/system/types.h"
 
 namespace mojo {
 namespace js {