| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the snapshot.
Adds code which generates a SHA256 fingerprint of the external V8 snapshot
blob files during the build process, and embeds these values into the
binary. During startup the SHA256 hash of the snapshot blobs are compared
against these fingerprints and Chrome will fail to load if they differ.
BUG=421063,439661
Review URL: https://codereview.chromium.org/832393003
Cr-Commit-Position: refs/heads/master@{#310755}
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a drainData(dataPipeHandle) utility function to the Mojo JS core module.
The drainData() function asynchronously reads from the data pipe until the remote handle is closed or an error occurs. A Promise is returned whose settled value is an object like this: {result: core.RESULT_OK, buffer: dataArrayBuffer}. If the read failed, then the result will be the actual error code and the buffer will contain whatever was read before the error occurred. The drainData dataPipeHandle argument is closed automatically.
BUG=414338
Review URL: https://codereview.chromium.org/577733002
Cr-Commit-Position: refs/heads/master@{#296750}
|
|
|
|
|
|
|
|
|
|
|
|
| |
This will make sure that the handlers are set at the correct point
during v8::Isolate construction
BUG=none
R=svenpanne@chromium.org
Review URL: https://codereview.chromium.org/567343002
Cr-Commit-Position: refs/heads/master@{#295066}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
. 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
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
Also, define names for the embedder data slots on v8::Context that
gin embedders should use.
BUG=321631
R=abarth@chromium.org
Review URL: https://codereview.chromium.org/104593007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239099 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rather than using reference counting to keep gin::Wrappable objects alive, we
use the V8 garbage collector. To retain a reference to a wrappable object on
the stack, use a gin::Handle. Currently there is no mechanism for retaining a
gin::Wrappable object in the heap, but we'll likely add one in the future.
R=aa@chromium.org
BUG=none
Review URL: https://codereview.chromium.org/105423003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238902 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
| |
BUG=
Review URL: https://codereview.chromium.org/93813002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237867 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
| |
BUG=
Review URL: https://codereview.chromium.org/76923003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236958 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
| |
BUG=317398
R=abarth@chromium.org,aa@chromium.org
Review URL: https://codereview.chromium.org/82963002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236766 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This CL adds a mechanism for wrapping C++ objects to Gin. The approach in this
CL is similar to Blink's ScriptWrappable class, with a couple of differences:
1) gin::Wrappable has a vtable whereas Blink's ScriptWrappable class does not.
Having a vtable in this base class lets us simplify a large number of
concerns. We've talked about adding a vtable to ScriptWrappable but have
avoided it because Blink creates many thousands of wrapped objects. When we
refactor Blink to use Gin, we can still support the non-vtable approach, but
most clients of Gin will want the simpler approach.
2) In Gin, we've bound together the notion of being reference counted with the
notion of being wrappable from JavaScript. In Blink, those concepts are
separate because we don't want to introduce a virtual destructor for
ScriptWrappable. However, because gin::Wrappable already has a vtable,
adding a virtual destructor is relatively cheap.
Actually wrapping a C++ object still takes too much typing, but we can improve
that in future CLs.
R=jochen@chromium.org
BUG=317398
Review URL: https://codereview.chromium.org/79203004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236555 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
| |
BUG=317398
R=dcarney@chromium.org,abarth@chromium.org
Review URL: https://codereview.chromium.org/77913004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236314 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When we start using gin from other projects but mojo, we want to be
extra careful what we include. Therefore, we introduce a public/
directories with headers that are ok to be included from gin-embedders.
As a start, we move wrapper_info.h into public/.
BUG=317398
R=abarth@chromium.org
Review URL: https://codereview.chromium.org/69293015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236114 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Gin class holds and controls a v8::Isolate. The isolate is not
entered by default, i.e. before you can use gin for a given Gin
instance, you need to enter the isolate first, e.g. by using a
v8::Isolate::Scope.
This has the advantage that we don't rely on the deprecate default
isolate, and also support having multiple isolates in one process.
BUG=317398
R=abarth@chromium.org
TEST=gin_unittests and mojo_js_bindings_unittests pass
Review URL: https://codereview.chromium.org/76353002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236029 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This CL adds a basic console module to gin_shell so that we can print to stdout
with a JavaScript program like the following:
define(["console"], function(console) {
console.log("Hello,", "world");
});
BUG=317398
Review URL: https://codereview.chromium.org/75273007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235940 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This CL adds a simple shell program for Gin to make edit/test/debug cycle
faster. The shell excutes a list of scripts from the command line and loads any
requested AMD modules relative to the current working directory.
This CL will also let us remove the ugly code in
https://codereview.chromium.org/69843003/diff/240001/mojo/public/bindings/js/test/run_js_tests.cc
because we now know how to file modules via the file system. Eventually for
Mojo, we'll want to use a net_module_provider (instead of the
file_module_provider included in this CL) to load additional AMD modules off
the network.
BUG=317398
R=jochen@chromium.org
Review URL: https://codereview.chromium.org/74753002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235750 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
API, which we plan to use for JavaScript in Mojo. We don't
yet implement every feature in the AMD spec
<https://github.com/amdjs/amdjs-api/wiki/AMD>, but we
implement the basic framework, which will let us get started
writing and testing JavaScript modules in Mojo.
The two other leading choices for a modules system are
CommonJS and ES6 modules. We decided not to use CommonJS,
despite its popularity, because it implies the ability to
load modules synchronously. That works well in server
environments like node.js, but it won't work well for Mojo
where modules might be loaded across a network.
I would really like to have used ES6 modules, but the spec
isn't finalized yet and V8 doesn't yet implement them. It's
likely that we'll replace this AMD module system with ES6
modules once ES6 modules are ready.
Structurally, I've implemented AMD in the ModuleRegistry
class in a new "modules" directory in Gin. Nothing else in
Gin (except the tests) depends on ModuleRegistry, which
means folks are free to use Gin without AMD. At the Mojo
layer, I've added a dependency on AMD.
BUG=317398
Review URL: https://codereview.chromium.org/62333018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235543 0039d316-1c4b-4281-b951-d872f2087c98
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This CL contains the beginnings of JavaScript bindings for the core Mojo
system. The approach in this CL is to bind as close to the "metal" as possible
so as to self-host as much as possiblem in the VM. I've tried to avoid
retaining any state on the C++ side of the bindings, but I didn't quite succeed
because V8 requires embedders to retain state in order to access the memory
that backs ArrayBuffers.
In this CL, I've added some basic bindings for the symbols exported by core.h.
Specifically, I've created bindings for CreateMessagePipe, Close, Wait,
WaitMany, WriteMessage, and ReadMessage.
R=aa@chromium.org, darin@chromium.org
BUG=317398
Review URL: https://codereview.chromium.org/59153005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@234347 0039d316-1c4b-4281-b951-d872f2087c98
|
|
Unlike the extensions V8 bindings, gin is based on ObjectTemplates rather than
on evaluating script. Unlike the Blink V8 bindings, gin isn't tightly coupled to
Blink. In fact, gin's only link-time dependency is V8. We plan to use gin to build
the V8 bindings for Mojo (see https://codereview.chromium.org/59153005/ for
an example of how they will be used).
In the long term, gin could serve as a basis for both the Blink and the extension
system bindings, but we don't have any immediate plans to pursue that use of
this code.
This code is largely inspired by a lightweight bindings system designed by
Aaron Boodman.
Review URL: https://codereview.chromium.org/67763002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@234160 0039d316-1c4b-4281-b951-d872f2087c98
|