OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_PEPPER_TRY_CATCH_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_TRY_CATCH_H_ |
6 #define CONTENT_RENDERER_PEPPER_PEPPER_TRY_CATCH_H_ | 6 #define CONTENT_RENDERER_PEPPER_PEPPER_TRY_CATCH_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "content/common/content_export.h" |
9 #include "ppapi/c/pp_var.h" | 10 #include "ppapi/c/pp_var.h" |
10 #include "ppapi/shared_impl/scoped_pp_var.h" | 11 #include "ppapi/shared_impl/scoped_pp_var.h" |
11 #include "v8/include/v8.h" | 12 #include "v8/include/v8.h" |
12 | 13 |
13 namespace content { | 14 namespace content { |
14 | 15 |
15 class PepperPluginInstanceImpl; | 16 class PepperPluginInstanceImpl; |
16 | 17 |
17 // Base class for scripting TryCatch helpers. | 18 // Base class for scripting TryCatch helpers. |
18 class PepperTryCatch { | 19 class CONTENT_EXPORT PepperTryCatch { |
19 public: | 20 public: |
20 PepperTryCatch(PepperPluginInstanceImpl* instance, | 21 PepperTryCatch(PepperPluginInstanceImpl* instance, |
21 bool convert_objects); | 22 bool convert_objects); |
22 virtual ~PepperTryCatch(); | 23 virtual ~PepperTryCatch(); |
23 | 24 |
24 virtual void SetException(const char* message) = 0; | 25 virtual void SetException(const char* message) = 0; |
25 // Gets the plugin context. Virtual so it can be overriden for testing. | 26 // Gets the plugin context. Virtual so it can be overriden for testing. |
26 virtual v8::Handle<v8::Context> GetContext(); | 27 virtual v8::Handle<v8::Context> GetContext(); |
27 | 28 |
28 // Convenience functions for doing conversions to/from V8 values and sets an | 29 // Convenience functions for doing conversions to/from V8 values and sets an |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 86 |
86 PP_Var* exception_; | 87 PP_Var* exception_; |
87 bool exception_is_set_; | 88 bool exception_is_set_; |
88 | 89 |
89 DISALLOW_COPY_AND_ASSIGN(PepperTryCatchVar); | 90 DISALLOW_COPY_AND_ASSIGN(PepperTryCatchVar); |
90 }; | 91 }; |
91 | 92 |
92 } // namespace content | 93 } // namespace content |
93 | 94 |
94 #endif // CONTENT_RENDERER_PEPPER_PEPPER_TRY_CATCH_H_ | 95 #endif // CONTENT_RENDERER_PEPPER_PEPPER_TRY_CATCH_H_ |
OLD | NEW |