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

Unified Diff: mojo/android/system/src/org/chromium/mojo/system/CoreImpl.java

Issue 250773005: Adding mojo_test_apk in the fyi waterfall. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix instrumentation issue. Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/java_apk.gypi ('k') | mojo/mojo.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/android/system/src/org/chromium/mojo/system/CoreImpl.java
diff --git a/mojo/android/system/src/org/chromium/mojo/system/CoreImpl.java b/mojo/android/system/src/org/chromium/mojo/system/CoreImpl.java
index 1d8e56bcf09bb078356be9b6adb924022d131f91..23f0bf77a1ea17e4390c899a274bf5fd942f52c6 100644
--- a/mojo/android/system/src/org/chromium/mojo/system/CoreImpl.java
+++ b/mojo/android/system/src/org/chromium/mojo/system/CoreImpl.java
@@ -37,19 +37,15 @@ class CoreImpl implements Core {
*/
private static final int FLAG_SIZE = 4;
- /**
- * The singleton instance.
- */
- private static Core sINSTANCE = null;
+ private static class LazyHolder {
+ private static final Core INSTANCE = new CoreImpl();
+ }
/**
* @return the instance.
*/
- static synchronized Core getInstance() {
- if (sINSTANCE == null) {
- sINSTANCE = new CoreImpl();
- }
- return sINSTANCE;
+ public static Core getInstance() {
+ return LazyHolder.INSTANCE;
}
private CoreImpl() {
@@ -107,7 +103,7 @@ class CoreImpl implements Core {
if (result.getMojoResult() != MojoResult.OK) {
throw new MojoException(result.getMojoResult());
}
- return Pair.create(
+ return Pair.<MessagePipeHandle, MessagePipeHandle>create(
new MessagePipeHandleImpl(this, result.getMojoHandle1()),
new MessagePipeHandleImpl(this, result.getMojoHandle2()));
}
@@ -129,7 +125,7 @@ class CoreImpl implements Core {
if (result.getMojoResult() != MojoResult.OK) {
throw new MojoException(result.getMojoResult());
}
- return Pair.create(
+ return Pair.<ProducerHandle, ConsumerHandle>create(
new DataPipeProducerHandleImpl(this, result.getMojoHandle1()),
new DataPipeConsumerHandleImpl(this, result.getMojoHandle2()));
}
« no previous file with comments | « build/java_apk.gypi ('k') | mojo/mojo.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698