Cast: Stop logging kVideoFrameSentToEncoder and rename a couple events.
[chromium-blink-merge.git] / content / browser / renderer_host / java / java_method.h
blob6356f70069dd2e6b3065904260ae9941688ecfc4
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_
8 #include <jni.h>
9 #include <string>
10 #include <vector>
12 #include "base/android/scoped_java_ref.h"
13 #include "content/browser/renderer_host/java/java_type.h"
15 namespace content {
17 // Wrapper around java.lang.reflect.Method. This class must be used on a single
18 // thread only.
19 class JavaMethod {
20 public:
21 explicit JavaMethod(const base::android::JavaRef<jobject>& method);
22 ~JavaMethod();
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;
28 jmethodID id() const;
30 private:
31 void EnsureNumParametersIsSetUp() const;
32 void EnsureTypesAndIDAreSetUp() const;
34 std::string name_;
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_