summaryrefslogtreecommitdiffstats
path: root/gin
Commit message (Collapse)AuthorAgeFilesLines
* Add src/gin to the GN build.brettw@chromium.org2014-05-221-0/+130
| | | | | | | | TBR=aa@chromium.org Review URL: https://codereview.chromium.org/294163002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@272361 0039d316-1c4b-4281-b951-d872f2087c98
* Don't pass --harmony-promises flag from gin to v8jochen@chromium.org2014-05-191-1/+1
| | | | | | | | | | | Promises are now enabled by default BUG=none R=adamk@chromium.org Review URL: https://codereview.chromium.org/290273004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271410 0039d316-1c4b-4281-b951-d872f2087c98
* Fix gin's array buffer class for component buildjochen@chromium.org2014-05-162-1/+9
| | | | | | | | | | | | Remove ArrayBuffer ctor that is not defined. Add explicit assignment operator for ArrayBufferView. BUG=none R=dcarney@chromium.org,mnaganov@chromium.org Review URL: https://codereview.chromium.org/289003007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271003 0039d316-1c4b-4281-b951-d872f2087c98
* Update file-level comment for gin::IsolateHolderjochen@chromium.org2014-05-021-4/+4
| | | | | | | | | BUG=368728 R=abarth@chromium.org Review URL: https://codereview.chromium.org/261823009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@267972 0039d316-1c4b-4281-b951-d872f2087c98
* gin: Stop converting float values into integers implicitlyhajimehoshi@chromium.org2014-04-162-3/+3
| | | | | | | | | | This CL is basically revert of https://codereview.chromium.org/195893017/. TEST=layout tests, gin_unittests Review URL: https://codereview.chromium.org/236883002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@264170 0039d316-1c4b-4281-b951-d872f2087c98
* Pass the amount of virtual memory to v8jochen@chromium.org2014-04-111-0/+1
| | | | | | | | | BUG=none R=dcarney@chromium.org Review URL: https://codereview.chromium.org/230653003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@263243 0039d316-1c4b-4281-b951-d872f2087c98
* Don't enable all harmony features in mojo/ginjochen@chromium.org2014-04-091-2/+1
| | | | | | | | | | | | We shouldn't use experimental features. Restrict usage to promises which is actually used by mojo/js and about to launch. BUG=360554 R=abarth@chromium.org Review URL: https://codereview.chromium.org/228253002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262639 0039d316-1c4b-4281-b951-d872f2087c98
* Make net use v8 through ginjochen@chromium.org2014-04-086-12/+21
| | | | | | | | | | | | - no longer try to use the default isolate (we want to remove it from v8) - add the option to gin to manage an isolate in non-strict mode BUG=359977 R=eroman@chromium.org,abarth@chromium.org Review URL: https://codereview.chromium.org/227233006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262559 0039d316-1c4b-4281-b951-d872f2087c98
* [gin] Add a v8::Platform implementation to allow for v8 posting tasksjochen@chromium.org2014-04-046-1/+99
| | | | | | | | | | | | This currently has no effect unless concurrent sweeping and job based sweeping is turned on in v8. BUG=v8:3015 R=abarth@chromium.org,dcarney@chromium.org Review URL: https://codereview.chromium.org/225413004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@261872 0039d316-1c4b-4281-b951-d872f2087c98
* Change mojo JS bindings to expose a handle object, which is Closed when garbagempcomplete@chromium.org2014-04-034-0/+64
| | | | | | | | | | collected, rather than a raw integer. BUG=357785 Review URL: https://codereview.chromium.org/214183003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@261479 0039d316-1c4b-4281-b951-d872f2087c98
* gin: Automatic conversion from JS number to intgerhajimehoshi@chromium.org2014-03-142-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | Now gin doesn't convert JavaScript double to an integer. This means that gin::Arguments::GetNext() with a pointer of an integer fails when the next arguments is double, and nothing is set to the vairable. IMO this can cause bugs which are hard to understand. It is because on JavaScript side we can't distinguish integer and double, and GetNext() with an integer variable and JS number produces unstable results. For example, In [1], EventSender's mouseMoveTo is called with arguments which can be doubles, not integers, but EventSender::mouseToMove excepts integers. Now EventSender is implemented by CppBoundClass and toInt32 is used explicitly, but now EventSender is being moved to gin, and using GetNext with integer vairables simply will fail. [1] https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/LayoutTests/fast/events/5056619.html&sq=package:chromium BUG=331301 TEST=gin_unittests --gtest_filter=ConverterTest.Int32 Review URL: https://codereview.chromium.org/195893017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257105 0039d316-1c4b-4281-b951-d872f2087c98
* Move TestRunner from CppVariable to gin::Wrappablehajimehoshi@chromium.org2014-03-141-0/+11
| | | | | | | | | BUG=297480, 331301 TEST=all layout tests Review URL: https://codereview.chromium.org/185263006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257079 0039d316-1c4b-4281-b951-d872f2087c98
* Get rid of even more Script::New calls in Chromium.marja@chromium.org2014-03-121-1/+1
| | | | | | | | | | | | Script::Compile is the right way (see previous changes in https://codereview.chromium.org/178663008 ). R=jochen@chromium.org BUG= Review URL: https://codereview.chromium.org/196573003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@256538 0039d316-1c4b-4281-b951-d872f2087c98
* gin: Add the concept of named and indexed interceptors.jochen@chromium.org2014-03-128-0/+509
| | | | | | | | | | | This will allow for using gin as a drop-in replacement for NPObject. BUG=347565 R=abarth@chromium.org,dcarney@chromium.org,aa@chromium.org Review URL: https://codereview.chromium.org/194603003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@256431 0039d316-1c4b-4281-b951-d872f2087c98
* Move AppendFile and *CurrentDirectory to the base namespace.brettw@chromium.org2014-03-111-1/+1
| | | | | | | | | | This moves AppendFile, GetCurrentDirectory, and SetCurrentDirectory to the base namespace. TBR=jam Review URL: https://codereview.chromium.org/177923007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@256309 0039d316-1c4b-4281-b951-d872f2087c98
* gin: Add ability to install call-as-function handlers on gin::Wrappablejochen@chromium.org2014-03-104-0/+103
| | | | | | | | | BUG=347565 R=dcarney@chromium.org Review URL: https://codereview.chromium.org/192693002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@255927 0039d316-1c4b-4281-b951-d872f2087c98
* Adds ModuleRegistryObserver interfacesky@chromium.org2014-03-065-0/+129
| | | | | | | | | | | | | This will be used to know when a module has been added so that I can download needed modules. BUG=none TEST=none R=abarth@chromium.org Review URL: https://codereview.chromium.org/187653004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@255291 0039d316-1c4b-4281-b951-d872f2087c98
* Two gin testssky@chromium.org2014-03-014-0/+72
| | | | | | | | | | | | | | | | Verifies ModuleRegistry can be looked up from context and that it is no longer available once ContextHolder is destroyed. Similarly verifies PerContextData is available once a ContextHolder is created and that it's context_holder() member points back to the ContextHolder. BUG=none TEST=none R=abarth@chromium.org Review URL: https://codereview.chromium.org/182683005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@254362 0039d316-1c4b-4281-b951-d872f2087c98
* Adds PerContextData::context_holder()sky@chromium.org2014-02-283-4/+11
| | | | | | | | | | | | | I need this as WebKit creates the ContextHolder and I need a handle to it. BUG=none TEST=none R=abarth@chromium.org Review URL: https://codereview.chromium.org/184013002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@254250 0039d316-1c4b-4281-b951-d872f2087c98
* Nukes ContextSupplement and makes PerContextData extend SupportUserDatasky@chromium.org2014-02-285-83/+32
| | | | | | | | | | | | | This gives the same functionality and ownership model while making it simpler to associate arbitrary data with a context. BUG=none TEST=none R=abarth@chromium.org Review URL: https://codereview.chromium.org/183433002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@254126 0039d316-1c4b-4281-b951-d872f2087c98
* gin: Bug fix: Fix CreateHandle to return an emtpy handle in some extreme caseshajimehoshi@chromium.org2014-02-283-1/+34
| | | | | | | | | | | | | | In some extreme cases, ObjectTemplate::NewInstance might return an empty handler. For example, the getter and setter Object.prototype.constructor can be rewritten with a evil function which can throw exceptions. BUG=331301 TEST=gin_unittests --gtest_filter=WrappableTest.ErrorInObjectConstructorProperty Review URL: https://codereview.chromium.org/184253004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@254109 0039d316-1c4b-4281-b951-d872f2087c98
* Fixes header guard of ShellRunnersky@chromium.org2014-02-271-3/+3
| | | | | | | | | | | | | | I forgot to change these when I renamed from DefaultRunner to ShellRunner. BUG=none TEST=none R=abarth@chromium.org TBR=abarth@chromium.org Review URL: https://codereview.chromium.org/179203005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@253906 0039d316-1c4b-4281-b951-d872f2087c98
* Use Script::Compile instead of Script::Newmarja@chromium.org2014-02-272-4/+4
| | | | | | | | | | | | | | | Script::New creates a context-independent script. Using it only makes sense if the resulting Script will be run in many different contexts. All these places run the script right after creating it, and only in one context. So they should have used Script::Compile, which creates a Script bound to the current context. Context-bound scripts are more efficient than context-unbound scripts. R=jochen@chromium.org BUG= Review URL: https://codereview.chromium.org/178663008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@253884 0039d316-1c4b-4281-b951-d872f2087c98
* Refactors parts of gin:sky@chromium.org2014-02-2717-172/+250
| | | | | | | | | | | | | | | | | | | | | . Runner no longer extends ContextHolder. It will still have a ContextHolder, but not own it. This enables a couple of things: . Runner no longer need own a v8::Context. . Runner can be lazily created after the ContextHolder. . Runner becomes a (mostly) pure virtual interface. This enables an implementation to execute through blink rather than v8 directly. . What was Runner is now DefaultRunner (and DefaultRunnerDelegate). I'm not a fan of these names, if you have better ideas let me know. Maybe DirectRunner? BUG=none TEST=none R=abarth@chromium.org Review URL: https://codereview.chromium.org/179803007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@253732 0039d316-1c4b-4281-b951-d872f2087c98
* Remove obsolete gin::IsolateHolder ctorjochen@chromium.org2014-02-252-10/+0
| | | | | | | | | BUG=none R=abarth@chromium.org Review URL: https://codereview.chromium.org/173843002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@253089 0039d316-1c4b-4281-b951-d872f2087c98
* gin: Make it possible to use gin array buffers when running on top of blinkjochen@chromium.org2014-02-205-20/+44
| | | | | | | | | | | | | | | This approach won't let use share an array buffer with blink, however, it's good enough for a mojo js app. For gin::Wrappable objects that want to interact with blink APIs, they need to provide a custom converter to and from WebArrayBuffer(View) BUG=none R=abarth@chromium.org, dslomov@chromium.org, sky@chromium.org Review URL: https://codereview.chromium.org/172133002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@252190 0039d316-1c4b-4281-b951-d872f2087c98
* gin: Only use primitive types for creating function templatesjochen@chromium.org2014-02-113-56/+98
| | | | | | | | | | | | Otherwise, the function template will keep the context alive it was created in. BUG=342272 R=dcarney@chromium.org,aa@chromium.org,haraken@chromium.org Review URL: https://codereview.chromium.org/141143012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@250412 0039d316-1c4b-4281-b951-d872f2087c98
* Removes MessageLoop::TYPE_XXX where possiblesky@chromium.org2014-01-151-2/+1
| | | | | | | | | | | | This is part of attempting to get rid of MessageLoop::Type enum. BUG=none TEST=none R=darin@chromium.org Review URL: https://codereview.chromium.org/136683004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244996 0039d316-1c4b-4281-b951-d872f2087c98
* Introduce a monotonic_clock module for Mojo.js.aa@chromium.org2014-01-102-3/+9
| | | | | | | | | | Am having trouble coming up with a satisfactory way to test. BUG= Review URL: https://codereview.chromium.org/129633005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244062 0039d316-1c4b-4281-b951-d872f2087c98
* Make the cube spin in the JS mojo app.aa@chromium.org2014-01-082-0/+2
| | | | | | | | R=abarth@chromium.org Review URL: https://codereview.chromium.org/126743002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243637 0039d316-1c4b-4281-b951-d872f2087c98
* Added a test for destroying an isolate while a timer is outstanding.aa@chromium.org2014-01-062-47/+86
| | | | | | | | | | | Cleaned up a few of the existing tests. BUG= R=abarth@chromium.org Review URL: https://codereview.chromium.org/100143006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243185 0039d316-1c4b-4281-b951-d872f2087c98
* Gin: Fix console module to be varargs again.aa@chromium.org2014-01-064-3/+18
| | | | | | | | R=abarth@chromium.org Review URL: https://codereview.chromium.org/108723006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243183 0039d316-1c4b-4281-b951-d872f2087c98
* Remove usage of deprecate v8::Number constructors from ginjochen@chromium.org2014-01-032-3/+4
| | | | | | | | | TBR=dcarney@chromium.org BUG=none Review URL: https://codereview.chromium.org/109563003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242884 0039d316-1c4b-4281-b951-d872f2087c98
* Gin: Spruce the README a bit.aa@chromium.org2013-12-231-5/+21
| | | | | | Review URL: https://codereview.chromium.org/116953003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242342 0039d316-1c4b-4281-b951-d872f2087c98
* Add a simple one shot and repeating timer API for Mojo.js.aa@chromium.org2013-12-2117-28/+321
| | | | | | | | Various further rework of bindings stuff to facilitate. Review URL: https://codereview.chromium.org/120043008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242284 0039d316-1c4b-4281-b951-d872f2087c98
* Implement more of the JavaScript GL API.aa@chromium.org2013-12-216-18/+168
| | | | | | | | | | Right now I am just translating as directly as possible from the C spinning cube demo -- once it all works I will circle back through and refine the JavaScript. R=abarth@chromium.org Review URL: https://codereview.chromium.org/114883003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242230 0039d316-1c4b-4281-b951-d872f2087c98
* Do not use (mostly) deprecated FunctionTemplate::New and Object::New functions.svenpanne@chromium.org2013-12-192-1/+2
| | | | | | | | | R=jochen@chromium.org BUG=324225 Review URL: https://codereview.chromium.org/119093004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@241869 0039d316-1c4b-4281-b951-d872f2087c98
* [gin] fix casting WrappableBase to a derived classjochen@chromium.org2013-12-192-7/+20
| | | | | | | | | | | | | | | | | | We first need to cast the void pointer to WrappableBase before we can cast it to the derived class: initially a WrappableBase* is stored as holder, so we can't directly cast it to the derived class. To test this, I added a useless base class so the test object this pointers don't align with the WrappableBase this pointer. Also update the comments about how to use WrappableBase. BUG=none R=aa@chromium.org,dcarney@chromium.org Review URL: https://codereview.chromium.org/119173002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@241863 0039d316-1c4b-4281-b951-d872f2087c98
* Add support for wrapping classes indirectly inherited from gin::Wrappable<T>aa@chromium.org2013-12-193-39/+70
| | | | | | | | This is needed for: https://codereview.chromium.org/116163008/ Review URL: https://codereview.chromium.org/118423004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@241730 0039d316-1c4b-4281-b951-d872f2087c98
* [gin] Introduce Wrappable::GetObjectTemplatejochen@chromium.org2013-12-178-60/+62
| | | | | | | | | | | | | Instead of explicitly registering object templates for all wrapper infos, add a method on wrappable that returns the template when needed. BUG=none R=aa@chromium.org,abarth@chromium.org Review URL: https://codereview.chromium.org/113893005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@241370 0039d316-1c4b-4281-b951-d872f2087c98
* [gin] use a UniquePersistent to hold the context in context_holderjochen@chromium.org2013-12-172-4/+1
| | | | | | | | | BUG=none R=dcarney@chromium.org, abarth@chromium.org Review URL: https://codereview.chromium.org/99243005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@241200 0039d316-1c4b-4281-b951-d872f2087c98
* [gin] Use ObjectTemplateBuilder instead of ObjectTemplate::Newjochen@chromium.org2013-12-172-11/+8
| | | | | | | | | | | | With https://codereview.chromium.org/113893005/ this will make sure that all ObjectTemplates have the correct number of internal fields. BUG=none R=aa@chromium.org, abarth@chromium.org Review URL: https://codereview.chromium.org/116203004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@241197 0039d316-1c4b-4281-b951-d872f2087c98
* Beginning of JS Mojo API to GL.aa@chromium.org2013-12-133-9/+12
| | | | | | | | R=abarth@chromium.org Review URL: https://codereview.chromium.org/111083005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240807 0039d316-1c4b-4281-b951-d872f2087c98
* Reland 240298 "[gin] also install gin function templates on non-...""jochen@chromium.org2013-12-132-7/+11
| | | | | | | | | | | | | | | | | > [gin] also install gin function templates on non-gin managed > isolates > > BUG=321631 > R=dcarney@chromium.org > > Review URL: https://codereview.chromium.org/110443005 BUG=321631 R=aa@chromium.org Review URL: https://codereview.chromium.org/108173009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240651 0039d316-1c4b-4281-b951-d872f2087c98
* [gin] Turn gin into a componentjochen@chromium.org2013-12-1222-50/+115
| | | | | | | | | | | | This will allow for using gin from content and blink at the same time in a component build BUG=321631 R=abarth@chromium.org,aa@chromium.org Review URL: https://codereview.chromium.org/101583004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240425 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 240298 "[gin] also install gin function templates on non-..."jam@chromium.org2013-12-121-1/+0
| | | | | | | | | | | | | | | | | | | | | | Causing failures on debug win and mac. like: # # Fatal error in ..\..\src\api.cc, line 621 # CHECK(!isolate->IsInitialized()) failed # > [gin] also install gin function templates on non-gin managed isolates > > BUG=321631 > R=dcarney@chromium.org > > Review URL: https://codereview.chromium.org/110443005 TBR=jochen@chromium.org Review URL: https://codereview.chromium.org/98863004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240331 0039d316-1c4b-4281-b951-d872f2087c98
* [gin] also install gin function templates on non-gin managed isolatesjochen@chromium.org2013-12-121-0/+1
| | | | | | | | | BUG=321631 R=dcarney@chromium.org Review URL: https://codereview.chromium.org/110443005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240298 0039d316-1c4b-4281-b951-d872f2087c98
* Update function_template.h.pump file after changes in r240271jochen@chromium.org2013-12-121-2/+5
| | | | | | | | | TBR=dcarney@chromium.org BUG=none Review URL: https://codereview.chromium.org/106433005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240293 0039d316-1c4b-4281-b951-d872f2087c98
* [gin] Declare a wrappable's kWrapperInfo on the class deriving from Wrappablejochen@chromium.org2013-12-124-15/+14
| | | | | | | | | | | | | | | Otherwise, we need to put INIT_WRAPPABLE() in namespace gin no matter where the derived class is declared. I pulled this out from https://codereview.chromium.org/111083005/ BUG=none R=dcarney@chromium.org TBR=aa@chromium.org Review URL: https://codereview.chromium.org/113163007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240271 0039d316-1c4b-4281-b951-d872f2087c98
* [gin] WrappableBase's dtor needs to be virtualjochen@chromium.org2013-12-113-10/+13
| | | | | | | | | | | | | | Otherwise, the weak callback won't run the dtor of derived classes. Also clarify that the INIT_WRAPPABLE() macro needs to be called in namespace gin. BUG=none R=aa@chromium.org Review URL: https://codereview.chromium.org/93903003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240154 0039d316-1c4b-4281-b951-d872f2087c98