User:Fuzailm1/Servo
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](http://upload.wikimedia.org/wikipedia/commons/8/89/Screen1_1.png)
Step 2: replacing box expressions with Box::new syntax
![replacing box expressions with Box::new syntax](http://upload.wikimedia.org/wikipedia/commons/2/28/Screen1_2.png)
Step 3: replacing use of serialize crate with serde_json
![replacing use of serialize crate with serde_json](http://upload.wikimedia.org/wikipedia/commons/1/1e/Screen1_3.png)
Step 4: adding new constructors for the structures
![adding new constructors for the structures](http://upload.wikimedia.org/wikipedia/commons/0/07/Screen1_4.png)
Step 5: writing test cases to use the new constructors
![writing test cases to use the new constructors](http://upload.wikimedia.org/wikipedia/commons/d/dd/Screen1_5.png)