| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_RENDERER_JAVA_GIN_JAVA_FUNCTION_INVOCATION_HELPER_H_ | 5 #ifndef CONTENT_RENDERER_JAVA_GIN_JAVA_FUNCTION_INVOCATION_HELPER_H_ |
| 6 #define CONTENT_RENDERER_JAVA_GIN_JAVA_FUNCTION_INVOCATION_HELPER_H_ | 6 #define CONTENT_RENDERER_JAVA_GIN_JAVA_FUNCTION_INVOCATION_HELPER_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 9 |
| 8 #include "base/macros.h" | 10 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 11 #include "content/renderer/java/gin_java_bridge_dispatcher.h" | 12 #include "content/renderer/java/gin_java_bridge_dispatcher.h" |
| 12 #include "gin/arguments.h" | 13 #include "gin/arguments.h" |
| 13 #include "gin/handle.h" | 14 #include "gin/handle.h" |
| 14 | 15 |
| 15 namespace content { | 16 namespace content { |
| 16 | 17 |
| 17 class GinJavaBridgeValueConverter; | 18 class GinJavaBridgeValueConverter; |
| 18 | 19 |
| 19 class GinJavaFunctionInvocationHelper { | 20 class GinJavaFunctionInvocationHelper { |
| 20 public: | 21 public: |
| 21 GinJavaFunctionInvocationHelper( | 22 GinJavaFunctionInvocationHelper( |
| 22 const std::string& method_name, | 23 const std::string& method_name, |
| 23 const base::WeakPtr<GinJavaBridgeDispatcher>& dispatcher); | 24 const base::WeakPtr<GinJavaBridgeDispatcher>& dispatcher); |
| 24 ~GinJavaFunctionInvocationHelper(); | 25 ~GinJavaFunctionInvocationHelper(); |
| 25 | 26 |
| 26 v8::Local<v8::Value> Invoke(gin::Arguments* args); | 27 v8::Local<v8::Value> Invoke(gin::Arguments* args); |
| 27 | 28 |
| 28 private: | 29 private: |
| 29 std::string method_name_; | 30 std::string method_name_; |
| 30 base::WeakPtr<GinJavaBridgeDispatcher> dispatcher_; | 31 base::WeakPtr<GinJavaBridgeDispatcher> dispatcher_; |
| 31 scoped_ptr<GinJavaBridgeValueConverter> converter_; | 32 std::unique_ptr<GinJavaBridgeValueConverter> converter_; |
| 32 | 33 |
| 33 DISALLOW_COPY_AND_ASSIGN(GinJavaFunctionInvocationHelper); | 34 DISALLOW_COPY_AND_ASSIGN(GinJavaFunctionInvocationHelper); |
| 34 }; | 35 }; |
| 35 | 36 |
| 36 } // namespace content | 37 } // namespace content |
| 37 | 38 |
| 38 #endif // CONTENT_RENDERER_JAVA_GIN_JAVA_FUNCTION_INVOCATION_HELPER_H_ | 39 #endif // CONTENT_RENDERER_JAVA_GIN_JAVA_FUNCTION_INVOCATION_HELPER_H_ |
| OLD | NEW |