67 Commits

Author SHA1 Message Date
Elliott Sprehn
f607133c18 Turn on harmony arrays and regexp.
adamk@ says these are pretty stable.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/845403009
2015-01-15 17:12:17 -08:00
Elliott Sprehn
f90f735f9b Remove extension check from CustomElementRegistry.
We only have the main world, we don't need this check.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/788773006
2015-01-13 16:01:49 -08:00
Elliott Sprehn
1da814b4c2 Remove custom element type extensions.
Sky doesn't really have many built in elements, we no longer support
<foo is="my-element">. This does mean you can't extend <import>,
<script> or <style>, but we'll figure that out later.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/831993005
2015-01-06 16:07:15 -08:00
Etienne Membrives
a4ea8c30fe Update from https://crrev.com/308996
Add patch for V8 build rules

R=qsr@chromium.org

Review URL: https://codereview.chromium.org/816543004
2014-12-19 15:45:38 +01:00
Elliott Sprehn
4a9e21a78c Custom elements should have class side inheritance.
We were not setting the __proto__ property of the generated constructor
so the generated class didn't inherit from the passed class which meant
that statics were not available.

This patch adds the missing call to setPrototype (which sets __proto__).

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/814683002
2014-12-17 14:24:34 -08:00
Colin Blundell
e55c96e96a Run gn format on all gni files (gn version 307087)
Change generated by running the following command:

for x in `git ls-files *.gni`; do gn format --in-place $x; done

This came up as an issue in https://codereview.chromium.org/801523002/, but I
didn't want to add noise to that CL.

R=qsr@chromium.org, qsr

Review URL: https://codereview.chromium.org/794413003
2014-12-12 09:51:24 +01:00
Eric Seidel
0884bfc42f Remove unused isolatedWorldCount
TBR=abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/781913003
2014-12-05 08:50:27 -08:00
James Robinson
09de28ef8c Run gn format on all BUILD.gn files (gn version 306668)
Generated by running the following:
for x in `git ls-files | grep BUILD.gn`; do gn format --in-place $x; done

BUG=348474
R=viettrungluu@chromium.org

Review URL: https://codereview.chromium.org/773283006
2014-12-03 17:39:48 -08:00
Eric Seidel
c14361a751 Remove Isolated Worlds from Sky
These were a feature for allowing multiple
scripting contexts to access the same global
state without leaking wrappers between them.
For example, if the inspector wanted to
modify window.Array.dangerousFunction = ...
it wouldn't want the author's content to have
access to that.

This feature is not part of Sky's security model
and thus this is just dead code.

I tried to remove worlds all together, but there
is something special about how we use a
"fake" world (which is neither main nor isolated)
for GC, regexp and testing.

R=rafaelw@chromium.org, abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/776143003
2014-12-03 15:51:09 -08:00
Elliott Sprehn
6c94c18612 Remove the CSSOM.
This leaves CSSValue, but removes everything else.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/780483002
2014-12-03 10:50:02 -08:00
Yury Semikhatsky
094b491c58 Remove ScriptPreprocessor
It is unused in Sky. I'm going to remove it in Blink too.

BUG=None
TBR=eseidel

Review URL: https://codereview.chromium.org/754463004
2014-12-03 18:45:33 +03:00
Eric Seidel
682cccdd91 Make v8 inspector not crash
It was attempting to load InjectedScript, etc.
with the wrong path and hitting a CHECK().
I moved InjectedScript and DebugScript into
the v8_inspector directory and fixed their loading.

I also broke the dependency from v8_inspector
onto engine/platform by moving the horrible
Platform::loadResource hack out of PlatformImpl
into a new file just for v8_inspector.

In this process I also found some (broken!)
code for showing the broken image icon which
if we ever hit would just have crashed, so
I removed that code as well.

BUG=435243
R=ojan@chromium.org

Review URL: https://codereview.chromium.org/776743002
2014-12-02 16:47:17 -08:00
Eric Seidel
8711bf43a8 Remove heap/Handle usage from v8_inspector
I also removed it from a bunch of core/
as almost all the places its included
it is not actually needed.

BUG=435243
TBR=yurys@chromium.org

Review URL: https://codereview.chromium.org/775803002
2014-12-02 14:29:16 -08:00
Eric Seidel
c2f8ed76bd Remove a couple more core/ header includes from v8_inspector
Removed all uses of Frame in InspectorTraceEvents
in the process, since none of them actually
needed a Frame (since each sky instance only
has one frame).

