Allow mojo bindings to run on SequencedTaskRunner.

This CL changes mojo::SyncHandleRegistry to be sequence-local, using
base::SequenceLocalStorageSlot instead of base::ThreadLocalPointer,
removing the last thread affinity in the mojo bindings.

This also applies the single-thread to sequence mappings:
- ThreadChecker -> SequenceChecker
- SingleThreadTaskRunner -> SequencedTaskRunner
- ThreadTaskRunnerHandle -> SequencedTaskRunnerHandle
in non-test code in //mojo/public/cpp.

Bug: 678155
Change-Id: I8a643125a6a0ed46b450a228bc57da86dbe1193b
Reviewed-on: https://chromium-review.googlesource.com/497371
Commit-Queue: Sam McNally <[email protected]>
Reviewed-by: Yuzhu Shen <[email protected]>
Reviewed-by: Robert Sesek <[email protected]>
Reviewed-by: Ken Rockot <[email protected]>
Cr-Commit-Position: refs/heads/master@{#480682}
diff --git a/mojo/public/cpp/bindings/sync_handle_registry.h b/mojo/public/cpp/bindings/sync_handle_registry.h
index afb3b56b..de766151 100644
--- a/mojo/public/cpp/bindings/sync_handle_registry.h
+++ b/mojo/public/cpp/bindings/sync_handle_registry.h
@@ -11,22 +11,22 @@
 #include "base/callback.h"
 #include "base/macros.h"
 #include "base/memory/ref_counted.h"
+#include "base/sequence_checker.h"
 #include "base/synchronization/waitable_event.h"
-#include "base/threading/thread_checker.h"
 #include "mojo/public/cpp/bindings/bindings_export.h"
 #include "mojo/public/cpp/system/core.h"
 #include "mojo/public/cpp/system/wait_set.h"
 
 namespace mojo {
 
-// SyncHandleRegistry is a thread-local storage to register handles that want to
-// be watched together.
+// SyncHandleRegistry is a sequence-local storage to register handles that want
+// to be watched together.
 //
-// This class is not thread safe.
+// This class is thread unsafe.
 class MOJO_CPP_BINDINGS_EXPORT SyncHandleRegistry
     : public base::RefCounted<SyncHandleRegistry> {
  public:
-  // Returns a thread-local object.
+  // Returns a sequence-local object.
   static scoped_refptr<SyncHandleRegistry> current();
 
   using HandleCallback = base::Callback<void(MojoResult)>;
@@ -61,7 +61,7 @@
   std::map<Handle, HandleCallback> handles_;
   std::map<base::WaitableEvent*, base::Closure> events_;
 
-  base::ThreadChecker thread_checker_;
+  SEQUENCE_CHECKER(sequence_checker_);
 
   DISALLOW_COPY_AND_ASSIGN(SyncHandleRegistry);
 };