crosswalk-project/crosswalk — pull request #1358 by cmarcelo (2013-12-17 21:18:09+00:00)
Title: [Runtime] Add XWalkRunner

This starts the implementation of step (4) in Mikhail's and Alexander's plan to revamp the Runtime code.

"4. Fix ownership at Chromium Content API embedding classes: ContentBrowserClient, MainParts, BrowserContext"

https://docs.google.com/a/intel.com/document/d/1N0VVlut7JCWFbAEwTQc0loN9_D2JlOXRJprQeCbXY2U/edit

My early feedback was to merge together the "main object" of Crosswalk with ApplicationSystem, but after some more thought, feedback from discussions and trying out in the code, I think for now we could benefit of a separate object. Later on if needed ApplicationSystem can "blend" itself into that main object.

XWalkRunner is responsible to setup and teardown the object tree for Crosswalk execution. This job was spread between different classes. As discussed, the idea is treat the previous "candidates to be a main class" (RuntimeContext, XWalkBrowserMainParts, XWalkContentBrowserClient) as "things we use for Content API adaptation". Our main class have a clear lifecycle AND owns (or creates and gives) the previous candidates to Content framework as necessary.

See also the commit messages for more detailed view on each change.

I prefer to do this step now, and then in further PRs move the systems (extension, application, etc) to the XWalkRuntime. That way new objects that appear already have a right place to be added to. As we move things, the need will appear to have specific subclasses for each platform, this is expected.