Commit Graph

305 Commits

Author SHA1 Message Date
Aaron Klotz
5fe5ffb4ee Bug 1357967: Include mozilla-config.h in HandlerData.idl so that we have access to configured preprocessor defines; r=jimm
MozReview-Commit-ID: LWaxhDzq2ge
2017-04-19 19:06:53 -06:00
Aaron Klotz
fb07769842 Bug 1357194: Use MOZ_UPDATE_CHANNEL to distinguish between local/nightly and beta/release builds for AccessibleHandler CLSIDs; r=mhowell,mshal
MozReview-Commit-ID: Kp8x5o66nrY

I want AccessibleHandler.dll to use different UUIDs based on release channel.
The way I was doing it before wasn't working correctly because I also wanted
local builds to have their own set of UUIDs vs our regular Nightly/Beta/Release
builds.

I also want the beta channel to have its own set of UUIDs that are distinct
from release.

I'm using MOZ_UPDATE_CHANNEL to distinguish between the channels when
NIGHTLY_BUILD and BETA_OR_RELEASE are insufficient.
2017-04-17 14:47:41 -06:00
David Parks
cb4447fb76 Bug 1326084 - Unbind accessible child doc before replacing with new one. r=trevor
We need to update mChildDocs on child document removal.  This also cleans up some code related to setting a new child doc when one is already set -- we now assert that this cannot happen.
2017-04-07 13:26:45 -07:00
Aaron Klotz
a0a37a918c Bug 1322532: Platform a11y changes to enable handler-based live regions; r=tbsaunde
MozReview-Commit-ID: nNPvBy3ZGO
2017-04-13 20:35:32 -06:00
Aaron Klotz
cc5e382ae9 Bug 1322532: Add sync text event to PDocAccessible; r=tbsaunde, r=billm
MozReview-Commit-ID: AFZMYghoOHe
2017-04-13 17:08:42 -06:00
Aaron Klotz
40a54b8336 Bug 1322532: Move a11y retrieval of native window handle to DocAccessibleChild; r=yzen
MozReview-Commit-ID: DwLBfAQJkRJ
2017-02-21 11:27:33 -07:00
Aaron Klotz
44083350b7 Bug 1322532: Add support for live regions to the com handler dll; r=tbsaunde
MozReview-Commit-ID: 1JPaUw5PrxU
2017-04-13 16:57:33 -06:00
Wes Kocher
ac93ad29fd Backed out 4 changesets (bug 1322532) for windows static build failures a=backout
Backed out changeset df4e3ee037d6 (bug 1322532)
Backed out changeset 0acfde7a7a45 (bug 1322532)
Backed out changeset 34bf061d8e29 (bug 1322532)
Backed out changeset 954ea82470ed (bug 1322532)
2017-04-14 00:02:40 -07:00
Aaron Klotz
d5d0889167 Bug 1322532: Platform a11y changes to enable handler-based live regions; r=tbsaunde
MozReview-Commit-ID: nNPvBy3ZGO
2017-04-13 20:35:32 -06:00
Aaron Klotz
1cb6acd56c Bug 1322532: Add sync text event to PDocAccessible; r=tbsaunde, r=billm
MozReview-Commit-ID: AFZMYghoOHe
2017-04-13 17:08:42 -06:00
Aaron Klotz
f31fc251ad Bug 1322532: Move a11y retrieval of native window handle to DocAccessibleChild; r=yzen
MozReview-Commit-ID: DwLBfAQJkRJ
2017-02-21 11:27:33 -07:00
Aaron Klotz
f0c2f02862 Bug 1322532: Add support for live regions to the com handler dll; r=tbsaunde
MozReview-Commit-ID: 1JPaUw5PrxU
2017-04-13 16:57:33 -06:00
Ryan VanderMeulen
5742d9463b Bug 1354293 - Don't try to build a11y IPC code that depends on accessibility being enabled. r=aklotz 2017-04-06 18:51:02 -04:00
Aaron Klotz
0ea5fc170b Bug 1303060: Build system changes for implementation of the caching COM handler for a11y; r=mshal
MozReview-Commit-ID: KBe1bw6xnhD
2017-03-27 19:13:40 -06:00
Aaron Klotz
1fddd00c16 Bug 1303060: Implementation of the caching COM handler for a11y; r=tbsaunde
MozReview-Commit-ID: HkiIgDQURtK

