Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(313)

Unified Diff: content/renderer/pepper/pepper_instance_state_accessor_impl.h

Issue 10544089: Implement the file chooser as a new resource "host" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/pepper/pepper_instance_state_accessor_impl.h
diff --git a/content/renderer/pepper/pepper_instance_state_accessor_impl.h b/content/renderer/pepper/pepper_instance_state_accessor_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..108686e41459e52057bd116dc40aeca13b7ac423
--- /dev/null
+++ b/content/renderer/pepper/pepper_instance_state_accessor_impl.h
@@ -0,0 +1,45 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_RENDERER_PEPPER_PEPPER_INSTANCE_STATE_ACCESSOR_IMPL_H
+#define CONTENT_RENDERER_PEPPER_PEPPER_INSTANCE_STATE_ACCESSOR_IMPL_H
+
+#include "base/compiler_specific.h"
+#include "content/renderer/pepper/pepper_instance_state_accessor.h"
+
+namespace webkit {
+namespace ppapi {
+class PluginInstance;
+class PluginModule;
+}
+}
+
+namespace content {
+
+class PepperInstanceStateAccessorImpl : public PepperInstanceStateAccessor {
+ public:
+ PepperInstanceStateAccessorImpl(webkit::ppapi::PluginModule* module);
+ virtual ~PepperInstanceStateAccessorImpl();
+
+ // PepperInstanceStateAccessor implmentation.
+ virtual bool IsValidInstance(PP_Instance instance) OVERRIDE;
+ virtual bool HasUserGesture(PP_Instance pp_instance) OVERRIDE;
+
+ private:
+ // Retrieves the plugin instance object associated with the given PP_Instance
+ // and validates that it is one of the instances associated with our module.
+ // Returns NULL on failure.
+ //
+ // We use this to security check the PP_Instance values sent from a plugin to
+ // make sure it's not trying to spoof another instance.
+ webkit::ppapi::PluginInstance* GetAndValidateInstance(PP_Instance instance);
+
+ webkit::ppapi::PluginModule* module_;
+
+ DISALLOW_COPY_AND_ASSIGN(PepperInstanceStateAccessorImpl);
+};
+
+} // namespace content
+
+#endif // CONTENT_RENDERER_PEPPER_PEPPER_INSTANCE_STATE_ACCESSOR_IMPL_H

Powered by Google App Engine
This is Rietveld 408576698