crosswalk-project/crosswalk — pull request #1336 by cmarcelo (2013-12-15 15:22:40+00:00)
Title: [Extensions] Change when we create the extensions

This patch changes slightly when we create the extensions, instead of
calling XWalkExtensionService::OnRenderProcessHostCreated() and waiting
for the delegate functions to be called, the interface now expects
vectors to be passed with the extensions.

There are three upsides:

- At extension creation time we have the reference to RenderProcessHost,
allowing us to pass that to the extensions (and in the future pass the
Application, which will have 1-1 relationship with RPH).

- We don't need to expose the XWalkExtensionServer. A full object
interface was being included and passed around, just for using one
function. Exposing less objects gives us more freedom to change things
in the future.

- We simplify the usage of XWalkExtensionService, by removing the use of
Delegate for creating the extensions.

There are two downsides, which I consider minor compared to the
benefits:

- It's not clear in the type that ownership is being passed to
XWalkExtensionService. It is documented and we can add a more clear
type in the future. For now we can live with this.

- We don't have the information whether the extension was registered
successfully or not from the tests. However, other later assertions
assured that the test passed.

The patch is quite big because we changed all the plumbing in the tests.