The a11y COM handler consists of two classes. AccessibleHandler is the one that
is actually interposed by COM between the client and the proxy. It implements
IAccessible2_3, IServiceProvider, and IProvideClassInfo. It is derived from
mscom::Handler which takes care of most of the COM boilerplate for handler
instantiation. AccessibleHandler must override a few virtual functions from
mscom::Handler:

* QueryHandlerInterface - mscom::Handler must implement the "real" QI. This is
  the method that mscom::Handler uses to delegate to the implementer.
* ReadHandlerPayload - deserializing the payload. This uses
  mscom::StructFromStream and the IA2Data_Decode function that was generated by
  midl. It should essentially be the inverse of the serialization code in the
  IHandlerProvider implementation inside Gecko.
* MarshalAs - identical to IHandlerProvider::MarshalAs
* GetHandlerPayloadSize and WriteHandlerPayload - it sucks that we have to
  include these, but they are neccessary for the scenario when COM wants to
  make a proxy of a proxy. When that happens, we need to get COM to serialize
  the payload again; it isn't smart enough to recognize payloads in existing
  proxies and copy them itself.

In order to reduce round trips, AccessibleHandler implements the most
sophisticated IA2 interface. This way the client has access to any of those
interfaces from IDispatch all the way down to IAccessible2_3 without needing to
incur additional round-trips to obtain them.

We also implement IServiceProvider so that a client may QueryService for an IA2
interface without needing to incur more round trips. In addition, we maintain
a list of service IDs that we definitely do not support, and handle those
locally instead of incurring an IPC round-trip.

We also implement IProvideClassInfo because NVDA's python code (and presumably
other ATs that use interpreted languages) supports using that interface to
assist its FFI library with resolution of our COM objects.

COM wraps each instance of an IAccessible* proxy with an AccessibleHandler
object. Proxies whose interfaces are not part of the IDispatch ... IAccessible2_3
hierarchy are not wrapped with handlers (though this might change in the future
if we need to expand coverage). AccessibleHandler implements IAccessible2_3 such
that, if we have cached data available for a particular IA2 method, we provide
that cached data to the client. Otherwise we pass on the request to the COM
proxy for retrieval via IPC.

The other class in the handler dll is AccessibleHandlerControl. This class
implements the IHandlerControl interface that is provided to IGeckoBackChannel.
Gecko dispatches cache invalidation events using this interface. This class
is a singleton within the handler dll and manages shared, handler-wide resources.
2017-03-27 19:13:34 -06:00
Aaron Klotz
40ae87ec20 Bug 1303060: Build system changes for a11y to enable the serving of a COM handler; r=mshal
MozReview-Commit-ID: 51r9ezFwDGE
2017-03-27 19:13:07 -06:00
Aaron Klotz
f9d4c14477 Bug 1303060: Changes to a11y to enable the serving of a COM handler; r=tbsaunde
MozReview-Commit-ID: GTQF3x1pBtX

A general outline of the COM handler (a.k.a. the "smart proxy"):

COM handlers are pieces of code that are loaded by the COM runtime along with
a proxy and are layered above that proxy. This enables the COM handler to
interpose itself between the caller and the proxy, thus providing the
opportunity for the handler to manipulate an interface's method calls before
those calls reach the proxy.

Handlers are regular COM components that live in DLLs and are declared in the
Windows registry. In order to allow for the specifying of a handler (and an
optional payload to be sent with the proxy), the mscom library allows its
clients to specify an implementation of the IHandlerProvider interface.

IHandlerProvider consists of 5 functions:

* GetHandler returns the CLSID of the component that should be loaded into
  the COM client's process. If GetHandler returns a failure code, then no
  handler is loaded.
* GetHandlerPayloadSize and WriteHandlerPayload are for obtaining the payload
  data. These calls are made on a background thread but need to do their work
  on the main thread. We declare the payload struct in IDL. MIDL generates two
  functions, IA2Payload_Encode and IA2Payload_Decode, which are used by
  mscom::StructToStream to read and write that struct to and from buffers.
