Jump to content

User:Fuzailm1/Servo

From Wikipedia, the free encyclopedia

Servo

Servo[1] is a research project with the aim of creating a web browser layout engine written in Rust, being developed by Mozilla Research. The prototype of the system currently seeks to create a highly parallel environment in which many components are handled by fine-grained, isolated components. Servo provides a consistent API for hosting the engine within other software.Servo is still at an early stage of development. Servo can act as a standalone browser.

Rust

Rust[2] is a general purpose, multi-paradigm, programming language sponsored, developed, and maintained by Mozilla Research for creating highly concurrent and highly safe systems. The development of Rust had an emphasis on control of memory layout, safety, and concurrency. It is very similar to C++ in terms of syntax but differs heavily in its semantics.

Project Description

[edit]

The primary purpose of our contribution to the project was to add native support for the feature that enables the creation of HTTP archive files which can be analyzed by other tools. The addition of this feature to Servo allows more precise comparisons to be made with other browsers. Our primary steps while working on the project involved[3]:

clone the rust-har repository and update the code to build with a modern version of Rust:

  • remove/replace invalid integer suffixes
  • replace box expressions with Box::new syntax
  • replace use of serialize crate with serde_json
  • add a new constructor for the Timing/CacheEntry/Cache/Content/Entry/Request/Response/Cookie/Header structures
  • make the tests use the new constructor methods (cargo test)
  • add TravisCI integration

Design Pattern

[edit]

No design pattern was needed/used in this project.

Implementation

[edit]

We have completed the above steps, and following are some of the snippets of code that were added or altered.

Step 1: removing/replacing invalid integer suffixes

removing/replacing invalid integer suffixes
removing/replacing invalid integer suffixes

Step 2: replacing box expressions with Box::new syntax

replacing box expressions with Box::new syntax
replacing box expressions with Box::new syntax

Step 3: replacing use of serialize crate with serde_json

replacing use of serialize crate with serde_json
replacing use of serialize crate with serde_json

Step 4: adding new constructors for the structures

adding new constructors for the structures
adding new constructors for the structures

Step 5: writing test cases to use the new constructors

writing test cases to use the new constructors
writing test cases to use the new constructors

References

[edit]