summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorqsr@chromium.org <qsr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-28 19:03:30 +0000
committerqsr@chromium.org <qsr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-28 19:03:30 +0000
commit688d06720580bd44cac33e2ad2908fa41849179e (patch)
tree945fb5b75bcb9e28d0656337162865289ec03aaa
parent9f364a3a8ffde2ce2914b3b99712df55c93fc3b2 (diff)
downloadchromium_src-688d06720580bd44cac33e2ad2908fa41849179e.zip
chromium_src-688d06720580bd44cac33e2ad2908fa41849179e.tar.gz
chromium_src-688d06720580bd44cac33e2ad2908fa41849179e.tar.bz2
Refactor java packages.
- Move implementation into its own .impl package. - Move MojoTestCase to the .mojo package. Review URL: https://codereview.chromium.org/294043016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273310 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--mojo/android/javatests/src/org/chromium/mojo/MojoTestCase.java (renamed from mojo/android/javatests/src/org/chromium/mojo/system/MojoTestCase.java)2
-rw-r--r--mojo/android/javatests/src/org/chromium/mojo/system/impl/CoreImplTest.java (renamed from mojo/android/javatests/src/org/chromium/mojo/system/CoreTest.java)15
-rw-r--r--mojo/android/system/src/org/chromium/mojo/system/impl/CoreImpl.java (renamed from mojo/android/system/src/org/chromium/mojo/system/CoreImpl.java)34
-rw-r--r--mojo/android/system/src/org/chromium/mojo/system/impl/DataPipeConsumerHandleImpl.java (renamed from mojo/android/system/src/org/chromium/mojo/system/DataPipeConsumerHandleImpl.java)2
-rw-r--r--mojo/android/system/src/org/chromium/mojo/system/impl/DataPipeProducerHandleImpl.java (renamed from mojo/android/system/src/org/chromium/mojo/system/DataPipeProducerHandleImpl.java)8
-rw-r--r--mojo/android/system/src/org/chromium/mojo/system/impl/HandleBase.java (renamed from mojo/android/system/src/org/chromium/mojo/system/HandleBase.java)4
-rw-r--r--mojo/android/system/src/org/chromium/mojo/system/impl/MessagePipeHandleImpl.java (renamed from mojo/android/system/src/org/chromium/mojo/system/MessagePipeHandleImpl.java)5
-rw-r--r--mojo/android/system/src/org/chromium/mojo/system/impl/SharedBufferHandleImpl.java (renamed from mojo/android/system/src/org/chromium/mojo/system/SharedBufferHandleImpl.java)4
-rw-r--r--mojo/android/system/src/org/chromium/mojo/system/impl/UntypedHandleImpl.java (renamed from mojo/android/system/src/org/chromium/mojo/system/UntypedHandleImpl.java)5
-rw-r--r--mojo/mojo.gyp4
10 files changed, 55 insertions, 28 deletions
diff --git a/mojo/android/javatests/src/org/chromium/mojo/system/MojoTestCase.java b/mojo/android/javatests/src/org/chromium/mojo/MojoTestCase.java
index e68f112..5236c1d 100644
--- a/mojo/android/javatests/src/org/chromium/mojo/system/MojoTestCase.java
+++ b/mojo/android/javatests/src/org/chromium/mojo/MojoTestCase.java
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-package org.chromium.mojo.system;
+package org.chromium.mojo;
import android.content.Context;
import android.test.InstrumentationTestCase;
diff --git a/mojo/android/javatests/src/org/chromium/mojo/system/CoreTest.java b/mojo/android/javatests/src/org/chromium/mojo/system/impl/CoreImplTest.java
index 87ea8755..a59bbdc 100644
--- a/mojo/android/javatests/src/org/chromium/mojo/system/CoreTest.java
+++ b/mojo/android/javatests/src/org/chromium/mojo/system/impl/CoreImplTest.java
@@ -2,17 +2,28 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-package org.chromium.mojo.system;
+package org.chromium.mojo.system.impl;
import android.test.suitebuilder.annotation.SmallTest;
+import org.chromium.mojo.MojoTestCase;
+import org.chromium.mojo.system.AsyncWaiter;
import org.chromium.mojo.system.AsyncWaiter.Callback;
import org.chromium.mojo.system.AsyncWaiter.Cancellable;
+import org.chromium.mojo.system.Core;
import org.chromium.mojo.system.Core.WaitFlags;
import org.chromium.mojo.system.Core.WaitManyResult;
+import org.chromium.mojo.system.DataPipe;
+import org.chromium.mojo.system.Handle;
+import org.chromium.mojo.system.InvalidHandle;
+import org.chromium.mojo.system.MessagePipeHandle;
import org.chromium.mojo.system.MessagePipeHandle.ReadFlags;
import org.chromium.mojo.system.MessagePipeHandle.ReadMessageResult;
import org.chromium.mojo.system.MessagePipeHandle.WriteFlags;
+import org.chromium.mojo.system.MojoException;
+import org.chromium.mojo.system.MojoResult;
+import org.chromium.mojo.system.Pair;
+import org.chromium.mojo.system.SharedBufferHandle;
import org.chromium.mojo.system.SharedBufferHandle.MapFlags;
import java.nio.ByteBuffer;
@@ -28,7 +39,7 @@ import java.util.concurrent.TimeUnit;
/**
* Testing the core API.
*/
-public class CoreTest extends MojoTestCase {
+public class CoreImplTest extends MojoTestCase {
private static final long RUN_LOOP_TIMEOUT_MS = 5;
diff --git a/mojo/android/system/src/org/chromium/mojo/system/CoreImpl.java b/mojo/android/system/src/org/chromium/mojo/system/impl/CoreImpl.java
index af94b44..cacedbe 100644
--- a/mojo/android/system/src/org/chromium/mojo/system/CoreImpl.java
+++ b/mojo/android/system/src/org/chromium/mojo/system/impl/CoreImpl.java
@@ -2,15 +2,24 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-package org.chromium.mojo.system;
+package org.chromium.mojo.system.impl;
import org.chromium.base.CalledByNative;
-import org.chromium.base.JNIAdditionalImport;
import org.chromium.base.JNINamespace;
+import org.chromium.mojo.system.AsyncWaiter;
+import org.chromium.mojo.system.Core;
+import org.chromium.mojo.system.DataPipe;
import org.chromium.mojo.system.DataPipe.ConsumerHandle;
import org.chromium.mojo.system.DataPipe.ProducerHandle;
+import org.chromium.mojo.system.Handle;
+import org.chromium.mojo.system.MessagePipeHandle;
+import org.chromium.mojo.system.MojoException;
+import org.chromium.mojo.system.MojoResult;
+import org.chromium.mojo.system.Pair;
+import org.chromium.mojo.system.SharedBufferHandle;
import org.chromium.mojo.system.SharedBufferHandle.DuplicateOptions;
import org.chromium.mojo.system.SharedBufferHandle.MapFlags;
+import org.chromium.mojo.system.UntypedHandle;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
@@ -20,9 +29,6 @@ import java.util.List;
/**
* Implementation of {@link Core}.
*/
-@JNIAdditionalImport({
- AsyncWaiter.class,
- MessagePipeHandle.class })
@JNINamespace("mojo::android")
public class CoreImpl implements Core, AsyncWaiter {
@@ -252,7 +258,7 @@ public class CoreImpl implements Core, AsyncWaiter {
}
/**
- * @see DataPipe.ConsumerHandle#discardData(int, DataPipe.ReadFlags)
+ * @see ConsumerHandle#discardData(int, DataPipe.ReadFlags)
*/
int discardData(DataPipeConsumerHandleImpl handle, int numBytes,
DataPipe.ReadFlags flags) {
@@ -265,7 +271,7 @@ public class CoreImpl implements Core, AsyncWaiter {
}
/**
- * @see DataPipe.ConsumerHandle#readData(ByteBuffer, DataPipe.ReadFlags)
+ * @see ConsumerHandle#readData(ByteBuffer, DataPipe.ReadFlags)
*/
int readData(DataPipeConsumerHandleImpl handle, ByteBuffer elements,
DataPipe.ReadFlags flags) {
@@ -282,7 +288,7 @@ public class CoreImpl implements Core, AsyncWaiter {
}
/**
- * @see DataPipe.ConsumerHandle#beginReadData(int, DataPipe.ReadFlags)
+ * @see ConsumerHandle#beginReadData(int, DataPipe.ReadFlags)
*/
ByteBuffer beginReadData(DataPipeConsumerHandleImpl handle,
int numBytes, DataPipe.ReadFlags flags) {
@@ -297,7 +303,7 @@ public class CoreImpl implements Core, AsyncWaiter {
}
/**
- * @see DataPipe.ConsumerHandle#endReadData(int)
+ * @see ConsumerHandle#endReadData(int)
*/
void endReadData(DataPipeConsumerHandleImpl handle,
int numBytesRead) {
@@ -308,7 +314,7 @@ public class CoreImpl implements Core, AsyncWaiter {
}
/**
- * @see DataPipe.ProducerHandle#writeData(ByteBuffer, DataPipe.WriteFlags)
+ * @see ProducerHandle#writeData(ByteBuffer, DataPipe.WriteFlags)
*/
int writeData(DataPipeProducerHandleImpl handle, ByteBuffer elements,
DataPipe.WriteFlags flags) {
@@ -317,7 +323,7 @@ public class CoreImpl implements Core, AsyncWaiter {
}
/**
- * @see DataPipe.ProducerHandle#beginWriteData(int, DataPipe.WriteFlags)
+ * @see ProducerHandle#beginWriteData(int, DataPipe.WriteFlags)
*/
ByteBuffer beginWriteData(DataPipeProducerHandleImpl handle,
int numBytes, DataPipe.WriteFlags flags) {
@@ -332,7 +338,7 @@ public class CoreImpl implements Core, AsyncWaiter {
}
/**
- * @see DataPipe.ProducerHandle#endWriteData(int)
+ * @see ProducerHandle#endWriteData(int)
*/
void endWriteData(DataPipeProducerHandleImpl handle,
int numBytesWritten) {
@@ -463,7 +469,7 @@ public class CoreImpl implements Core, AsyncWaiter {
}
/**
- * Implementation of {@link AsyncWaiter.Cancellable}.
+ * Implementation of {@link org.chromium.mojo.system.AsyncWaiter.Cancellable}.
*/
private class AsyncWaiterCancellableImpl implements AsyncWaiter.Cancellable {
@@ -477,7 +483,7 @@ public class CoreImpl implements Core, AsyncWaiter {
}
/**
- * @see AsyncWaiter.Cancellable#cancel()
+ * @see org.chromium.mojo.system.AsyncWaiter.Cancellable#cancel()
*/
@Override
public void cancel() {
diff --git a/mojo/android/system/src/org/chromium/mojo/system/DataPipeConsumerHandleImpl.java b/mojo/android/system/src/org/chromium/mojo/system/impl/DataPipeConsumerHandleImpl.java
index ccc85bb..fa6a5c1 100644
--- a/mojo/android/system/src/org/chromium/mojo/system/DataPipeConsumerHandleImpl.java
+++ b/mojo/android/system/src/org/chromium/mojo/system/impl/DataPipeConsumerHandleImpl.java
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-package org.chromium.mojo.system;
+package org.chromium.mojo.system.impl;
import org.chromium.mojo.system.DataPipe.ConsumerHandle;
import org.chromium.mojo.system.DataPipe.ReadFlags;
diff --git a/mojo/android/system/src/org/chromium/mojo/system/DataPipeProducerHandleImpl.java b/mojo/android/system/src/org/chromium/mojo/system/impl/DataPipeProducerHandleImpl.java
index 5e4081b..308c8cc 100644
--- a/mojo/android/system/src/org/chromium/mojo/system/DataPipeProducerHandleImpl.java
+++ b/mojo/android/system/src/org/chromium/mojo/system/impl/DataPipeProducerHandleImpl.java
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-package org.chromium.mojo.system;
+package org.chromium.mojo.system.impl;
import org.chromium.mojo.system.DataPipe.ProducerHandle;
import org.chromium.mojo.system.DataPipe.WriteFlags;
@@ -29,7 +29,7 @@ class DataPipeProducerHandleImpl extends HandleBase implements ProducerHandle {
}
/**
- * @see DataPipe.ProducerHandle#writeData(ByteBuffer, WriteFlags)
+ * @see ProducerHandle#writeData(ByteBuffer, WriteFlags)
*/
@Override
public int writeData(ByteBuffer elements, WriteFlags flags) {
@@ -37,7 +37,7 @@ class DataPipeProducerHandleImpl extends HandleBase implements ProducerHandle {
}
/**
- * @see DataPipe.ProducerHandle#beginWriteData(int, WriteFlags)
+ * @see ProducerHandle#beginWriteData(int, WriteFlags)
*/
@Override
public ByteBuffer beginWriteData(int numBytes, WriteFlags flags) {
@@ -45,7 +45,7 @@ class DataPipeProducerHandleImpl extends HandleBase implements ProducerHandle {
}
/**
- * @see DataPipe.ProducerHandle#endWriteData(int)
+ * @see ProducerHandle#endWriteData(int)
*/
@Override
public void endWriteData(int numBytesWritten) {
diff --git a/mojo/android/system/src/org/chromium/mojo/system/HandleBase.java b/mojo/android/system/src/org/chromium/mojo/system/impl/HandleBase.java
index 5d9fd47..06c9732 100644
--- a/mojo/android/system/src/org/chromium/mojo/system/HandleBase.java
+++ b/mojo/android/system/src/org/chromium/mojo/system/impl/HandleBase.java
@@ -2,11 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-package org.chromium.mojo.system;
+package org.chromium.mojo.system.impl;
import android.util.Log;
import org.chromium.mojo.system.Core.WaitFlags;
+import org.chromium.mojo.system.Handle;
+import org.chromium.mojo.system.UntypedHandle;
/**
* Implementation of {@link Handle}.
diff --git a/mojo/android/system/src/org/chromium/mojo/system/MessagePipeHandleImpl.java b/mojo/android/system/src/org/chromium/mojo/system/impl/MessagePipeHandleImpl.java
index 54985b1..04d2776 100644
--- a/mojo/android/system/src/org/chromium/mojo/system/MessagePipeHandleImpl.java
+++ b/mojo/android/system/src/org/chromium/mojo/system/impl/MessagePipeHandleImpl.java
@@ -2,7 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-package org.chromium.mojo.system;
+package org.chromium.mojo.system.impl;
+
+import org.chromium.mojo.system.Handle;
+import org.chromium.mojo.system.MessagePipeHandle;
import java.nio.ByteBuffer;
import java.util.List;
diff --git a/mojo/android/system/src/org/chromium/mojo/system/SharedBufferHandleImpl.java b/mojo/android/system/src/org/chromium/mojo/system/impl/SharedBufferHandleImpl.java
index 4aef2f7..c8cae1a 100644
--- a/mojo/android/system/src/org/chromium/mojo/system/SharedBufferHandleImpl.java
+++ b/mojo/android/system/src/org/chromium/mojo/system/impl/SharedBufferHandleImpl.java
@@ -2,7 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-package org.chromium.mojo.system;
+package org.chromium.mojo.system.impl;
+
+import org.chromium.mojo.system.SharedBufferHandle;
import java.nio.ByteBuffer;
diff --git a/mojo/android/system/src/org/chromium/mojo/system/UntypedHandleImpl.java b/mojo/android/system/src/org/chromium/mojo/system/impl/UntypedHandleImpl.java
index 31ad8be..cfe72ba 100644
--- a/mojo/android/system/src/org/chromium/mojo/system/UntypedHandleImpl.java
+++ b/mojo/android/system/src/org/chromium/mojo/system/impl/UntypedHandleImpl.java
@@ -2,10 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-package org.chromium.mojo.system;
+package org.chromium.mojo.system.impl;
import org.chromium.mojo.system.DataPipe.ConsumerHandle;
import org.chromium.mojo.system.DataPipe.ProducerHandle;
+import org.chromium.mojo.system.MessagePipeHandle;
+import org.chromium.mojo.system.SharedBufferHandle;
+import org.chromium.mojo.system.UntypedHandle;
/**
* Implementation of {@link UntypedHandle}.
diff --git a/mojo/mojo.gyp b/mojo/mojo.gyp
index e077ce5..b2ce652 100644
--- a/mojo/mojo.gyp
+++ b/mojo/mojo.gyp
@@ -682,8 +682,8 @@
'mojo_java_set_jni_headers',
],
'sources': [
- 'android/javatests/src/org/chromium/mojo/system/MojoTestCase.java',
- 'android/system/src/org/chromium/mojo/system/CoreImpl.java',
+ 'android/javatests/src/org/chromium/mojo/MojoTestCase.java',
+ 'android/system/src/org/chromium/mojo/system/impl/CoreImpl.java',
'services/native_viewport/android/src/org/chromium/mojo/NativeViewportAndroid.java',
'shell/android/apk/src/org/chromium/mojo_shell_apk/MojoMain.java',
],