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

Side by Side Diff: base/android/java/src/org/chromium/base/annotations/CalledByNativeUnchecked.java

Issue 1078343002: Move several annotations to annotations package. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 package org.chromium.base; 5 package org.chromium.base.annotations;
6 6
7 import java.lang.annotation.ElementType; 7 import java.lang.annotation.ElementType;
8 import java.lang.annotation.Retention; 8 import java.lang.annotation.Retention;
9 import java.lang.annotation.RetentionPolicy; 9 import java.lang.annotation.RetentionPolicy;
10 import java.lang.annotation.Target; 10 import java.lang.annotation.Target;
11 11
12 /** 12 /**
13 * @CalledByNativeUnchecked is used to generate JNI bindings that do not check for exceptions. 13 * @CalledByNativeUnchecked is used to generate JNI bindings that do not check for exceptions.
14 * It only makes sense to use this annotation on methods that declare a throws. .. spec. 14 * It only makes sense to use this annotation on methods that declare a throws. .. spec.
15 * However, note that the exception received native side maybe an 'unchecked' ( RuntimeExpception) 15 * However, note that the exception received native side maybe an 'unchecked' ( RuntimeExpception)
16 * such as NullPointerException, so the native code should differentiate these cases. 16 * such as NullPointerException, so the native code should differentiate these cases.
17 * Usage of this should be very rare; where possible handle exceptions in the J ava side and use a 17 * Usage of this should be very rare; where possible handle exceptions in the J ava side and use a
18 * return value to indicate success / failure. 18 * return value to indicate success / failure.
19 */ 19 */
20 @Target(ElementType.METHOD) 20 @Target(ElementType.METHOD)
21 @Retention(RetentionPolicy.CLASS) 21 @Retention(RetentionPolicy.CLASS)
22 public @interface CalledByNativeUnchecked { 22 public @interface CalledByNativeUnchecked {
23 /* 23 /*
24 * If present, tells which inner class the method belongs to. 24 * If present, tells which inner class the method belongs to.
25 */ 25 */
26 public String value() default ""; 26 public String value() default "";
27 } 27 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698