| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 | 5 |
| 6 package org.chromium.chrome.browser.database; | 6 package org.chromium.chrome.browser.database; |
| 7 | 7 |
| 8 import android.database.AbstractCursor; | 8 import android.database.AbstractCursor; |
| 9 import android.database.CursorWindow; | 9 import android.database.CursorWindow; |
| 10 import android.util.Log; | 10 import android.util.Log; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 } | 39 } |
| 40 | 40 |
| 41 @CalledByNative | 41 @CalledByNative |
| 42 private static SQLiteCursor create(long nativeSQLiteCursor) { | 42 private static SQLiteCursor create(long nativeSQLiteCursor) { |
| 43 return new SQLiteCursor(nativeSQLiteCursor); | 43 return new SQLiteCursor(nativeSQLiteCursor); |
| 44 } | 44 } |
| 45 | 45 |
| 46 @Override | 46 @Override |
| 47 public int getCount() { | 47 public int getCount() { |
| 48 synchronized (mMoveLock) { | 48 synchronized (mMoveLock) { |
| 49 if (mCount == -1) | 49 if (mCount == -1) mCount = nativeGetCount(mNativeSQLiteCursor); |
| 50 mCount = nativeGetCount(mNativeSQLiteCursor); | |
| 51 } | 50 } |
| 52 return mCount; | 51 return mCount; |
| 53 } | 52 } |
| 54 | 53 |
| 55 @Override | 54 @Override |
| 56 public String[] getColumnNames() { | 55 public String[] getColumnNames() { |
| 57 return nativeGetColumnNames(mNativeSQLiteCursor); | 56 return nativeGetColumnNames(mNativeSQLiteCursor); |
| 58 } | 57 } |
| 59 | 58 |
| 60 @Override | 59 @Override |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 private native String[] nativeGetColumnNames(long nativeSQLiteCursor); | 238 private native String[] nativeGetColumnNames(long nativeSQLiteCursor); |
| 240 private native int nativeGetColumnType(long nativeSQLiteCursor, int column); | 239 private native int nativeGetColumnType(long nativeSQLiteCursor, int column); |
| 241 private native String nativeGetString(long nativeSQLiteCursor, int column); | 240 private native String nativeGetString(long nativeSQLiteCursor, int column); |
| 242 private native byte[] nativeGetBlob(long nativeSQLiteCursor, int column); | 241 private native byte[] nativeGetBlob(long nativeSQLiteCursor, int column); |
| 243 private native boolean nativeIsNull(long nativeSQLiteCursor, int column); | 242 private native boolean nativeIsNull(long nativeSQLiteCursor, int column); |
| 244 private native long nativeGetLong(long nativeSQLiteCursor, int column); | 243 private native long nativeGetLong(long nativeSQLiteCursor, int column); |
| 245 private native int nativeGetInt(long nativeSQLiteCursor, int column); | 244 private native int nativeGetInt(long nativeSQLiteCursor, int column); |
| 246 private native double nativeGetDouble(long nativeSQLiteCursor, int column); | 245 private native double nativeGetDouble(long nativeSQLiteCursor, int column); |
| 247 private native int nativeMoveTo(long nativeSQLiteCursor, int newPosition); | 246 private native int nativeMoveTo(long nativeSQLiteCursor, int newPosition); |
| 248 } | 247 } |
| OLD | NEW |