summaryrefslogtreecommitdiffstats
path: root/webkit/plugins/ppapi/ppb_font_impl.cc
Commit message (Collapse)AuthorAgeFilesLines
* Relanding this with fixes to the mac dbg builderananta@chromium.org2012-01-201-138/+4
| | | | | | | | | | | | | | | | | | Remove the Webkit thread in the PPAPI plugin process and perform the text and font operations on the PPAPI main thread. This thread is now registered as the Webkit thread. Fixes performance issues seen in Flapper with text and font operations. It appears that the perf issues occur due to context switching between the main thread and the webkit thread. As per comments from Brett moving the font forwarding code inline to ppb_font_shared.cc. This file has been moved to ppapi/shared_impl/private as it now brings in a dependency on WebKit. The font creation has been wired up to the ResourceCreationAPI as suggested. BUG=110190 TBR=brettw Review URL: https://chromiumcodereview.appspot.com/9192038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118503 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 118385 since this seems to break mac-debug build.sadrul@chromium.org2012-01-201-4/+138
| | | | | | | | | | | | | | | | | | | | | | """ Remove the Webkit thread in the PPAPI plugin process and perform the text and font operations on the PPAPI main thread. This thread is now registered as the Webkit thread. Fixes performance issues seen in Flapper with text and font operations. It appears that the perf issues occur due to context switching between the main thread and the webkit thread. As per comments from Brett moving the font forwarding code inline to ppb_font_shared.cc. This file has been moved to ppapi/shared_impl/private as it now brings in a dependency on WebKit. The font creation has been wired up to the ResourceCreationAPI as suggested. BUG=110190 R=brettw Review URL: https://chromiumcodereview.appspot.com/9133015 TBR=ananta@chromium.org Review URL: https://chromiumcodereview.appspot.com/9150055 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118399 0039d316-1c4b-4281-b951-d872f2087c98
* Remove the Webkit thread in the PPAPI plugin process and perform the text ↵ananta@chromium.org2012-01-191-138/+4
| | | | | | | | | | | | | | | | | | | and font operations on the PPAPI main thread. This thread is now registered as the Webkit thread. Fixes performance issues seen in Flapper with text and font operations. It appears that the perf issues occur due to context switching between the main thread and the webkit thread. As per comments from Brett moving the font forwarding code inline to ppb_font_shared.cc. This file has been moved to ppapi/shared_impl/private as it now brings in a dependency on WebKit. The font creation has been wired up to the ResourceCreationAPI as suggested. BUG=110190 R=brettw Review URL: https://chromiumcodereview.appspot.com/9133015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118385 0039d316-1c4b-4281-b951-d872f2087c98
* Remove PP_Module from parameters for PPB_Var.VarFromUtf8.dmichael@chromium.org2011-12-071-2/+1
| | | | | | | | | | | | | | | | This change has tendrils stretching throughout the code, but mostly this lets us delete a bunch of stuff. This also does a slight refactor to put the PPB_Var implementations in 1 place, since they were already practically identical, and I didn't want to do the backwards-compat code in 2 places. BUG=106596 TEST=N/A TBR=darin,tony darin,tony TBR for rubber-stamp of webkit/glue/webkit_glue.gypi Review URL: http://codereview.chromium.org/8826011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113491 0039d316-1c4b-4281-b951-d872f2087c98
* Rename the shared_impl resource files to give them more regular names.brettw@chromium.org2011-12-071-2/+2
| | | | | | | | | | | [ Reland of 113290 http://codereview.chromium.org/8790004 ] I keep getting confused between things like AudioImpl and PPB_Audio_Impl. This uses _shared for the names, so now we have _impl, _proxy, and _shared which makes more sense. I also removed the ppb_opengles2_impl file since it was just a forward to the shared version. Review URL: http://codereview.chromium.org/8849003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113428 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 113290 - Rename the shared_impl resource files to give them more ↵brettw@chromium.org2011-12-071-2/+2
| | | | | | | | | | | | | | | | | | regular names. I keep getting confused between things like AudioImpl and PPB_Audio_Impl. This uses _shared for the names, so now we have _impl, _proxy, and _shared which makes more sense. I also removed the ppb_opengles2_impl file since it was just a forward to the shared version. BUG= TEST= Review URL: http://codereview.chromium.org/8790004 TBR=brettw@chromium.org Review URL: http://codereview.chromium.org/8824015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113302 0039d316-1c4b-4281-b951-d872f2087c98
* Rename the shared_impl resource files to give them more regular names.brettw@chromium.org2011-12-061-2/+2
| | | | | | | | | | | | | I keep getting confused between things like AudioImpl and PPB_Audio_Impl. This uses _shared for the names, so now we have _impl, _proxy, and _shared which makes more sense. I also removed the ppb_opengles2_impl file since it was just a forward to the shared version. BUG= TEST= Review URL: http://codereview.chromium.org/8790004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113290 0039d316-1c4b-4281-b951-d872f2087c98
* Remove webkit::ppapi::Resource.brettw@chromium.org2011-08-241-8/+16
| | | | | | | | | | | | | | | | | | | | | This makes all resource _impl's derive directly from ppapi::Resource so we can share code better. This means removing PluginInstances and converting them to PP_Instances. This adds a new ResourceHelper static class to help in the conversion of resources to PluginInstances for the _impl classes. Overall the new code is in general slightly worse than the old because using the ResourceHelper is more annoying than just calling instance() on the old webkit::ppapi::Resource object. However, I'm hoping that, because this will allow us to move more code into shared_impl and reduce duplicate logic, it will eventually have a net positive effect. This also adds a ScopedPPResource class that works just like a scoped_refptr. We need this in a few places. Most of the places that used the old ScopedResourceId class could be removed now since resources have PP_Resource IDs generated even when there's no plugin reference (this didn't use to be the case) so we can pass resources as input params to the plugin even when there's no plugin ref, as long as there's a scoped_refptr to the Resource. Review URL: http://codereview.chromium.org/7669055 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98047 0039d316-1c4b-4281-b951-d872f2087c98
* Don't use a scoped_refptr for StringVar::FromPPVarbrettw@chromium.org2011-08-221-2/+2
| | | | | | | | | | This was leftover from a previous design where I thought it would be necessary. It turns out it just made the code ugly and did unnecessary refcounting. Review URL: http://codereview.chromium.org/7621054 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97751 0039d316-1c4b-4281-b951-d872f2087c98
* Add a unified resource tracker shared between the proxy and the impl.brettw@chromium.org2011-08-181-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This renames the old ResourceObjectBase to Resource and removes the old PluginResource. It moves the resource tracker from the impl to the shared_impl, and makes the proxy use it. Some things become a little less neat because there's no proxy resource base class. In particular GetDispatcher() is now gone. I considered whether to add a helper base class that provides this function, but decided against it and had individual resource classes implement this when their implementation would find it useful. This is because ultimately I want more of this functionality to move into the shared_impl, and it's easier to do that if there are fewer proxy-specific things in the resources. This changes the way that plugins are added to the tracker. Previously they would only be in the tracker if the plugin had a reference to them, although they could be alive if the impl had a scoped_ptr referencing an object. This actually has the bug that if we then give the resource back to the plugin, it wouldn't be refcounted properly and everything would get confused. Now the tracker tracks all live resource objects whether or not the plugin has a ref. This works basically like the var tracker (it would be nice if the var and resource trackers shared more code, but that would further complicate this already overcomplicated patch). The resource tracker takes an extra ref whenever the plugin has one or more, and otherwise just tracks live resources. Review URL: http://codereview.chromium.org/7629017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97314 0039d316-1c4b-4281-b951-d872f2087c98
* Move Var and StringVar to the ppapi/shared_impl so they can be used in thebrettw@chromium.org2011-08-011-1/+2
| | | | | | | | | | | | | | | | | | | proxy. This does not, however, actually use these in the proxy yet, I'll do that in a subsequent pass. ObjectVar is now renamed NPObjectVar and continues to be in webkit/plugins since it uses NPObjects. There will be a corresponding future class in the proxy for proxied objects. The TryCatch that was in var.h is now in npapi_glue.h Most of the rest of the change is updating namespaces. TEST=unit tests BUG=none Review URL: http://codereview.chromium.org/7488062 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94986 0039d316-1c4b-4281-b951-d872f2087c98
* Make the Var object use a PP_Module ID rather than a PluginModule object.brettw@chromium.org2011-07-121-1/+2
| | | | | | | | | | | | This is a first step to moving the Var implementation and tracking into shared_impl so we don't have to have to have a duplicate implementation in the proxy. This means we can't depend on _impl-specific objects like PluginModule from the Var objects. TEST=ppapi tests Review URL: http://codereview.chromium.org/7345016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92255 0039d316-1c4b-4281-b951-d872f2087c98
* Minor cleanup of resource creation. This eliminates a bunch of copy-and-pastebrettw@chromium.org2011-06-221-0/+10
| | | | | | | | | | | code for determining the instance for every request, and also removes a bunch of unnecessary Create() functions for simple resources. TEST=none BUG=none Review URL: http://codereview.chromium.org/7233005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90111 0039d316-1c4b-4281-b951-d872f2087c98
* Convert most remaining resources to use the API/thunk system. The significantbrettw@chromium.org2011-06-221-8/+9
| | | | | | | | | | | | | | | changes here are around the 3D API. Having separate files for the texture mapping interface is no longer necessary for the proxy and the implementation. This also removes the uses of the "old" dynamic casting system (using "GetAs") for other resources that I could find. TEST=ui tests BUG=none Review URL: http://codereview.chromium.org/7206016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90096 0039d316-1c4b-4281-b951-d872f2087c98
* Convert more interfaces to the new thunk system. This goes up to and includingbrettw@chromium.org2011-06-011-1/+1
| | | | | | | | | | | | | | | the ones starting with "F". Since this adds a lot more interfaces, I added the macro stuff we used for the old system to generate the various template specializations. This involded a lot of renaming since the As* needs to match the name (I was previously leaving off the "PPB_" part). I did other misc cleanup to the infrastructure. Review URL: http://codereview.chromium.org/7082036 Reland 87415 Review URL: http://codereview.chromium.org/7105013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87444 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 87415 - Convert more interfaces to the new thunk system. This goes up ↵thestig@chromium.org2011-06-011-1/+1
| | | | | | | | | | | | | | | | | to and including the ones starting with "F". Since this adds a lot more interfaces, I added the macro stuff we used for the old system to generate the various template specializations. This involded a lot of renaming since the As* needs to match the name (I was previously leaving off the "PPB_" part). I did other misc cleanup to the infrastructure. Review URL: http://codereview.chromium.org/7082036 TBR=brettw@chromium.org Review URL: http://codereview.chromium.org/7006022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87438 0039d316-1c4b-4281-b951-d872f2087c98
* Convert more interfaces to the new thunk system. This goes up to and includingbrettw@chromium.org2011-06-011-1/+1
| | | | | | | | | | | | the ones starting with "F". Since this adds a lot more interfaces, I added the macro stuff we used for the old system to generate the various template specializations. This involded a lot of renaming since the As* needs to match the name (I was previously leaving off the "PPB_" part). I did other misc cleanup to the infrastructure. Review URL: http://codereview.chromium.org/7082036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87415 0039d316-1c4b-4281-b951-d872f2087c98
* Move Broker, Buffer, CharSet, and CursorControl to use the new thunk/API system.brettw@chromium.org2011-05-271-1/+2
| | | | | | | | | | | This changes the way that the function APIs work in the webkit directory, now they're created per-instance rather than globally, and have their Plugininstance as a class member (this cleans up some code). I had to move the InstanceData member to be a linked_ptr due to copy constructor issues, but this should be more efficient anyway. Review URL: http://codereview.chromium.org/7077024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87094 0039d316-1c4b-4281-b951-d872f2087c98
* Use the WebKit default fonts when specifying generic font families.brettw@chromium.org2011-05-261-1/+3
| | | | | | | | | | | | | This pipes through a new preferences object that the font system can use. It now picks up these faces as well as the default font size. Clarify this behavior in the interface. TEST=manual (font example included). BUG=none Review URL: http://codereview.chromium.org/7053022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86870 0039d316-1c4b-4281-b951-d872f2087c98
* Support getting the font list in Pepper. This currently only works out ofbrettw@chromium.org2011-05-181-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | process. This adds a function to the font interface to get the font list. Since we don't have arrays or dictionaries in Pepper yet, I used a string with nulls separating the names. A previous attempt to make a "font list resource" proved excessively complicated and not actually much easier for clients to deal with. This refactors the existing font list getting that used to be in the options for the browser. I moved it to content and split it into two pieces, the synchronous version, and then an asynchronous wrapper around that which both the prefs code and the pepper code use. This cleaned up some of the preferences code, and also fixes the leak of the entire font list in the code. I used the new callback/bind system for the async font loading. I had to add BrowserThread support for the new system. This uses the PepperMessageFilter to listen for font load requests from the plugin in the browser process. This is nice because we can add stuff here and have messages serviced for both in-process and out-of-process plugins. This proved to be complicated due to the HostResolver used in some of the existing code, and thread restrictions for how to deal with it. This is why there are two modes for the filter object. I changed the delegates around for the Dispatcher. Now the PluginDispatcher has the delegate interface since the HostDispatcher didn't actually need any of them and we were accumulating a lot of empty functions in the PepperPluginRegistry. It's possible for the fonts to be loaded on Windows and Mac without IPC, since enumerating fonts should be possible inside the sandbox. I didn't implement this since it adds extra complexity and probably doesn't give that much benefit. TEST=manual BUG=none Review URL: http://codereview.chromium.org/7044012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85827 0039d316-1c4b-4281-b951-d872f2087c98
* Convert audio-related messages to the new thunk/API system for Pepper.brettw@chromium.org2011-05-131-1/+1
| | | | | | | | | | | | | | | | | | | This has a bit of a change from the previous couple of resources that were converted in that the ResourceCreationProxy now calls a static proxy function for actually doing the work. It became too complicated and required that the ResourceCreationProxy know a lot about the internals of the objects. Did a little namespace cleanup. This renames "pp::shared_impl" to just use the "ppapi" namespace. The "shared_impl" was ugly and didn't help anything. Some files in that directory used "ppapi::shared_impl" instead which was even more confusing. Do a little build cleanup. The old ppapi_shared_proxy.gypi is now split into two sub-files, one for ppapi_shared, and one for ppapi_proxy. It's hopefully easier to find stuff now. Review URL: http://codereview.chromium.org/7014024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85303 0039d316-1c4b-4281-b951-d872f2087c98
* Make the Pepper proxy support in-process font rendering.brettw@chromium.org2011-05-101-232/+65
| | | | | | | | | | | | | This implements a WebKit thread in the PPAPI plugin process so we can do the font calls without IPC. The existing font support was refactored into a virtual class (to prevent PPAPI from depending on WebKit and creating a circular GYP dependency). This moves the renderer sandbox support into content/common so that it can be used by the PPAPI process. Review URL: http://codereview.chromium.org/6981001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84856 0039d316-1c4b-4281-b951-d872f2087c98
* First pass at making the proxy handle multiple renderers. This associates thebrettw@chromium.org2011-01-211-1/+1
| | | | | | | | | | | | | | | | | | | | instance with resources and has most callers retrieve the dispatcher according to the appropriate instance. This isn't hooked up to anything yet. This changes some PPB_Flash interface methods to use PP_Bool. The most challenging part of the change is in the plugin_var_tracker which now needs to track which dispatcher each var object came from, and remap var IDs since each renderer will be generating var IDs in its own space, which will likely overlap. A similar system will need to be done for resources which is not implemented yet. I added some null checks in audio_impl because audio_ can be NULL in some cases when using the trusted API. I discovered this when testing NaCl for this patch. Review URL: http://codereview.chromium.org/6282007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72053 0039d316-1c4b-4281-b951-d872f2087c98
* Roll WebKit DEPS past WebKit move. Update gyp files and include paths to ↵abarth@chromium.org2011-01-171-6/+6
| | | | | | reflect the move. Consolidate how we DEPS in WebKit source files. Cross fingers. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71586 0039d316-1c4b-4281-b951-d872f2087c98
* Make PP_Resources associated with the Instance rather than the module. Thisbrettw@chromium.org2011-01-151-8/+8
| | | | | | | | | | | | | | | | | | | | | | adds PP_Instance to the necessary places in the API to make this possible. String and Object vars used to be PP_Resources. But it is not practical to assocaited strings with an instance since then we can't have implicit var constructors and have to litter every string with an instance. So this changes vars to use their own tracking system associated with the module (i.e. keeping the current semantics) and making it no longer a resource. I made the internal Var IDs 32 bits since Neb is about to land his 64->32 change. Now it force-deletes resources associated with an instance when that instance goes away. I added some additional code and tracking in ResourceTracker to do this. I could then remove the Instance::Observer class since the resource can use the (now renamed) StoppedTracking to know that it's being deleted in response to the instance being destroyed. TEST=ppapi ui tests BUG=none git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71544 0039d316-1c4b-4281-b951-d872f2087c98
* Move the Pepper implementation from webkit/glue/plugins/pepper_* tobrettw@chromium.org2010-12-161-0/+302
webkit/plugins/ppapi/*. This renamed the files and interface implementation classes from foo.cc/Foo to ppb_foo_impl/PPB_Foo_Impl to match the proxy ppb_foo_proxy/PPB_Foo_Proxy. This moves plugin_switches.* from webkit/glue/plugins to webkit/plugins. Review URL: http://codereview.chromium.org/5828003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69424 0039d316-1c4b-4281-b951-d872f2087c98