* The a11y payload struct also includes an interface, IGeckoBackChannel, that
  allows the handler to communicate directly with Gecko. IGeckoBackChannel
  currently provides two methods: one to allow the handler to request fresh
  cache information, and the other to provide Gecko with its IHandlerControl
  interface.
* MarshalAs accepts an IID that specifies the interface that is about to be
  proxied. We may want to send a more sophisticated proxy than the one that
  is requested. The desired IID is returned by this function. In the case of
  a11y interfaces, we should always return IAccessible2_3 if we are asked for
  one of its parent interfaces. This allows us to eliminate round trips to
  resolve more sophisticated interfaces later on.
* NewInstance, which is needed to ensure that all descendent proxies are also
  imbued with the same handler code.

The main focus of this patch is as follows:

1. Provide an implementation of the IHandlerProvider interface;
2. Populate the handler payload (ie, the cache) with data;
3. Modify CreateHolderFromAccessible to specify the HandlerPayload object;
4. Receive the IHandlerControl interface from the handler DLL and move it
   into the chrome process.

Some more information about IHandlerControl:

There is one IHandlerControl per handler DLL instance. It is the interface that
we call in Gecko when we need to dispatch an event to the handler. In order to
ensure that events are dispatched in the correct order, we need to dispatch
those events from the chrome main thread so that they occur in sequential order
with calls to NotifyWinEvent.
2017-04-04 15:23:55 -06:00
David Parks
a1e5902990 Bug 1332690 - Assign Managers to DocAccessibleChilds. r=tbsaunde
The Manager is set by IPDL for remotely constructed objects but our DocAccessibleChilds are created on the child process side, so we need to assign a manager in the constructor so that we can find it when needed.
2017-03-27 10:03:43 -07:00
Trevor Saunders
0601413c85 bug 1332690 - don't try and bind child docs to a shutdown DocAccessibleParent r=yzen
a BindChildDoc message can race with the parent process shutting down a tab.
The result of that is that RecvBindChildDoc() can be called on a
DocAccessibleParent that has already been shut down by the destruction of the
owning TabParent.
2017-03-05 23:12:13 -05:00
Trevor Saunders
632e194494 bug 1340579 - fixup werror bustage landing on a CLOSED TREE 2017-03-01 17:45:04 -05:00
Trevor Saunders
4557e5270c bug 1340579 - look up this DocAccessibleParent in live docs instead of using this in DocAccessibleParent::Destroy() r=davidb 2017-03-01 17:23:48 -05:00
Aaron Klotz
c7acb380ee Bug 1310166: Register ISimpleDOMNode typelib in content process; r=tbsaunde
MozReview-Commit-ID: 2JcIHJbHDgT
2017-02-23 11:32:06 -07:00
Trevor Saunders
36a7743d5f Bug 1341731 - fixup werror bustage. r=bustage-fix on a CLOSED TREE 2017-02-24 17:02:12 +01:00
Trevor Saunders
fc47277b0f bug 1341731 - propagate failures before working around them r=yzen 2017-02-24 10:26:27 -05:00
Sebastian Hengst
5738af2411 Backed out changeset c1544abd34c2 (bug 1340903) for frequent failure of docshell/test/unit/test_setUsePrivateBrowsing.js on Linux opt and pgo. r=backout 2017-02-22 09:59:29 +01:00
Trevor Saunders
03dfaa3451 bug 1340579 - add another diagnostic assert r=davidb 2017-02-21 22:27:49 -05:00
Trevor Saunders
815930320c bug 1340903 - work around binding child docs to non outer DocAccessibles r=eeejay 2017-02-21 22:27:49 -05:00
Trevor Saunders
f7128879bc bug 1332690 - work around non existant proxies 2017-02-21 11:19:51 -05:00
Eitan Isaacson
a0926213b9 Bug 1340733 - Fix attributes getter in win/ProxyAccessible. r=yzen
MozReview-Commit-ID: 7s3UrJlcsEQ
2017-02-16 15:32:19 -08:00
Trevor Saunders
fa9536ba49 bug 1197184 - downgrade various MOZ_DIAGNOSTIC_ASSERTs 2017-02-17 10:15:26 -05:00
Trevor Saunders
37e380e277 bug 1338755 - split up SetCOMProxy() r=yzen 2017-02-17 09:06:26 -05:00
Trevor Saunders
3187a99c18 bug 1338755 - split parts of SetCOMProxy() out to MaybeInitWindowEmulation() r=yzen 2017-02-17 09:06:26 -05:00
Trevor Saunders
bb26e7202d bug 1197181 - downgrade diagnostic assert in RecvHideEvent() 2017-02-16 16:27:40 -05:00
Trevor Saunders
9bc373b84e bug 1338755 - split ParentCOMProxy message up r=yzen
sending the emulated window information is basically unrelated to sending the
parent COM proxy to the child process, and in the future it will be useful to
send these at different times.
2017-02-16 15:17:53 -05:00
Trevor Saunders
d3a9c8cfcf bug 1339472 - refer to child DocAccessibleParents by id r=yzen 2017-02-14 18:10:04 -05:00
Trevor Saunders
e03a08508e bug 1339472 - make DocAccessibleParents refer to there parent document by id r=yzen
This saves a little space on x86_64 builds.
2017-02-14 18:10:03 -05:00
Trevor Saunders
b9b733d734 bug 1339472 - keep a map from DocAccessibleParents to the actors themselves r=yzen 2017-02-14 18:10:03 -05:00
Trevor Saunders
7209bcb07d bug 1339156 - add an assert to RemoveChildDoc() r=yzen 2017-02-14 11:10:47 -05:00
Trevor Saunders
63b439d560 bug 1339128 - reference parent proxy by id r=eeejay 2017-02-13 14:52:07 -05:00
Eitan Isaacson
28ea3a8468 Bug 1336637 - Support relation methods in xpc on windows. r=tbsaunde
MozReview-Commit-ID: BcyE0Vy1Fu4
2017-02-10 17:27:33 -08:00
Trevor Saunders
c0dcf3999b bug 1337983 - remove incorrect assert r=aklotz
the outer doc of a top level content document does not necessarily exist when
we recieve the PDocAccessibleConstructor message for it.  So we shouldn't asser
there is an outer doc here.
2017-02-10 16:06:54 -05:00
Yura Zenevich
d02dc625e5 Bug 1206711 - pass emulated window proxy to doc accessible child to be used as parent IAccessible for top level documents. r=tbsaunde
MozReview-Commit-ID: 4ejD6OmNgiR
2017-02-10 08:11:29 -05:00
Trevor Saunders
c186e6199d bug 1326084 - rework ProxyAccessible handling of outer docs 2017-02-10 00:41:29 -05:00
Wes Kocher
6eb9e61652 Backed out changeset 15d237d39fb8 (bug 1332690) for asserts in DocAccessibleParent.cpp a=backout
MozReview-Commit-ID: BwRMVLvOSde
2017-02-08 16:19:20 -08:00
Trevor Saunders
fabf5a3bab bug 1332690 - remove diagnostic for nonexistant proxies 2017-02-08 14:22:14 -05:00
Trevor Saunders
10335a6996 bug 1336901 - remove incorrect assert r=yzen
There are cases where there is no good reason to shutdown the child document
actors before the parent.  For example when TabParent::DestroyInternal() is
about to send the Destroy message we might as well just shut down the top level
document and let that tear down the rest.
2017-02-06 13:21:30 -05:00
Trevor Saunders
46953b5e96 bug 1337028 - add another diagnostic assert to DocAccessibleParent::Destroy() r=yzen 2017-02-06 13:21:30 -05:00
Wes Kocher
9fe94babd6 Merge m-c to inbound a=release CLOSED TREE
MozReview-Commit-ID: AwyW5DU4EMh
2017-02-03 17:21:29 -08:00
Trevor Saunders
84427f7d36 backout bug 1326084 2017-02-03 12:47:51 -05:00
Eitan Isaacson
bb099cbf09 Bug 1335825 - Provide full state bitfield to xpcom accessibles in Windows. r=yzen
MozReview-Commit-ID: H7lFB5khEJm
2017-02-03 15:22:09 -08:00