Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

HTTP archive support project

Josh Matthews edited this pageSep 25, 2017 ·4 revisions

Implement support for creating HTTP archive files from Servo sessions

Background information: Major browsers supportcreating HTTP archive files which can be analyzed by other tools. Adding native support for this feature to Servo will allow us to compare our network performance more precisely against other browsers.

Tracking issue:https://github.com/servo/servo/issues/4004 (please ask questions here)

Initial steps:

Subsequent steps:

  • Store a vector ofhar::Page inConstellation
    • when a new pipeline is created (Constellation::new_pipeline), add an entry to this vector using the pipeline ID as the page's unique id
  • Store a vector ofhar::Entry values inCoreResourceManager, wrapped insideArc andMutex types to allow other threads to manipulate the vector
    • add aArc<Mutex<Vec<har::Entry>>> member to theFetchContext structure, and initialize it from the resource manager's new field
    • inhttp_fetch, create a newhar::Request instance based on the values available from therequest variable
    • before step 5 ofhttp_fetch, create a newhar::Response value based on the values available from theresponse variable
    • create a newhar::Entry value and append it to the vector stored inFetchContext, using the request'spipeline_id field as thepageref value to associate it with the pages stored in theConstellation
    • duringConstellation::handle_shutdown as part of theCoreResourceMsg::Exit message send the vector ofhar::Page values
    • when the resource thread receives this message (CoreResourceManager::process_msg), if there is a vector present then combine the provided Page and member Entry values and process them according to the member variable (either sending them on the channel or writing them to a file)
  • add a unit test to ensure that the resource thread logs the HAR information correctly:
    • create a resource manager with an IpcSender as the HAR output
    • start an HTTP server and fetch a URL from it by sending a CoreResourceMsg::Fetch message to the resource manager
    • Once the fetch is complete, send the exit message to the resource manager with a har::Page value for the single fetch (acting as the Constellation)
    • assert that the expected har::Log value is received from the resource thread

Clone this wiki locally


[8]ページ先頭

©2009-2025 Movatter.jp