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