| OLD | NEW |
| 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/java_handler_thread.h" | 7 #include "base/android/java_handler_thread.h" |
| 8 #include "base/android/jni_android.h" | 8 #include "base/android/jni_android.h" |
| 9 #include "base/android/scoped_java_ref.h" | 9 #include "base/android/scoped_java_ref.h" |
| 10 #include "base/atomic_sequence_num.h" | 10 #include "base/atomic_sequence_num.h" |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 return NULL; | 338 return NULL; |
| 339 break; | 339 break; |
| 340 } | 340 } |
| 341 default: | 341 default: |
| 342 NOTREACHED(); | 342 NOTREACHED(); |
| 343 return NULL; | 343 return NULL; |
| 344 } | 344 } |
| 345 { | 345 { |
| 346 base::AutoLock locker(objects_lock_); | 346 base::AutoLock locker(objects_lock_); |
| 347 if (objects_.find(object_id) != objects_.end()) { | 347 if (objects_.find(object_id) != objects_.end()) { |
| 348 return g_background_thread.Get().message_loop()->task_runner().get(); | 348 return g_background_thread.Get().message_loop()->task_runner().get(); |
| 349 } | 349 } |
| 350 } | 350 } |
| 351 return NULL; | 351 return NULL; |
| 352 } | 352 } |
| 353 | 353 |
| 354 bool GinJavaBridgeDispatcherHost::OnMessageReceived( | 354 bool GinJavaBridgeDispatcherHost::OnMessageReceived( |
| 355 const IPC::Message& message) { | 355 const IPC::Message& message) { |
| 356 // We can get here As WebContentsObserver also has OnMessageReceived, | 356 // We can get here As WebContentsObserver also has OnMessageReceived, |
| 357 // or because we have not provided a task runner in | 357 // or because we have not provided a task runner in |
| 358 // OverrideTaskRunnerForMessage. In either case, just bail out. | 358 // OverrideTaskRunnerForMessage. In either case, just bail out. |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 if (iter == objects_.end()) | 482 if (iter == objects_.end()) |
| 483 return; | 483 return; |
| 484 JavaObjectWeakGlobalRef ref = | 484 JavaObjectWeakGlobalRef ref = |
| 485 RemoveHolderAndAdvanceLocked(GetCurrentRoutingID(), &iter); | 485 RemoveHolderAndAdvanceLocked(GetCurrentRoutingID(), &iter); |
| 486 if (!ref.is_empty()) { | 486 if (!ref.is_empty()) { |
| 487 RemoveFromRetainedObjectSetLocked(ref); | 487 RemoveFromRetainedObjectSetLocked(ref); |
| 488 } | 488 } |
| 489 } | 489 } |
| 490 | 490 |
| 491 } // namespace content | 491 } // namespace content |
| OLD | NEW |