OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_PEPPER_V8_VAR_CONVERTER_H | 5 #ifndef CONTENT_RENDERER_PEPPER_V8_VAR_CONVERTER_H |
6 #define CONTENT_RENDERER_PEPPER_V8_VAR_CONVERTER_H | 6 #define CONTENT_RENDERER_PEPPER_V8_VAR_CONVERTER_H |
7 | 7 |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 namespace content { | 22 namespace content { |
23 | 23 |
24 class ResourceConverter; | 24 class ResourceConverter; |
25 | 25 |
26 class CONTENT_EXPORT V8VarConverter { | 26 class CONTENT_EXPORT V8VarConverter { |
27 public: | 27 public: |
28 explicit V8VarConverter(PP_Instance instance); | 28 explicit V8VarConverter(PP_Instance instance); |
29 // Constructor for testing. | 29 // Constructor for testing. |
30 V8VarConverter( | 30 V8VarConverter( |
31 PP_Instance instance, | 31 PP_Instance instance, |
32 const scoped_refptr<base::MessageLoopProxy>& message_loop_proxy, | |
33 scoped_ptr<ResourceConverter> resource_converter); | 32 scoped_ptr<ResourceConverter> resource_converter); |
34 ~V8VarConverter(); | 33 ~V8VarConverter(); |
35 | 34 |
36 // Converts the given PP_Var to a v8::Value. True is returned upon success. | 35 // Converts the given PP_Var to a v8::Value. True is returned upon success. |
37 bool ToV8Value(const PP_Var& var, | 36 bool ToV8Value(const PP_Var& var, |
38 v8::Handle<v8::Context> context, | 37 v8::Handle<v8::Context> context, |
39 v8::Handle<v8::Value>* result); | 38 v8::Handle<v8::Value>* result); |
40 | 39 |
41 // Converts the given v8::Value to a PP_Var. Every PP_Var in the reference | 40 // Converts the given v8::Value to a PP_Var. Every PP_Var in the reference |
42 // graph in the result will have a refcount equal to the number of references | 41 // graph in the result will have a refcount equal to the number of references |
(...skipping 13 matching lines...) Expand all Loading... |
56 | 55 |
57 // The converter to use for converting V8 vars to resources. | 56 // The converter to use for converting V8 vars to resources. |
58 scoped_ptr<ResourceConverter> resource_converter_; | 57 scoped_ptr<ResourceConverter> resource_converter_; |
59 | 58 |
60 DISALLOW_COPY_AND_ASSIGN(V8VarConverter); | 59 DISALLOW_COPY_AND_ASSIGN(V8VarConverter); |
61 }; | 60 }; |
62 | 61 |
63 } // namespace content | 62 } // namespace content |
64 | 63 |
65 #endif // CONTENT_RENDERER_PEPPER_V8_VAR_CONVERTER_H | 64 #endif // CONTENT_RENDERER_PEPPER_V8_VAR_CONVERTER_H |
OLD | NEW |