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

Unified Diff: content/renderer/pepper/content_instance_glue_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/content_instance_glue_impl.h
diff --git a/content/renderer/pepper/content_instance_glue_impl.h b/content/renderer/pepper/content_instance_glue_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..b74ebc14f257cd554e74bf4ad971f98ad4abaecb
--- /dev/null
+++ b/content/renderer/pepper/content_instance_glue_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_CONTENT_INSTANCE_GLUE_IMPL_H_
+#define CONTENT_RENDERER_PEPPER_CONTENT_INSTANCE_GLUE_IMPL_H_
+
+#include "base/compiler_specific.h"
+#include "content/renderer/pepper/content_instance_glue.h"
+
+namespace webkit {
+namespace ppapi {
+class PluginInstance;
+class PluginModule;
+}
+}
+
+namespace content {
+
+class ContentInstanceGlueImpl : public ContentInstanceGlue {
+ public:
+ ContentInstanceGlueImpl(webkit::ppapi::PluginModule* module);
+ virtual ~ContentInstanceGlueImpl();
+
+ // ContentInstanceGlue 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(ContentInstanceGlueImpl);
+};
+
+} // namespace content
+
+#endif // CONTENT_RENDERER_PEPPER_CONTENT_INSTANCE_GLUE_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698