1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_JAVA_JAVA_METHOD_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_JAVA_JAVA_METHOD_H_
12 #include "base/android/scoped_java_ref.h"
13 #include "content/browser/renderer_host/java/java_type.h"
17 // Wrapper around java.lang.reflect.Method. This class must be used on a single
21 explicit JavaMethod(const base::android::JavaRef
<jobject
>& method
);
24 const std::string
& name() const { return name_
; }
25 size_t num_parameters() const;
26 const JavaType
& parameter_type(size_t index
) const;
27 const JavaType
& return_type() const;
31 void EnsureNumParametersIsSetUp() const;
32 void EnsureTypesAndIDAreSetUp() const;
35 mutable base::android::ScopedJavaGlobalRef
<jobject
> java_method_
;
36 mutable bool have_calculated_num_parameters_
;
37 mutable size_t num_parameters_
;
38 mutable std::vector
<JavaType
> parameter_types_
;
39 mutable JavaType return_type_
;
40 mutable jmethodID id_
;
42 DISALLOW_IMPLICIT_CONSTRUCTORS(JavaMethod
);
45 } // namespace content
47 #endif // CONTENT_BROWSER_RENDERER_HOST_JAVA_JAVA_METHOD_H_