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

Side by Side Diff: content/browser/android/java/gin_java_bridge_dispatcher_host.cc

Issue 2485513003: Rename JavaObjectWeakGlobalRef::is_empty to avoid misuse. (Closed)
Patch Set: Created 4 years, 1 month 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
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 #include "content/browser/android/java/gin_java_bridge_dispatcher_host.h" 5 #include "content/browser/android/java/gin_java_bridge_dispatcher_host.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/scoped_java_ref.h" 8 #include "base/android/scoped_java_ref.h"
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 int routing_id, 367 int routing_id,
368 GinJavaBoundObject::ObjectID object_id) { 368 GinJavaBoundObject::ObjectID object_id) {
369 DCHECK(JavaBridgeThread::CurrentlyOn()); 369 DCHECK(JavaBridgeThread::CurrentlyOn());
370 DCHECK(routing_id != MSG_ROUTING_NONE); 370 DCHECK(routing_id != MSG_ROUTING_NONE);
371 base::AutoLock locker(objects_lock_); 371 base::AutoLock locker(objects_lock_);
372 auto iter = objects_.find(object_id); 372 auto iter = objects_.find(object_id);
373 if (iter == objects_.end()) 373 if (iter == objects_.end())
374 return; 374 return;
375 JavaObjectWeakGlobalRef ref = 375 JavaObjectWeakGlobalRef ref =
376 RemoveHolderAndAdvanceLocked(routing_id, &iter); 376 RemoveHolderAndAdvanceLocked(routing_id, &iter);
377 if (!ref.is_empty()) { 377 if (!ref.is_uninitialized()) {
378 RemoveFromRetainedObjectSetLocked(ref); 378 RemoveFromRetainedObjectSetLocked(ref);
379 } 379 }
380 } 380 }
381 381
382 } // namespace content 382 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698