OLD | NEW |
| (Empty) |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_INSTANCE_STATE_ACCESSOR_IMPL_H | |
6 #define CONTENT_RENDERER_PEPPER_PEPPER_INSTANCE_STATE_ACCESSOR_IMPL_H | |
7 | |
8 #include "base/compiler_specific.h" | |
9 #include "content/renderer/pepper/pepper_instance_state_accessor.h" | |
10 | |
11 namespace webkit { | |
12 namespace ppapi { | |
13 class PluginInstance; | |
14 class PluginModule; | |
15 } | |
16 } | |
17 | |
18 namespace content { | |
19 | |
20 class PepperInstanceStateAccessorImpl : public PepperInstanceStateAccessor { | |
21 public: | |
22 PepperInstanceStateAccessorImpl(webkit::ppapi::PluginModule* module); | |
23 virtual ~PepperInstanceStateAccessorImpl(); | |
24 | |
25 // PepperInstanceStateAccessor implmentation. | |
26 virtual bool IsValidInstance(PP_Instance instance) OVERRIDE; | |
27 virtual bool HasUserGesture(PP_Instance pp_instance) OVERRIDE; | |
28 | |
29 private: | |
30 // Retrieves the plugin instance object associated with the given PP_Instance | |
31 // and validates that it is one of the instances associated with our module. | |
32 // Returns NULL on failure. | |
33 // | |
34 // We use this to security check the PP_Instance values sent from a plugin to | |
35 // make sure it's not trying to spoof another instance. | |
36 webkit::ppapi::PluginInstance* GetAndValidateInstance(PP_Instance instance); | |
37 | |
38 webkit::ppapi::PluginModule* module_; | |
39 | |
40 DISALLOW_COPY_AND_ASSIGN(PepperInstanceStateAccessorImpl); | |
41 }; | |
42 | |
43 } // namespace content | |
44 | |
45 #endif // CONTENT_RENDERER_PEPPER_PEPPER_INSTANCE_STATE_ACCESSOR_IMPL_H | |
OLD | NEW |