| 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_RESOURCE_CONVERTER_H | 5 #ifndef CONTENT_RENDERER_PEPPER_RESOURCE_CONVERTER_H |
| 6 #define CONTENT_RENDERER_PEPPER_RESOURCE_CONVERTER_H | 6 #define CONTENT_RENDERER_PEPPER_RESOURCE_CONVERTER_H |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/message_loop/message_loop_proxy.h" | 11 #include "content/common/content_export.h" |
| 12 | 12 |
| 13 namespace content { | 13 namespace content { |
| 14 | 14 |
| 15 // This class is responsible for converting V8 vars to Pepper resources. | 15 // This class is responsible for converting V8 vars to Pepper resources. |
| 16 class ResourceConverter { | 16 class CONTENT_EXPORT ResourceConverter { |
| 17 public: | 17 public: |
| 18 ResourceConverter(); | 18 virtual ~ResourceConverter(); |
| 19 ~ResourceConverter(); | 19 |
| 20 // ShutDown must be called before any vars created by the ResourceConverter | 20 // ShutDown must be called before any vars created by the ResourceConverter |
| 21 // are valid. It handles creating any resource hosts that need to be created. | 21 // are valid. It handles creating any resource hosts that need to be created. |
| 22 // |message_loop_proxy| is the message loop to run the callback from. | 22 virtual void ShutDown(const base::Callback<void(bool)>& callback) = 0; |
| 23 void ShutDown( | 23 }; |
| 24 const base::Callback<void(bool)>& callback, | 24 |
| 25 const scoped_refptr<base::MessageLoopProxy>& message_loop_proxy); | 25 class ResourceConverterImpl : public ResourceConverter { |
| 26 public: |
| 27 ResourceConverterImpl(); |
| 28 virtual ~ResourceConverterImpl(); |
| 29 virtual void ShutDown(const base::Callback<void(bool)>& callback) OVERRIDE; |
| 26 | 30 |
| 27 private: | 31 private: |
| 28 DISALLOW_COPY_AND_ASSIGN(ResourceConverter); | 32 DISALLOW_COPY_AND_ASSIGN(ResourceConverterImpl); |
| 29 }; | 33 }; |
| 30 | 34 |
| 31 } // namespace content | 35 } // namespace content |
| 32 | 36 |
| 33 #endif // CONTENT_RENDERER_PEPPER_RESOURCE_CONVERTER_H | 37 #endif // CONTENT_RENDERER_PEPPER_RESOURCE_CONVERTER_H |
| OLD | NEW |