summaryrefslogtreecommitdiffstats
path: root/gin
Commit message (Collapse)AuthorAgeFilesLines
* The mojo JS message header validation tests load text files that encode ↵hansmuller@chromium.org2014-07-307-0/+155
| | | | | | | | | | | | | | | | binary messages. A simple gin file access module would simplify writing the tests: file.getSourceRootDirectory() - return the path to the root src directory file.getFilesInDirectory(path) - return an array of the filenames found in path. Do not return subdirectory names or links. file.readFileToString(path) - return the contents of the file as a string. BUG=397554 Review URL: https://codereview.chromium.org/419673004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@286484 0039d316-1c4b-4281-b951-d872f2087c98
* Update memory related v8 notifications API callsjochen@chromium.org2014-07-291-1/+3
| | | | | | | | | | | | The API calls are per Isolate, and therefore should be on the isolate. Make it so. BUG=397026 R=haraken@chromium.org Review URL: https://codereview.chromium.org/425043002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@286325 0039d316-1c4b-4281-b951-d872f2087c98
* Fixed gin_shell and added a smoke test.hansmuller@chromium.org2014-07-285-4/+47
| | | | | | | | | | Renamed gin_shell's local gin::ModuleRunnerDelegate subclass to since it was being overridden by the gin::ShellRunner base class. BUG=397263 Review URL: https://codereview.chromium.org/413333002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285943 0039d316-1c4b-4281-b951-d872f2087c98
* Mojo: Log an error when we fail to find a JS module.mpcomplete@chromium.org2014-07-231-0/+1
| | | | | | | | BUG=328119 Review URL: https://codereview.chromium.org/401723002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285023 0039d316-1c4b-4281-b951-d872f2087c98
* Added IsConstructorCall to gin::Arguments.kolczyk@opera.com2014-07-183-2/+35
| | | | | | | | | | | | It simply forwards the flag from v8::FunctionCallbackInfo and allows the function handler that accept gin::Arguments argument to distinguish between normal function invocation and call as an object construction. BUG= Review URL: https://codereview.chromium.org/401823002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284123 0039d316-1c4b-4281-b951-d872f2087c98
* Gin: Allow multiple callers to wait for the same module in ModuleRegistry.sammc@chromium.org2014-07-093-11/+54
| | | | | | | | BUG=391888 Review URL: https://codereview.chromium.org/373973003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@281966 0039d316-1c4b-4281-b951-d872f2087c98
* Add a function template cache to the interceptor unittestjochen@chromium.org2014-06-271-4/+20
| | | | | | | | | | | The unittest also serves as an example how to use the interceptor API. BUG=none R=abarth@chromium.org,raymes@chromium.org Review URL: https://codereview.chromium.org/352223008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@280350 0039d316-1c4b-4281-b951-d872f2087c98
* Remove WrappableTest.ErrorInObjectConstructorPropertyjochen@chromium.org2014-06-271-22/+0
| | | | | | | | | | | | | | | | This test was supposed to test that gin can cope with v8 throwing exceptions during object construction, e.g. when we run out of stack space. There is, however, no reliable way to emulate "running out of stack" in a unit test without risking to also crash because of OOM. BUG=none R=dcarney@chromium.org Review URL: https://codereview.chromium.org/337883005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@280336 0039d316-1c4b-4281-b951-d872f2087c98
* Hook up V8 to more of the GN build.brettw@chromium.org2014-06-052-57/+52
| | | | | | | | | | | | Implement webkit/common/gpu. Minor fixes to the gin unit tests (it defines its own test runner so shouldn't depend on run_all_unittests -- GN found this because run_all_unittests in the GN build is a source_set instead of a static library and results in a duplicate definition). R=jochen@chromium.org Review URL: https://codereview.chromium.org/319583004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@275233 0039d316-1c4b-4281-b951-d872f2087c98
* Make GN unit tests single process.brettw@chromium.org2014-06-041-3/+0
| | | | | | | | | | | Clean up gin run all unittests file. I noticed some extra includes while searching for some code to copy. BUG= R=jochen@chromium.org Review URL: https://codereview.chromium.org/318543002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274850 0039d316-1c4b-4281-b951-d872f2087c98
* 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