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

Unified Diff: content/browser/renderer_host/pepper/browser_ppapi_host_impl.h

Issue 10909138: Convert the async device ID getter to a chrome resource host (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 3 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/browser/renderer_host/pepper/browser_ppapi_host_impl.h
diff --git a/content/browser/renderer_host/pepper/browser_ppapi_host_impl.h b/content/browser/renderer_host/pepper/browser_ppapi_host_impl.h
index 98edba11290ee39b1d571d7aa8e3176c732eff3e..6a9495938748bf721d47c2ebcf0b52fa48147fdf 100644
--- a/content/browser/renderer_host/pepper/browser_ppapi_host_impl.h
+++ b/content/browser/renderer_host/pepper/browser_ppapi_host_impl.h
@@ -5,6 +5,8 @@
#ifndef CONTENT_BROWSER_RENDERER_HOST_PEPPER_BROWSER_PPAPI_HOST_IMPL_H_
#define CONTENT_BROWSER_RENDERER_HOST_PEPPER_BROWSER_PPAPI_HOST_IMPL_H_
+#include <map>
+
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "content/browser/renderer_host/pepper/content_browser_pepper_host_factory.h"
@@ -35,20 +37,35 @@ class CONTENT_EXPORT BrowserPpapiHostImpl
// BrowserPpapiHost.
virtual ppapi::host::PpapiHost* GetPpapiHost() OVERRIDE;
virtual base::ProcessHandle GetPluginProcessHandle() const OVERRIDE;
+ virtual bool IsValidInstance(PP_Instance instance) const OVERRIDE;
+ virtual RenderViewIDs GetRenderViewIDsForInstance(
+ PP_Instance instance) const OVERRIDE;
void set_plugin_process_handle(base::ProcessHandle handle) {
plugin_process_handle_ = handle;
}
+ // These two functions are notifications that an instance has been created
+ // or destroyed. They allow us to maintain a mapping of PP_Instance to view
+ // IDs in the browser process.
+ void AddInstanceForView(PP_Instance instance,
+ int render_process_id,
+ int render_view_id);
+ void DeleteInstanceForView(PP_Instance instance);
+
private:
friend class BrowserPpapiHostTest;
virtual ~BrowserPpapiHostImpl();
- ContentBrowserPepperHostFactory host_factory_;
ppapi::host::PpapiHost ppapi_host_;
base::ProcessHandle plugin_process_handle_;
+ // Tracks all PP_Instances in this plugin and maps them to
+ // RenderProcess/RenderView IDs.
+ typedef std::map<PP_Instance, RenderViewIDs> InstanceToViewMap;
+ InstanceToViewMap instance_to_view_;
+
DISALLOW_COPY_AND_ASSIGN(BrowserPpapiHostImpl);
};

Powered by Google App Engine
This is Rietveld 408576698