I've just been burning down the list of core
includes using:
grep "#include" sky/engine/v8_inspector/* -h | sort | uniq | sort | grep core

TBR=yurys@chromium.org
BUG=435243

Review URL: https://codereview.chromium.org/771323002
2014-12-02 13:38:02 -08:00
Eric Seidel
41796985bc Move many of v8_inspector dependencies out of core/
This doesn't fully separate v8_inspector from
core, but it does lay the path.

The next steps to removing v8_inspector is to
remove all the # FIXME: Remove lines in the
deps section of v8_inspector/BUILD.gn.

gn check out/Debug v8_inspector
will tell us if we've successfully removed
all the dependencies.

It's unclear if we want to remove the wtf
dependency, but definitely all of the engine/core
dependencies should be removed and presumably
replaced with abstract interfaces which can be provided
to v8_inspector by its host.

Given the size of this patch (and that it's largely
mechanical) I plan to TBR it.

Most of this was done with tools/git/move_source_file.py

TBR=yurys@chromium.org

Review URL: https://codereview.chromium.org/772563003
2014-12-02 13:00:40 -08:00
Elliott Sprehn
253b5bed74 Only allow one shadowRoot.
R=ojan@chromium.org

Review URL: https://codereview.chromium.org/759663003
2014-11-26 13:54:14 -05:00
Eric Seidel
295f920116 Fix sky include guards to match Chromium style
I wrote a script to do this which is attached
to the bug.

TBR=abarth@chromium.org
BUG=435361

Review URL: https://codereview.chromium.org/736373003
2014-11-21 02:48:38 -08:00
Eric Seidel
e0fd75b5ab Make absolute and sort all Sky headers
This caused us to lose our gn check certification. :(

Turns out gn check was just ignoring all the header
paths it didn't understand and so gn check passing
for sky wasn't meaning much.  I tried to straighten
out some of the mess in this CL, but its going to take
several more rounds of massaging before gn check
passes again.  On the bright side (almost) all of
our headers are absolute now.  Turns out my script
(attached to the bug) didn't notice ../ includes
but I'll fix that in the next patch.

R=abarth@chromium.org
BUG=435361

Review URL: https://codereview.chromium.org/746023002
2014-11-20 17:42:05 -08:00
Eric Seidel
5ce2884e26 Audit all of sky's system <> style includes
I wrote a little script to do this.
I'll attach it to the bug in case Blink wants it.

R=abarth@chromium.org
BUG=435361

Review URL: https://codereview.chromium.org/747663002
2014-11-20 15:55:02 -08:00
Eric Seidel
39bf5a7f41 Start moving files from core/inspector into v8_inspector
This was just a test.  I'm about to write a script
to automate this process.  Mostly I just need to
fix tools/git/move_source_file.py to work for blink.

TBR=abarth@chromium.org
BUG=435243

Review URL: https://codereview.chromium.org/745913002
2014-11-20 15:07:19 -08:00
Eric Seidel
e4945302eb Move InspectorBackendMojo out of the blink namespace
This starts to break the dependency between blink and
the new v8_inspector.  At least now the front-end
object InspectorBackendMojo is treated as a peer to
WebView instead of WebView providing one.

Unfortunately I also had to teach Page about
InspectorHost in order to make it possible to
lookup the InspectorHost from the v8::Context.

I'm sure there is a nicer way to associate the
InspectorHost with the context but for now
I've chosen this path, we can untangle the
connection in a later patch.

I also ended up removing Page::allPages
and all callers, since they ended up as dead code.

R=abarth@chromium.org, yurys@chromium.org
BUG=435243

Review URL: https://codereview.chromium.org/746713002
2014-11-20 14:21:36 -08:00
Elliott Sprehn
4e68e8f732 Enable ES6 classes.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/742183002
2014-11-20 10:55:28 -08:00
Eric Seidel
55b5bc485d Sort headers
Fix (most) generated includes to have gen/ in their path.

This makes it easier to tell where files exist on disk.

Unfortunately I had to leave the old include path
in engine/BUILD.gn to support all the v8 includes
which were too many to deal with in this patch.

It's a little nasty to have the raw build directory
in our include path, but it produces nicer paths.

R=abarth@chromium.org
2014-11-19 12:33:42 -08:00
Yury Semikhatsky
fb1fed5d29 Fix debugger crash in Sky
This is actually a backport of the following Blink change https://src.chromium.org/viewvc/blink?view=rev&revision=185426. New scope types introduced by ES6 features are not yes supported by DevTools and should just be ignored by the debugger. ScriptScope that caused troubles in this particular case was supported in V8 debugger quite recently (https://codereview.chromium.org/726643002).

This fixes following crash on pause in Sky:
#0  0x00007f8a39cffe1b in blink::TypeBuilder::Debugger::Scope::Type::assertCorrectValue (value=0xd98ce760450) at gen/sky/core/InspectorTypeBuilder.cpp:596
#1  0x00007f8a39d00072 in blink::TypeBuilder::Debugger::Scope::assertCorrectValue (value=0xd98ce658898) at gen/sky/core/InspectorTypeBuilder.cpp:610
#2  0x00007f8a39d033c5 in blink::TypeBuilder::StructItemTraits::assertCorrectValue<blink::TypeBuilder::Debugger::Scope> (value=0xd98ce658898) at gen/sky/core/InspectorTypeBuilder.h:160
#3  0x00007f8a39d02f71 in blink::TypeBuilder::Array<blink::TypeBuilder::Debugger::Scope>::assertCorrectValue (value=0xd98ce60af00) at gen/sky/core/InspectorTypeBuilder.h:139
#4  0x00007f8a39cffaaf in blink::TypeBuilder::Debugger::CallFrame::assertCorrectValue (value=0xd98ce658420) at gen/sky/core/InspectorTypeBuilder.cpp:569
#5  0x00007f8a3a753435 in blink::TypeBuilder::StructItemTraits::assertCorrectValue<blink::TypeBuilder::Debugger::CallFrame> (value=0xd98ce658420) at gen/sky/core/InspectorTypeBuilder.h:160
#6  0x00007f8a3a753371 in blink::TypeBuilder::Array<blink::TypeBuilder::Debugger::CallFrame>::assertCorrectValue (value=0xd98ce60af50) at gen/sky/core/InspectorTypeBuilder.h:139
#7  0x00007f8a3a752fa6 in blink::TypeBuilder::Array<blink::TypeBuilder::Debugger::CallFrame>::runtimeCast (value=...) at gen/sky/core/InspectorTypeBuilder.h:121
#8  0x00007f8a3a751e8c in blink::InjectedScript::wrapCallFrames (this=0x7f8a5560d988, callFrames=..., asyncOrdinal=0) at ../../sky/engine/core/inspector/InjectedScript.cpp:261
#9  0x00007f8a3a765350 in blink::InspectorDebuggerAgent::currentCallFrames (this=0xd98ce689410) at ../../sky/engine/core/inspector/InspectorDebuggerAgent.cpp:1149
#10 0x00007f8a3a76ae84 in blink::InspectorDebuggerAgent::didPause (this=0xd98ce689410, scriptState=0xd98ce670170, callFrames=..., exception=..., hitBreakpoints=...) at ../../sky/engine/core/inspector/InspectorDebuggerAgent.cpp:1354
#11 0x00007f8a3a76b0b7 in non-virtual thunk to blink::InspectorDebuggerAgent::didPause(blink::ScriptState*, blink::ScriptValue const&, blink::ScriptValue const&, WTF::Vector<WTF::String, 0ul, WTF::DefaultAllocator> const&) ()
    at ../../sky/engine/core/inspector/InspectorDebuggerAgent.cpp:1368
#12 0x00007f8a399dae78 in blink::ScriptDebugServer::handleProgramBreak (this=0x7f8a441c5070, pausedScriptState=0xd98ce670170, executionState=..., exception=..., hitBreakpointNumbers=...) at ../../sky/engine/bindings/core/v8/ScriptDebugServer.cpp:449
#13 0x00007f8a399dbaa8 in blink::ScriptDebugServer::handleV8DebugEvent (this=0x7f8a441c5070, eventDetails=...) at ../../sky/engine/bindings/core/v8/ScriptDebugServer.cpp:519
#14 0x00007f8a399db064 in blink::ScriptDebugServer::v8DebugEventCallback (eventDetails=...) at ../../sky/engine/bindings/core/v8/ScriptDebugServer.cpp:470
#15 0x00007f8a3937bc93 in v8::internal::Debug::CallEventCallback (this=0x7f8a44015510, event=v8::Break, exec_state=..., event_data=..., client_data=0x0) at ../../v8/src/debug.cc:2826
#16 0x00007f8a3937a5af in v8::internal::Debug::ProcessDebugEvent (this=0x7f8a44015510, event=v8::Break, event_data=..., auto_continue=false) at ../../v8/src/debug.cc:2793
#17 0x00007f8a39375589 in v8::internal::Debug::OnDebugBreak (this=0x7f8a44015510, break_points_hit=..., auto_continue=false) at ../../v8/src/debug.cc:2657
#18 0x00007f8a39374132 in v8::internal::Debug::Break (this=0x7f8a44015510, args=..., frame=0x7f8a5560e958) at ../../v8/src/debug.cc:939
#19 0x00007f8a393756d0 in v8::internal::__RT_impl_Debug_Break (args=..., isolate=0x7f8a44007380) at ../../v8/src/debug.cc:982
#20 0x00007f8a3937562e in v8::internal::Debug_Break (args_length=0, args_object=0x7f8a5560eb80, isolate=0x7f8a44007380) at ../../v8/src/debug.cc:979

BUG=None
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/743673002
2014-11-19 19:53:20 +03:00
Eric Seidel
c04c091978 Make breakpoints not crash sky
They still don't work, but at least they don't crash.

TBR=abarth@chromium.org

Review URL: https://codereview.chromium.org/742583004
2014-11-18 17:39:21 -08:00
Eric Seidel
593c8f8de3 Wire up more of the DebuggerAgent
The debugger can now correctly break on exceptions
and show the corresponding line in the inspector.

It correctly understands which scripts are internal
to sky and does not pause during them.

There is still a ton to make work here
(including stacktraces which I have not tested),
but basic functionality seems to work.

The current implementation is not smart enough to
unpause the inspector when the frontend disconnects.

BUG=434510,434513
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/727593004
2014-11-18 15:05:05 -08:00
Rafael Weinstein
0b758e5227 Remove CSSCompositing
BUG=
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/731863003
2014-11-17 14:34:30 -08:00
Eric Seidel
38981ef393 Remove DEPS from sky
Also taught PRESUBMIT.py how to ignore DEPS for sky/
since gn check already covers everything we were using DEPS for.

R=abarth@chromium.org, jamesr@chromium.org

Review URL: https://codereview.chromium.org/737493002
2014-11-17 11:16:44 -08:00
Eric Seidel
9ec75d67ce Use root-relative V8 includes
TBR=abarth@chromium.org

Review URL: https://codereview.chromium.org/726133002
2014-11-14 16:02:21 -08:00
Eric Seidel
97f80336f9 Bring back ScriptDebugServer and associated machinery
Eventually all of this should be moved out of Sky
and instead sit on top of Sky as just a mojo v8 debug service
but for now I'm just bringing back what we had in Blink
so I can make it work with our new inspector backend
and then we can move it out.

I also sorted gn lists and fixed two .idl files
which were in the wrong sources list in core.gni.

R=abarth@chromium.org, yurys@chromium.org

Review URL: https://codereview.chromium.org/723773002
2014-11-12 14:21:44 -08:00
Adam Barth
79ae83b21f Make the parser an implementation detail of the Document
This CL removes the parser accessors from the document to prevent folks from
grabbing at it.

R=ojan@chromium.org, eseidel@chromium.org

Review URL: https://codereview.chromium.org/723583002
2014-11-12 13:22:45 -08:00
Eric Seidel
5bdc6515b9 Re-land 714393002 after fixing android build.
Original CL:
https://codereview.chromium.org/714393002

Reverted in:
https://codereview.chromium.org/719063002

One fix was to use static_assert instead
of _Static_assert in COMPILE_ASSERT.

_Static_assert is C11, static_assert is C++11
and Android's stdlib doesn't have C11 support,
but we don't care since we never use COMPILE_ASSERT
in plain C code.

The second fix was also for the android STL
and was adding back the nullptr_t type
definition in NullPtr.h for old versions of STL.

I compile this locally for android to verify
that it works
mojo/tools/mojob.py build --android

TBR=jamesr@chromium.org,qsr@chromium.org

Review URL: https://codereview.chromium.org/722723003
2014-11-12 12:16:05 -08:00
Benjamin Lerman
59f42240ba Revert "Remove support for MSVC"
This reverts commit d9cfbefcfe8710f1cb190ae817757853c8058797.

This CL broke android build:
http://build.chromium.org/p/client.mojo/builders/Mojo%20Android%20Builder%20%28dbg%29/builds/248

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/719063002
2014-11-12 13:31:10 +01:00
Eric Seidel
4ab80f640b Remove support for MSVC
I also removed COMPILER_SUPPORTS since
all of the checks were for old versions of
GCC which we no longer support.

Mojo requires GCC 4.8 or later.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/714393002
2014-11-11 16:59:04 -08:00
Adam Barth
84faf899bc Remove nop ScriptWrappable::init calls
These calls don't do anything.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/706123005
2014-11-10 16:41:18 -08:00
Adam Barth
b71fee9e48 Move exports from Document to Module
This CL moves the |exports| from Document to the new |Module| interface,
matching the spec. Also, the |module| object available to scripts is now really
an instance of |Module|.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/703593003
2014-11-10 15:34:25 -08:00
Adam Barth
ed80ee081b tests
Address comments

Add a basic parser benchmark

This CL adds a basic benchmark for the parser. There isn't a direct way to
exercise the parser in Sky, so we use imports.

This CL also adds a load event to <import> to determine when the import is done
loading.

R=eseidel@chromium.org

parser benchmark wip
2014-11-04 11:00:32 -08:00
Elliott Sprehn
8c0a714beb Remove most of the media stack.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/689373003
2014-11-03 20:21:19 -08:00
Elliott Sprehn
93af62d3e7 Remove HTMLVideoElement.
This also removes some compositor related code, but there's not much of
it anyway so we can just add it back later when we do <iframe>.

R=ojan@chromium.org, abarth@chromium.org

Review URL: https://codereview.chromium.org/701663002
2014-11-03 18:02:22 -08:00
Adam Barth
512c4591a6 Remove HTMLLinkElement
Please use <import> instead.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/696413002
2014-11-03 12:51:24 -08:00
Adam Barth
8323fb1e88 Basic implementation of <import>
This CL adds basic support for the <import> elements. We're using the same imports
machinery as <link rel="import">, which simplifies this patch substantially.

Currently we support both <link rel="import"> and <import>. Once this CL lands, I'll
update all the existing modules and then we can drop support for
<link rel="import">.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/681983005
2014-11-03 10:14:09 -08:00
Elliott Sprehn
5330701999 Remove Element#attributes.
We now implement getAttributes() such that it returns
a new set of Attr isntances on every call as well.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/697773002
2014-10-31 15:10:53 -07:00
Adam Barth
e1c150ffca Drop support for this.exports
Please use module.exports instead. As far as I know, all code in the repo has
been converted over to the new style.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/698543006
2014-10-31 15:02:45 -07:00
Adam Barth
fc451b47eb Unfork Sky's trace events
This CL remove the body of Sky's TraceEvent.h in favor of the version in base.
There's still some more of the system to unwind before we can remove all the
other boilerplate.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/691663002
2014-10-30 09:39:46 -07:00
Adam Barth
8385799d73 Fix line numbers in JavaScript stack traces
Instead of calling the function constructor to compile script in Sky, we now
concatenate strings. This has the advantage of making the line numbers
generated in error messages correct but the disadvantage of being a hack. I've
filed https://code.google.com/p/v8/issues/detail?id=3624 to request a proper
API for this purpose.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/688033003
2014-10-29 14:00:57 -07:00
Adam Barth
f3e367c383 Don't crash when importing a module that doesn't export
Instead of crashing, we should use the value "undefined". There's some question
as to whether we should default to the document, but we can resolve that later.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/690483002
2014-10-28 14:13:31 -07:00
Eric Seidel
c32433111b Remove almost all of Oilpan
The only things left are all the baseclasses
and macros in heap/Handle.h which are referenced
throughout all of core.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/686783002
2014-10-28 09:36:50 -07:00
Eric Seidel
e9e27699ad Remove GarbageCollectedFinalized
This class didn't actually do anything anymore.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/655083003
2014-10-27 17:41:38 -07:00
Adam Barth
c198c32164 Don't crash when importing a 404
Now we have a test for this case.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/682913002
2014-10-27 17:22:55 -07:00
Eric Seidel
de93d90cda Remove heap/*.cpp files
Nothing in heap/ is called anymore, but it
still has its claws deep into many of the
base classes for the rest of Sky, so I've left
the (largely unmodified) headers for now.

We'll trim the headers further in later patches.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/681963002
2014-10-27 17:13:36 -07:00