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

Unified Diff: device/bluetooth/bluetooth_adapter_android.cc

Issue 2237943002: Remove now-unnecessary .obj() in Java method calls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@switch-context
Patch Set: Rebase *again* :( Created 4 years, 4 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
Index: device/bluetooth/bluetooth_adapter_android.cc
diff --git a/device/bluetooth/bluetooth_adapter_android.cc b/device/bluetooth/bluetooth_adapter_android.cc
index 13759fdc41bcd2f954701fa4d446228f7c4c373f..ec9d0f88f0de201263362f88c46a6fb0356983b8 100644
--- a/device/bluetooth/bluetooth_adapter_android.cc
+++ b/device/bluetooth/bluetooth_adapter_android.cc
@@ -64,12 +64,12 @@ bool BluetoothAdapterAndroid::RegisterJNI(JNIEnv* env) {
std::string BluetoothAdapterAndroid::GetAddress() const {
return ConvertJavaStringToUTF8(Java_ChromeBluetoothAdapter_getAddress(
- AttachCurrentThread(), j_adapter_.obj()));
+ AttachCurrentThread(), j_adapter_));
}
std::string BluetoothAdapterAndroid::GetName() const {
- return ConvertJavaStringToUTF8(Java_ChromeBluetoothAdapter_getName(
- AttachCurrentThread(), j_adapter_.obj()));
+ return ConvertJavaStringToUTF8(
+ Java_ChromeBluetoothAdapter_getName(AttachCurrentThread(), j_adapter_));
}
void BluetoothAdapterAndroid::SetName(const std::string& name,
@@ -84,19 +84,19 @@ bool BluetoothAdapterAndroid::IsInitialized() const {
bool BluetoothAdapterAndroid::IsPresent() const {
return Java_ChromeBluetoothAdapter_isPresent(AttachCurrentThread(),
- j_adapter_.obj());
+ j_adapter_);
}
bool BluetoothAdapterAndroid::IsPowered() const {
return Java_ChromeBluetoothAdapter_isPowered(AttachCurrentThread(),
- j_adapter_.obj());
+ j_adapter_);
}
void BluetoothAdapterAndroid::SetPowered(bool powered,
const base::Closure& callback,
const ErrorCallback& error_callback) {
- if (Java_ChromeBluetoothAdapter_setPowered(AttachCurrentThread(),
- j_adapter_.obj(), powered)) {
+ if (Java_ChromeBluetoothAdapter_setPowered(AttachCurrentThread(), j_adapter_,
+ powered)) {
callback.Run();
} else {
error_callback.Run();
@@ -105,7 +105,7 @@ void BluetoothAdapterAndroid::SetPowered(bool powered,
bool BluetoothAdapterAndroid::IsDiscoverable() const {
return Java_ChromeBluetoothAdapter_isDiscoverable(AttachCurrentThread(),
- j_adapter_.obj());
+ j_adapter_);
}
void BluetoothAdapterAndroid::SetDiscoverable(
@@ -117,7 +117,7 @@ void BluetoothAdapterAndroid::SetDiscoverable(
bool BluetoothAdapterAndroid::IsDiscovering() const {
return Java_ChromeBluetoothAdapter_isDiscovering(AttachCurrentThread(),
- j_adapter_.obj());
+ j_adapter_);
}
BluetoothAdapter::UUIDList BluetoothAdapterAndroid::GetUUIDs() const {
@@ -214,7 +214,7 @@ BluetoothAdapterAndroid::BluetoothAdapterAndroid() : weak_ptr_factory_(this) {
BluetoothAdapterAndroid::~BluetoothAdapterAndroid() {
Java_ChromeBluetoothAdapter_onBluetoothAdapterAndroidDestruction(
- AttachCurrentThread(), j_adapter_.obj());
+ AttachCurrentThread(), j_adapter_);
}
void BluetoothAdapterAndroid::PurgeTimedOutDevices() {
@@ -242,7 +242,7 @@ void BluetoothAdapterAndroid::AddDiscoverySession(
if (num_discovery_sessions_ > 0) {
session_added = true;
} else if (Java_ChromeBluetoothAdapter_startScan(AttachCurrentThread(),
- j_adapter_.obj())) {
+ j_adapter_)) {
session_added = true;
// Using a delayed task in order to give the adapter some time
@@ -281,7 +281,7 @@ void BluetoothAdapterAndroid::RemoveDiscoverySession(
if (num_discovery_sessions_ == 0) {
VLOG(1) << "RemoveDiscoverySession: Now 0 sessions. Stopping scan.";
session_removed = Java_ChromeBluetoothAdapter_stopScan(
- AttachCurrentThread(), j_adapter_.obj());
+ AttachCurrentThread(), j_adapter_);
} else {
VLOG(1) << "RemoveDiscoverySession: Now "
<< unsigned(num_discovery_sessions_) << " sessions.";
« no previous file with comments | « content/shell/browser/shell_mojo_test_utils_android.cc ('k') | device/bluetooth/bluetooth_device_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698