DescriptionDon't use Singleton to cache JNI method IDs in Java Bridge
The Java Bridge makes repeated use of numerous JNI method IDs. We wish to avoid
repeatedly looking up these IDS, so we cache them.
Currently we use Singleton objects to achieve this. However, this seems
inappropriate for several reasons ...
- Requires excessive boilerplate
- Thread safety not required
- Exit cleanup not required
We can avoid using Singleton, without introducing static initializers, by
simply using a static local.
See http://codereview.chromium.org/8659007 for background.
TBR=avi
BUG=105547
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=112975
Patch Set 1 #
Total comments: 8
Patch Set 2 : Move caching to GetMethodIDFromClassName() #Patch Set 3 : Finer grained locking #
Total comments: 2
Patch Set 4 : Updated comments, share some constants #
Total comments: 5
Patch Set 5 : Addressed comments and added test #
Total comments: 2
Patch Set 6 : Rename test file, fix comments #
Messages
Total messages: 19 (0 generated)
|