Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Side by Side Diff: mojo/bindings/java/src/org/chromium/mojo/bindings/BindingsHelper.java

Issue 371603003: Adding a router class to handle messages that expect responses. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: FOllow review Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.mojo.bindings; 5 package org.chromium.mojo.bindings;
6 6
7 import org.chromium.mojo.system.AsyncWaiter;
8 import org.chromium.mojo.system.Handle;
9
7 /** 10 /**
8 * Helper functions. 11 * Helper functions.
9 */ 12 */
10 public class BindingsHelper { 13 public class BindingsHelper {
11 /** 14 /**
12 * Alignment in bytes for mojo serialization. 15 * Alignment in bytes for mojo serialization.
13 */ 16 */
14 public static final int ALIGNMENT = 8; 17 public static final int ALIGNMENT = 8;
15 18
16 /** 19 /**
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 } 69 }
67 70
68 /** 71 /**
69 * Determines if the given {@code char} value is a Unicode <i>surrogate code unit</i>. See 72 * Determines if the given {@code char} value is a Unicode <i>surrogate code unit</i>. See
70 * {@link Character#isSurrogate}. Extracting here because the method only ex ists at API level 73 * {@link Character#isSurrogate}. Extracting here because the method only ex ists at API level
71 * 19. 74 * 19.
72 */ 75 */
73 private static boolean isSurrogate(char c) { 76 private static boolean isSurrogate(char c) {
74 return c >= Character.MIN_SURROGATE && c < (Character.MAX_SURROGATE + 1) ; 77 return c >= Character.MIN_SURROGATE && c < (Character.MAX_SURROGATE + 1) ;
75 } 78 }
79
80 /**
81 * Returns an {@link AsyncWaiter} to use with the given handle, or <code>nul l</code> if none if
82 * available.
83 */
84 static AsyncWaiter getDefaultAsyncWaiterForHandle(Handle handle) {
85 if (handle.getCore() != null) {
86 return handle.getCore().getDefaultAsyncWaiter();
87 } else {
88 return null;
89 }
90 }
91
76 } 92 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698