diff options
author | sail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-18 22:16:26 +0000 |
---|---|---|
committer | sail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-18 22:16:26 +0000 |
commit | faa2a45bf31af9e1131bb0cfa17ab1e2400ec0e4 (patch) | |
tree | f3f7c49fa06c0b32a78723f77bc3581559abb0f3 /chrome | |
parent | de3c5ea947350a310bcdaabe7a8cb2dbef3fc9a8 (diff) | |
download | chromium_src-faa2a45bf31af9e1131bb0cfa17ab1e2400ec0e4.zip chromium_src-faa2a45bf31af9e1131bb0cfa17ab1e2400ec0e4.tar.gz chromium_src-faa2a45bf31af9e1131bb0cfa17ab1e2400ec0e4.tar.bz2 |
Revert 106142 - Add a new globals object for PPAPI tracking information.
This adds a specialization on the host and plugin side of the proxy. This
replaces the ad-hoc singleton tracking done by the resource and var trackers
with just being getters on this global object.
Most code can use the single PpapiGlobals class. I also allow code to get the
host and plugin specializations since some code needs access to some specific
features of each side.
In a later pass I'll move the other stuff out of TrackerBase and delete it.
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/8316008
TBR=brettw@chromium.org
Review URL: http://codereview.chromium.org/8342016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106148 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/renderer/chrome_ppb_pdf_impl.cc | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/chrome/renderer/chrome_ppb_pdf_impl.cc b/chrome/renderer/chrome_ppb_pdf_impl.cc index 3a39f25..e9b5174 100644 --- a/chrome/renderer/chrome_ppb_pdf_impl.cc +++ b/chrome/renderer/chrome_ppb_pdf_impl.cc @@ -29,15 +29,12 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" #include "unicode/usearch.h" -#include "webkit/plugins/ppapi/host_globals.h" #include "webkit/plugins/ppapi/plugin_delegate.h" #include "webkit/plugins/ppapi/plugin_module.h" #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" #include "webkit/plugins/ppapi/ppb_image_data_impl.h" #include "webkit/plugins/ppapi/resource_tracker.h" -using ppapi::PpapiGlobals; -using webkit::ppapi::HostGlobals; using WebKit::WebView; using content::RenderThread; @@ -126,7 +123,7 @@ static const ResourceImageInfo kResourceImageMap[] = { PP_Var GetLocalizedString(PP_Instance instance_id, PP_ResourceString string_id) { webkit::ppapi::PluginInstance* instance = - HostGlobals::Get()->host_resource_tracker()->GetInstance(instance_id); + webkit::ppapi::ResourceTracker::Get()->GetInstance(instance_id); if (!instance) return PP_MakeUndefined(); @@ -162,7 +159,7 @@ PP_Resource GetResourceImage(PP_Instance instance_id, ResourceBundle::GetSharedInstance().GetBitmapNamed(res_id); // Validate the instance. - if (!HostGlobals::Get()->host_resource_tracker()->GetInstance(instance_id)) + if (!webkit::ppapi::ResourceTracker::Get()->GetInstance(instance_id)) return 0; scoped_refptr<webkit::ppapi::PPB_ImageData_Impl> image_data( new webkit::ppapi::PPB_ImageData_Impl(instance_id)); @@ -190,7 +187,7 @@ PP_Resource GetFontFileWithFallback( PP_PrivateFontCharset charset) { #if defined(OS_LINUX) // Validate the instance before using it below. - if (!HostGlobals::Get()->host_resource_tracker()->GetInstance(instance_id)) + if (!webkit::ppapi::ResourceTracker::Get()->GetInstance(instance_id)) return 0; scoped_refptr<ppapi::StringVar> face_name(ppapi::StringVar::FromPPVar( @@ -222,7 +219,7 @@ bool GetFontTableForPrivateFontFile(PP_Resource font_file, uint32_t* output_length) { #if defined(OS_LINUX) ppapi::Resource* resource = - PpapiGlobals::Get()->GetResourceTracker()->GetResource(font_file); + ppapi::TrackerBase::Get()->GetResourceTracker()->GetResource(font_file); if (!resource) return false; @@ -285,7 +282,7 @@ void SearchString(PP_Instance instance, void DidStartLoading(PP_Instance instance_id) { webkit::ppapi::PluginInstance* instance = - HostGlobals::Get()->host_resource_tracker()->GetInstance(instance_id); + webkit::ppapi::ResourceTracker::Get()->GetInstance(instance_id); if (!instance) return; instance->delegate()->DidStartLoading(); @@ -293,7 +290,7 @@ void DidStartLoading(PP_Instance instance_id) { void DidStopLoading(PP_Instance instance_id) { webkit::ppapi::PluginInstance* instance = - HostGlobals::Get()->host_resource_tracker()->GetInstance(instance_id); + webkit::ppapi::ResourceTracker::Get()->GetInstance(instance_id); if (!instance) return; instance->delegate()->DidStopLoading(); @@ -301,7 +298,7 @@ void DidStopLoading(PP_Instance instance_id) { void SetContentRestriction(PP_Instance instance_id, int restrictions) { webkit::ppapi::PluginInstance* instance = - HostGlobals::Get()->host_resource_tracker()->GetInstance(instance_id); + webkit::ppapi::ResourceTracker::Get()->GetInstance(instance_id); if (!instance) return; instance->delegate()->SetContentRestriction(restrictions); @@ -320,7 +317,7 @@ void UserMetricsRecordAction(PP_Var action) { void HasUnsupportedFeature(PP_Instance instance_id) { webkit::ppapi::PluginInstance* instance = - HostGlobals::Get()->host_resource_tracker()->GetInstance(instance_id); + webkit::ppapi::ResourceTracker::Get()->GetInstance(instance_id); if (!instance) return; @@ -336,7 +333,7 @@ void HasUnsupportedFeature(PP_Instance instance_id) { void SaveAs(PP_Instance instance_id) { webkit::ppapi::PluginInstance* instance = - HostGlobals::Get()->host_resource_tracker()->GetInstance(instance_id); + webkit::ppapi::ResourceTracker::Get()->GetInstance(instance_id); if (!instance) return; instance->delegate()->SaveURLAs(instance->plugin_url()); |