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 #ifndef CONTENT_BROWSER_ANDROID_JAVA_GIN_JAVA_BOUND_OBJECT_H_ | 5 #ifndef CONTENT_BROWSER_ANDROID_JAVA_GIN_JAVA_BOUND_OBJECT_H_ |
6 #define CONTENT_BROWSER_ANDROID_JAVA_GIN_JAVA_BOUND_OBJECT_H_ | 6 #define CONTENT_BROWSER_ANDROID_JAVA_GIN_JAVA_BOUND_OBJECT_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <map> | 11 #include <map> |
| 12 #include <memory> |
12 #include <set> | 13 #include <set> |
13 | 14 |
14 #include "base/android/jni_weak_ref.h" | 15 #include "base/android/jni_weak_ref.h" |
15 #include "base/android/scoped_java_ref.h" | 16 #include "base/android/scoped_java_ref.h" |
16 #include "base/memory/linked_ptr.h" | |
17 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
18 #include "base/values.h" | 18 #include "base/values.h" |
19 #include "content/browser/android/java/java_method.h" | 19 #include "content/browser/android/java/java_method.h" |
20 | 20 |
21 namespace content { | 21 namespace content { |
22 | 22 |
23 class GinJavaBoundObject | 23 class GinJavaBoundObject |
24 : public base::RefCountedThreadSafe<GinJavaBoundObject> { | 24 : public base::RefCountedThreadSafe<GinJavaBoundObject> { |
25 public: | 25 public: |
26 typedef int32_t ObjectID; | 26 typedef int32_t ObjectID; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 void EnsureMethodsAreSetUp(); | 72 void EnsureMethodsAreSetUp(); |
73 | 73 |
74 JavaObjectWeakGlobalRef ref_; | 74 JavaObjectWeakGlobalRef ref_; |
75 | 75 |
76 // An object must be kept in retained_object_set_ either if it has | 76 // An object must be kept in retained_object_set_ either if it has |
77 // names or if it has a non-empty holders set. | 77 // names or if it has a non-empty holders set. |
78 int names_count_; | 78 int names_count_; |
79 std::set<int32_t> holders_; | 79 std::set<int32_t> holders_; |
80 | 80 |
81 // The following fields are accessed on the background thread. | 81 // The following fields are accessed on the background thread. |
82 typedef std::multimap<std::string, linked_ptr<JavaMethod> > JavaMethodMap; | 82 using JavaMethodMap = std::multimap<std::string, std::unique_ptr<JavaMethod>>; |
83 JavaMethodMap methods_; | 83 JavaMethodMap methods_; |
84 jmethodID object_get_class_method_id_; | 84 jmethodID object_get_class_method_id_; |
85 bool are_methods_set_up_; | 85 bool are_methods_set_up_; |
86 base::android::ScopedJavaGlobalRef<jclass> safe_annotation_clazz_; | 86 base::android::ScopedJavaGlobalRef<jclass> safe_annotation_clazz_; |
87 }; | 87 }; |
88 | 88 |
89 } // namespace content | 89 } // namespace content |
90 | 90 |
91 #endif // CONTENT_BROWSER_ANDROID_JAVA_GIN_JAVA_BOUND_OBJECT_H_ | 91 #endif // CONTENT_BROWSER_ANDROID_JAVA_GIN_JAVA_BOUND_OBJECT_H_ |
OLD | NEW |