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

Unified Diff: webkit/glue/plugins/fake_plugin_window_tracker_mac.h

Issue 164100: Set up a interposing library for Carbon calls made by plugins. (Closed)
Patch Set: Review comments and files that were lost in the move Created 11 years, 4 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
« no previous file with comments | « chrome/plugin/plugin_main.cc ('k') | webkit/glue/plugins/fake_plugin_window_tracker_mac.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/plugins/fake_plugin_window_tracker_mac.h
diff --git a/webkit/glue/plugins/fake_plugin_window_tracker_mac.h b/webkit/glue/plugins/fake_plugin_window_tracker_mac.h
new file mode 100644
index 0000000000000000000000000000000000000000..d2e7beea738cae9c1c4d984e4267ed50cf2ad99f
--- /dev/null
+++ b/webkit/glue/plugins/fake_plugin_window_tracker_mac.h
@@ -0,0 +1,42 @@
+// Copyright (c) 2009 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 WEBKIT_GLUE_PLUGINS_FAKE_PLUGIN_WINDOW_TRACKER_MAC_H_
+#define WEBKIT_GLUE_PLUGINS_FAKE_PLUGIN_WINDOW_TRACKER_MAC_H_
+
+#include <Carbon/Carbon.h>
+
+#include "base/basictypes.h"
+#include "base/scoped_cftyperef.h"
+
+class WebPluginDelegateImpl;
+
+// Serves as a bridge between password delegate instances and the Carbon
+// interposing library. The Carbon functions we interpose work in terms of
+// WindowRefs, and we need to be able to map from those back to the plugin
+// delegates that know what we should claim about the state of the world.
+class __attribute__((visibility("default"))) FakePluginWindowTracker {
+ public:
+ FakePluginWindowTracker();
+
+ // Returns the shared window tracker instance.
+ static FakePluginWindowTracker* SharedInstance();
+
+ // Creates a new fake window ref associated with |delegate|.
+ WindowRef GenerateFakeWindowForDelegate(WebPluginDelegateImpl* delegate);
+
+ // Returns the WebPluginDelegate associated with the given fake window ref.
+ const WebPluginDelegateImpl* GetDelegateForFakeWindow(WindowRef window) const;
+
+ // Removes the fake window ref entry for |delegate|.
+ void RemoveFakeWindowForDelegate(WebPluginDelegateImpl* delegate,
+ WindowRef window);
+
+ private:
+ scoped_cftyperef<CFMutableDictionaryRef> window_to_delegate_map_;
+
+ DISALLOW_COPY_AND_ASSIGN(FakePluginWindowTracker);
+};
+
+#endif // WEBKIT_GLUE_PLUGINS_FAKE_PLUGIN_WINDOW_TRACKER_MAC_H_
« no previous file with comments | « chrome/plugin/plugin_main.cc ('k') | webkit/glue/plugins/fake_plugin_window_tracker_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698