<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Nkdalmia</id>
	<title>Expertiza_Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Nkdalmia"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Nkdalmia"/>
	<updated>2026-05-17T00:25:00Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015&amp;diff=98392</id>
		<title>CSC/ECE 517 Spring 2015</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015&amp;diff=98392"/>
		<updated>2015-11-06T17:52:41Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Writing Assignment 1==&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 17 WL]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 5 ZX]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 6 TZ]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 4 RW]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 7 SA]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 9 RA]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 14 RI]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 1 DZ]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 20 HA]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 3 RF]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 12 LS]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 13 MA]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 2 WA]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1b 21 QW]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1b 23 MS]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1b 10 GL]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1b 27 VC]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1b 22 SF]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1b 15 SH]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1b 18 AS]]&lt;br /&gt;
&lt;br /&gt;
==Writing Assignment 2==&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss E1502 wwj]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/oss E1508 MRS]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss E1504 IMV]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss E1505 xzl]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss E1509 lds]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss E1510 FLP]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss E1506 SYZ]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss S1504 AAC]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss E1507 DG]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss M1502 GVJ]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss M1503 EDT]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss E1503 RSA]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss E1501 YWS]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss S1501 OA]]&lt;br /&gt;
&lt;br /&gt;
==Final Project Design Document==&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015 E1526 MPRI]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015 S1503 LWJZ]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015 S1524 FSZZ]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015 M1503 EDTS]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015 E1529 GLDS]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015 E1525 TIAA]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015 E1522 Visualization]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015 E1527 SWAR]]&lt;br /&gt;
&lt;br /&gt;
==Final Project Report==&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015 E1526]]&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Got23.jpg&amp;diff=98390</id>
		<title>File:Got23.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Got23.jpg&amp;diff=98390"/>
		<updated>2015-11-06T17:51:58Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Got21.jpg&amp;diff=98388</id>
		<title>File:Got21.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Got21.jpg&amp;diff=98388"/>
		<updated>2015-11-06T17:50:07Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015/test_page&amp;diff=98385</id>
		<title>CSC/ECE 517 Spring 2015/test page</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015/test_page&amp;diff=98385"/>
		<updated>2015-11-06T17:46:07Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Gottest11.jpg]]&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Gottest11.jpg&amp;diff=98384</id>
		<title>File:Gottest11.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Gottest11.jpg&amp;diff=98384"/>
		<updated>2015-11-06T17:45:05Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015/test_page&amp;diff=98383</id>
		<title>CSC/ECE 517 Spring 2015/test page</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015/test_page&amp;diff=98383"/>
		<updated>2015-11-06T17:41:29Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: Created page with &amp;quot;got2.jpg&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[got2.jpg]]&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Got_2.jpg&amp;diff=98381</id>
		<title>File:Got 2.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Got_2.jpg&amp;diff=98381"/>
		<updated>2015-11-06T17:36:19Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015&amp;diff=98379</id>
		<title>CSC/ECE 517 Spring 2015</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015&amp;diff=98379"/>
		<updated>2015-11-06T17:28:41Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[CSC/ECE 517 Spring 2015/test page]]&lt;br /&gt;
==Writing Assignment 1==&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 17 WL]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 5 ZX]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 6 TZ]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 4 RW]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 7 SA]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 9 RA]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 14 RI]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 1 DZ]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 20 HA]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 3 RF]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 12 LS]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 13 MA]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 2 WA]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1b 21 QW]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1b 23 MS]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1b 10 GL]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1b 27 VC]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1b 22 SF]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1b 15 SH]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1b 18 AS]]&lt;br /&gt;
&lt;br /&gt;
==Writing Assignment 2==&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss E1502 wwj]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/oss E1508 MRS]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss E1504 IMV]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss E1505 xzl]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss E1509 lds]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss E1510 FLP]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss E1506 SYZ]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss S1504 AAC]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss E1507 DG]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss M1502 GVJ]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss M1503 EDT]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss E1503 RSA]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss E1501 YWS]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss S1501 OA]]&lt;br /&gt;
&lt;br /&gt;
==Final Project Design Document==&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015 E1526 MPRI]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015 S1503 LWJZ]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015 S1524 FSZZ]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015 M1503 EDTS]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015 E1529 GLDS]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015 E1525 TIAA]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015 E1522 Visualization]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015 E1527 SWAR]]&lt;br /&gt;
&lt;br /&gt;
==Final Project Report==&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015 E1526]]&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015&amp;diff=97138</id>
		<title>CSC/ECE 517 Fall 2015</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015&amp;diff=97138"/>
		<updated>2015-09-21T04:00:54Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: /* Writing Assignment 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Writing Assignment 2==&lt;br /&gt;
*[[CSC/ECE_517_Fall_2015/sample_page]]&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015&amp;diff=97137</id>
		<title>CSC/ECE 517 Fall 2015</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2015&amp;diff=97137"/>
		<updated>2015-09-21T03:59:33Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: Created page with &amp;quot;==Writing Assignment 2== *CSC/ECE 517 Fall 2015/oss E1501 nnn&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Writing Assignment 2==&lt;br /&gt;
*[[CSC/ECE 517 Fall 2015/oss E1501 nnn]]&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92500</id>
		<title>CSC/ECE 517 Fall 2014/final design doc M1450 navr</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92500"/>
		<updated>2014-12-04T05:00:54Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: /* Design Pattern */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implement Window.sessionStorage ==&lt;br /&gt;
&lt;br /&gt;
This is the design document for the task &amp;lt;code&amp;gt;[http://github.com/servo/servo/wiki/Storage-student-project Implement Window.sessionStorage]&amp;lt;/code&amp;gt; for the [http://www.mozilla.org/ Mozilla] research project [http://github.com/servo/servo/wiki/Design Servo].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== [http://www.rust-lang.org/ Rust]===&lt;br /&gt;
&lt;br /&gt;
Rust is a modern systems programming language focusing on safety and speed to build reliable and efficient systems &amp;lt;ref&amp;gt; http://doc.rust-lang.org/nightly/intro.html &amp;lt;/ref&amp;gt;. It accomplishes the goals of memory safe without using garbage collection and it supports concurrency and parallelism in building platforms. &lt;br /&gt;
&lt;br /&gt;
Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://github.com/servo/servo/wiki/Design Servo] ===&lt;br /&gt;
&lt;br /&gt;
Mozilla Research team is currently working on an experimental project to develop a new Web browser engine &amp;quot;Servo&amp;quot;, that is capable of supporting a variety of current and next generation of hardware like mobile devices, multi-core processors and high-performance GPUs. Servo builds on top of Rust to provide a secure and reliable foundation. It is currently developed on 64 bit devices.&amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main objectives of this experimentation project is improving the layout to graphics rendering - to optimize for power efficiency and maximize parallelism. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
=== [http://html.spec.whatwg.org/multipage/webstorage.html#webstorage Web Storage] ===&lt;br /&gt;
The web storage specification defines the means by which a web application can store string key/value pairs in a browser and later retrieve them for use.&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage&amp;lt;/ref&amp;gt; It supports persistent data storage, similar to [http://en.wikipedia.org/wiki/HTTP_cookie cookies] but with a greatly enhanced capacity and no information stored in the [http://en.wikipedia.org/wiki/List_of_HTTP_headers HTTP request header].&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Web_storage&amp;lt;/ref&amp;gt; There are two types of web storage: [http://html.spec.whatwg.org/multipage/webstorage.html#dom-localstorage local storage] and [http://html.spec.whatwg.org/multipage/webstorage.html#dom-sessionstorage session storage].&lt;br /&gt;
&lt;br /&gt;
Browsers that support web storage have the global variables 'sessionStorage' and 'localStorage' declared at the [http://developer.mozilla.org/en-US/docs/Web/API/Window?redirectlocale=en-US&amp;amp;redirectslug=DOM%2Fwindow window] level. The following JavaScript code gives an example of how to use web storage:&lt;br /&gt;
&lt;br /&gt;
'''sessionStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on browser for duration of the session&lt;br /&gt;
sessionStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (gets deleted when browser is closed and re-opened)&lt;br /&gt;
alert(sessionStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''localStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on the browser beyond the duration of the session&lt;br /&gt;
localStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (persists even after closing and re-opening the browser)&lt;br /&gt;
alert(localStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
&lt;br /&gt;
As part of our [http://github.com/servo/servo/wiki/Storage-student-project project], we have to implement the web storage specification in the Servo browser. Implementing this important specification in Servo will allow stateful web applications to run, and will help expose any architectural problems that Servo's radical design may cause. &amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Requirement Analysis &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
In order to introduce the support for session storage and local storage in the Servo Browser, we have to create the Storage structure and allow web pages to store data in the Servo memory space.&lt;br /&gt;
&lt;br /&gt;
Below is a overview of the various steps identified as part of requirement analysis:&lt;br /&gt;
&lt;br /&gt;
'''Storage Interface'''&lt;br /&gt;
* We have to create the Storage interface and its stub implementation.&lt;br /&gt;
* This interface is used by the web pages to communicate to the web storage.&lt;br /&gt;
&lt;br /&gt;
'''WindowSessionStorage Interface'''&lt;br /&gt;
* We have to create the WindowSessionStorage interface which will return a Storage instance.&lt;br /&gt;
* A web page will use this interface to access its session storage.&lt;br /&gt;
&lt;br /&gt;
'''WebStorageTask'''&lt;br /&gt;
* We have to create a Storage Task which will be used to store all the web storage data.&lt;br /&gt;
* This is a separate thread which starts when browser starts.&lt;br /&gt;
* The class implementing the Storage interface uses it to store and retrieve the actual data.&lt;br /&gt;
&lt;br /&gt;
'''Communication Channel'''&lt;br /&gt;
* It provides the means to communicate to the separate thread 'WebStorageTask'.&lt;br /&gt;
* We need to define a message-passing interface for reading and writing stored data for a particular browser tab and use it in the implementation of Storage interface to communicate to WebStorageTask.&lt;br /&gt;
&lt;br /&gt;
'''Notification Event'''&lt;br /&gt;
* We need to notify the respective browser tab when the value of a stored data is changed so that other browser objects which may be using this data can take appropriate action.&lt;br /&gt;
&lt;br /&gt;
'''Web Storage Tests'''&lt;br /&gt;
* We need to pass as many [http://github.com/servo/web-platform-tests/tree/servo/webstorage tests] as possible.&lt;br /&gt;
* These tests are part of the web storage specification. Any browser implementing the web storage interface must pass as many tests as possible out of these.&lt;br /&gt;
&lt;br /&gt;
'''WindowLocalStorage Interface'''&lt;br /&gt;
* We need to implement the WindowLocalStorage interface which behaves slightly different from the WindowSessionStorage interface.&lt;br /&gt;
* This will provide the interface to access browser's local storage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
The implementation of the project was divided into the following milestones :&lt;br /&gt;
 &lt;br /&gt;
* '''Create and stub the Storage WebIDL interface defined in the spec :''' This milestone involved the initial creation of the Storage interface on which the entire project is based. The storage web idl was created as defined in the specifications : https://html.spec.whatwg.org/multipage/webstorage.html#storage-2&lt;br /&gt;
&lt;br /&gt;
* '''Create and stub the WindowSessionStorage WebIDL interface defined in the spec, making it return a Storage instance''' : Once the Storage interface was created, we had to implement the interface to actually define the functions which were a part of the interface. Here we extended the Storage interface to specialize it as Session Storage interface namely WindowSessionStorage. The methods in this interface were then further implemented in Storage.rs which was made to return a Storage instance to the web page or application requiring the support of sessionstorage.&lt;br /&gt;
&lt;br /&gt;
* '''Create a storage task (similar to the resource task) which will contain all stored data''' : The actual data is stored in a background task known as Storage Task, A task in rust terms is nothing but a thread which can run in the background keep polling until it is required, it does so by looping over a channel until a request comes its way. The Storage task contains a HashMap of TreeMap. The Hashmap is used to store the storage data for all the sites. Its keys represent the origin of the request (determined from the URL it is coming from). There is an entry in the HashMap for each different origin. The respective value represents the storage data for the site. This site specific data is stored as a TreeMap which maintains the &amp;lt;key , value&amp;gt; pair in a ordered fashion. Thus the storage task contains the actual data structure which holds all the values and the Storage.rs acts as a mediator between the object and the data stored in the task.&lt;br /&gt;
&lt;br /&gt;
* '''Define a message-passing interface for reading and writing stored data for a particular origin''': The Storage object requires a medium to delegate the functions to storage task where the actual implementation takes place. This is done using [http://doc.rust-lang.org/std/comm/fn.channel.html Channels]. There are 2 major channels. First one is the one which the storage task creates and keeps on listening for any the request. The other is when the storage object wants to get some data from the task. The Storage object creates a temporary channel on which it listens for any reply by the Storage task. This is how the message-passing interface has been implemented in the given milestone.&lt;br /&gt;
&lt;br /&gt;
* '''Store a channel to the storage task in the Page structure that sends messages from the previous interface, and make use of it in the implementation of Storage''': The storage object requires to know the channel on which the task is looping in order to send it requests for get, set or other functions. This is done by storing the channel that the storage task creates in the Page Structure which acts as a common object between these 2. Hence, by passing the created channel to the page structure it can now be accessed and utilized by the Storage object in order to delegate the methods onto the storage task and communicate.&lt;br /&gt;
&lt;br /&gt;
== Architecture &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Design&amp;lt;/ref&amp;gt;==&lt;br /&gt;
[[File:task.jpg]] &lt;br /&gt;
&lt;br /&gt;
=== Architecture Explained ===&lt;br /&gt;
*Each box represents a Rust task.&lt;br /&gt;
*Blue boxes represent the primary tasks in the browser pipeline.&lt;br /&gt;
*Gray boxes represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
*White boxes represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
*Dashed lines indicate supervisor relationships.&lt;br /&gt;
*Solid lines indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
== Component Design ==&lt;br /&gt;
[[File:servo.jpg]]&lt;br /&gt;
&lt;br /&gt;
There will be a Storage Task which will be responsible to hold all the data that the web page requests to save. This happens via Channels in Rust, which implements a Sender Receiver protocol. The task is runnning in the background and waits to receive the data sent from the web page.&lt;br /&gt;
&lt;br /&gt;
=== Task &amp;lt;ref&amp;gt;http://doc.rust-lang.org/guide-tasks.html&amp;lt;/ref&amp;gt;===&lt;br /&gt;
Rust provides safe concurrent abstractions through a number of core library primitives. This guide will describe the concurrency model in Rust, how it relates to the Rust type system, and introduce the fundamental library abstractions for constructing concurrent programs.&lt;br /&gt;
&lt;br /&gt;
Tasks provide failure isolation and recovery. When a fatal error occurs in Rust code as a result of an explicit call to panic!(), an assertion failure, or another invalid operation, the runtime system destroys the entire task. Unlike in languages such as Java and C++, there is no way to catch an exception. Instead, tasks may monitor each other to see if they panic.&lt;br /&gt;
&lt;br /&gt;
Tasks use Rust's type system to provide strong memory safety guarantees. In particular, the type system guarantees that tasks cannot induce a data race from shared mutable state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Generate some state locally&lt;br /&gt;
let child_task_number = generate_task_number();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    // Capture it in the remote task&lt;br /&gt;
    println!(&amp;quot;I am child number {}&amp;quot;, child_task_number);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Channel &amp;lt;ref&amp;gt;http://doc.rust-lang.org/guide-tasks.html&amp;lt;/ref&amp;gt;===&lt;br /&gt;
Now that we have spawned a new task, it would be nice if we could communicate with it. For this, we use channels. A channel is simply a pair of endpoints: one for sending messages and another for receiving messages.&lt;br /&gt;
&lt;br /&gt;
The simplest way to create a channel is to use the channel function to create a (Sender, Receiver) pair. In Rust parlance, a sender is a sending endpoint of a channel, and a receiver is the receiving endpoint. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
let (tx, rx): (Sender&amp;lt;int&amp;gt;, Receiver&amp;lt;int&amp;gt;) = channel();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    let result = some_expensive_computation();&lt;br /&gt;
    tx.send(result);&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
some_other_expensive_computation();&lt;br /&gt;
let result = rx.recv();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Data Design ==&lt;br /&gt;
&lt;br /&gt;
===  Data Description ===&lt;br /&gt;
&lt;br /&gt;
''The following data structure has been used ''&lt;br /&gt;
&lt;br /&gt;
'''StorageTask''' | HashMap&amp;lt;String, TreeMap&amp;lt;DomString,DomString&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Pattern ==&lt;br /&gt;
&lt;br /&gt;
We have used the '''&amp;quot;Delegation Pattern&amp;quot;''' in our project. The Storage interface is used by web applications to access the web storage provided by the browser. However, the actual data is stored somewhere else(Servo Memory Space). So, it makes sense to create another class which should maintain the actual stored data. The Storage class can then delegate the task of storing/retrieving data to this class. We have created a class &amp;quot;StorageTask&amp;quot; for this purpose.&lt;br /&gt;
&lt;br /&gt;
Also we are using an '''&amp;quot;Observer Pattern&amp;quot;''' where the Storage task runs in the background and observes the commands issued using a channel. It keeps on listening to changes on a port and as soon as it receives a message i.e. sees a call towards it, it performs the required function.&lt;br /&gt;
&lt;br /&gt;
== UML Diagrams ==&lt;br /&gt;
&lt;br /&gt;
=== Flow Chart ===&lt;br /&gt;
[[File:Flow_Chart_Storage.png]]&lt;br /&gt;
&lt;br /&gt;
1. First, we need to build rust and servo. &amp;lt;br/&amp;gt;&lt;br /&gt;
2. Generate the corresponding WebIDL bindings - Storage.webidl &amp;lt;br/&amp;gt;&lt;br /&gt;
3. Define Storage.rs which has the actual code for creating the storage object. &amp;lt;br/&amp;gt;&lt;br /&gt;
4. Call the receiver via a channel- this is actually used for creating an instance for each unique URL. &amp;lt;br/&amp;gt;&lt;br /&gt;
5. Build the servo again. &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Use Case Diagram ===&lt;br /&gt;
[[File:Use_Case_-_Storage.png‎]]&lt;br /&gt;
&lt;br /&gt;
1. Here the user can open multiple domains( multiple URL's).&amp;lt;br/&amp;gt;&lt;br /&gt;
2. Thereby the user will be creating multiple storage instances.&amp;lt;br/&amp;gt;&lt;br /&gt;
3. An user can traverse deep into the website but the storage instance is same for that URL.&amp;lt;br/&amp;gt;&lt;br /&gt;
4. The user can reopen the domain for a later period.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Proposed Test Cases ==&lt;br /&gt;
&lt;br /&gt;
Some of the test cases which will be used to validate our changes are as follows:&lt;br /&gt;
&lt;br /&gt;
* Allow a web page to clear its session storage ''i.e. storage.clear() function should work''&lt;br /&gt;
* Allow a web page to store an item in its session storage ''i.e. test storage.setitem(key,value)''&lt;br /&gt;
* Allow a web page to retrieve stored items from its session storage ''i.e. test storage.getitem(key)''&lt;br /&gt;
* Do not allow a web page to retrieve stored items from the session storage of a web page in another domain ''i.e. try to access elements by forging url&lt;br /&gt;
* Check the number of items stored in session storage i.e storage.count()''&lt;br /&gt;
* On removing an item from storage, it should be inaccessible ''i.e check if storage.remove(key) is functional''&lt;br /&gt;
* Should return null as value for a key not present in the session storage ''i.e. test storage.getitem(key) for non-existent key''&lt;br /&gt;
* Should give an error on exceeding the space limit of session storage ''i.e check for available memory on each command'' &lt;br /&gt;
&lt;br /&gt;
The complete list of test cases can be found [http://github.com/servo/web-platform-tests/tree/servo/webstorage here].&lt;br /&gt;
&lt;br /&gt;
== Further Readings ==&lt;br /&gt;
&lt;br /&gt;
Learning Rust by Examples: http://rustbyexample.com/ &amp;lt;br/&amp;gt;&lt;br /&gt;
Javascript as Servo's Garbage Collector: http://blog.mozilla.org/research/2014/08/26/javascript-servos-only-garbage-collector/  &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92497</id>
		<title>CSC/ECE 517 Fall 2014/final design doc M1450 navr</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92497"/>
		<updated>2014-12-04T04:58:38Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: /* Data Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implement Window.sessionStorage ==&lt;br /&gt;
&lt;br /&gt;
This is the design document for the task &amp;lt;code&amp;gt;[http://github.com/servo/servo/wiki/Storage-student-project Implement Window.sessionStorage]&amp;lt;/code&amp;gt; for the [http://www.mozilla.org/ Mozilla] research project [http://github.com/servo/servo/wiki/Design Servo].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== [http://www.rust-lang.org/ Rust]===&lt;br /&gt;
&lt;br /&gt;
Rust is a modern systems programming language focusing on safety and speed to build reliable and efficient systems &amp;lt;ref&amp;gt; http://doc.rust-lang.org/nightly/intro.html &amp;lt;/ref&amp;gt;. It accomplishes the goals of memory safe without using garbage collection and it supports concurrency and parallelism in building platforms. &lt;br /&gt;
&lt;br /&gt;
Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://github.com/servo/servo/wiki/Design Servo] ===&lt;br /&gt;
&lt;br /&gt;
Mozilla Research team is currently working on an experimental project to develop a new Web browser engine &amp;quot;Servo&amp;quot;, that is capable of supporting a variety of current and next generation of hardware like mobile devices, multi-core processors and high-performance GPUs. Servo builds on top of Rust to provide a secure and reliable foundation. It is currently developed on 64 bit devices.&amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main objectives of this experimentation project is improving the layout to graphics rendering - to optimize for power efficiency and maximize parallelism. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
=== [http://html.spec.whatwg.org/multipage/webstorage.html#webstorage Web Storage] ===&lt;br /&gt;
The web storage specification defines the means by which a web application can store string key/value pairs in a browser and later retrieve them for use.&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage&amp;lt;/ref&amp;gt; It supports persistent data storage, similar to [http://en.wikipedia.org/wiki/HTTP_cookie cookies] but with a greatly enhanced capacity and no information stored in the [http://en.wikipedia.org/wiki/List_of_HTTP_headers HTTP request header].&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Web_storage&amp;lt;/ref&amp;gt; There are two types of web storage: [http://html.spec.whatwg.org/multipage/webstorage.html#dom-localstorage local storage] and [http://html.spec.whatwg.org/multipage/webstorage.html#dom-sessionstorage session storage].&lt;br /&gt;
&lt;br /&gt;
Browsers that support web storage have the global variables 'sessionStorage' and 'localStorage' declared at the [http://developer.mozilla.org/en-US/docs/Web/API/Window?redirectlocale=en-US&amp;amp;redirectslug=DOM%2Fwindow window] level. The following JavaScript code gives an example of how to use web storage:&lt;br /&gt;
&lt;br /&gt;
'''sessionStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on browser for duration of the session&lt;br /&gt;
sessionStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (gets deleted when browser is closed and re-opened)&lt;br /&gt;
alert(sessionStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''localStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on the browser beyond the duration of the session&lt;br /&gt;
localStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (persists even after closing and re-opening the browser)&lt;br /&gt;
alert(localStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
&lt;br /&gt;
As part of our [http://github.com/servo/servo/wiki/Storage-student-project project], we have to implement the web storage specification in the Servo browser. Implementing this important specification in Servo will allow stateful web applications to run, and will help expose any architectural problems that Servo's radical design may cause. &amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Requirement Analysis &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
In order to introduce the support for session storage and local storage in the Servo Browser, we have to create the Storage structure and allow web pages to store data in the Servo memory space.&lt;br /&gt;
&lt;br /&gt;
Below is a overview of the various steps identified as part of requirement analysis:&lt;br /&gt;
&lt;br /&gt;
'''Storage Interface'''&lt;br /&gt;
* We have to create the Storage interface and its stub implementation.&lt;br /&gt;
* This interface is used by the web pages to communicate to the web storage.&lt;br /&gt;
&lt;br /&gt;
'''WindowSessionStorage Interface'''&lt;br /&gt;
* We have to create the WindowSessionStorage interface which will return a Storage instance.&lt;br /&gt;
* A web page will use this interface to access its session storage.&lt;br /&gt;
&lt;br /&gt;
'''WebStorageTask'''&lt;br /&gt;
* We have to create a Storage Task which will be used to store all the web storage data.&lt;br /&gt;
* This is a separate thread which starts when browser starts.&lt;br /&gt;
* The class implementing the Storage interface uses it to store and retrieve the actual data.&lt;br /&gt;
&lt;br /&gt;
'''Communication Channel'''&lt;br /&gt;
* It provides the means to communicate to the separate thread 'WebStorageTask'.&lt;br /&gt;
* We need to define a message-passing interface for reading and writing stored data for a particular browser tab and use it in the implementation of Storage interface to communicate to WebStorageTask.&lt;br /&gt;
&lt;br /&gt;
'''Notification Event'''&lt;br /&gt;
* We need to notify the respective browser tab when the value of a stored data is changed so that other browser objects which may be using this data can take appropriate action.&lt;br /&gt;
&lt;br /&gt;
'''Web Storage Tests'''&lt;br /&gt;
* We need to pass as many [http://github.com/servo/web-platform-tests/tree/servo/webstorage tests] as possible.&lt;br /&gt;
* These tests are part of the web storage specification. Any browser implementing the web storage interface must pass as many tests as possible out of these.&lt;br /&gt;
&lt;br /&gt;
'''WindowLocalStorage Interface'''&lt;br /&gt;
* We need to implement the WindowLocalStorage interface which behaves slightly different from the WindowSessionStorage interface.&lt;br /&gt;
* This will provide the interface to access browser's local storage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
The implementation of the project was divided into the following milestones :&lt;br /&gt;
 &lt;br /&gt;
* '''Create and stub the Storage WebIDL interface defined in the spec :''' This milestone involved the initial creation of the Storage interface on which the entire project is based. The storage web idl was created as defined in the specifications : https://html.spec.whatwg.org/multipage/webstorage.html#storage-2&lt;br /&gt;
&lt;br /&gt;
* '''Create and stub the WindowSessionStorage WebIDL interface defined in the spec, making it return a Storage instance''' : Once the Storage interface was created, we had to implement the interface to actually define the functions which were a part of the interface. Here we extended the Storage interface to specialize it as Session Storage interface namely WindowSessionStorage. The methods in this interface were then further implemented in Storage.rs which was made to return a Storage instance to the web page or application requiring the support of sessionstorage.&lt;br /&gt;
&lt;br /&gt;
* '''Create a storage task (similar to the resource task) which will contain all stored data''' : The actual data is stored in a background task known as Storage Task, A task in rust terms is nothing but a thread which can run in the background keep polling until it is required, it does so by looping over a channel until a request comes its way. The Storage task contains a HashMap of TreeMap. The Hashmap is used to store the storage data for all the sites. Its keys represent the origin of the request (determined from the URL it is coming from). There is an entry in the HashMap for each different origin. The respective value represents the storage data for the site. This site specific data is stored as a TreeMap which maintains the &amp;lt;key , value&amp;gt; pair in a ordered fashion. Thus the storage task contains the actual data structure which holds all the values and the Storage.rs acts as a mediator between the object and the data stored in the task.&lt;br /&gt;
&lt;br /&gt;
* '''Define a message-passing interface for reading and writing stored data for a particular origin''': The Storage object requires a medium to delegate the functions to storage task where the actual implementation takes place. This is done using [http://doc.rust-lang.org/std/comm/fn.channel.html Channels]. There are 2 major channels. First one is the one which the storage task creates and keeps on listening for any the request. The other is when the storage object wants to get some data from the task. The Storage object creates a temporary channel on which it listens for any reply by the Storage task. This is how the message-passing interface has been implemented in the given milestone.&lt;br /&gt;
&lt;br /&gt;
* '''Store a channel to the storage task in the Page structure that sends messages from the previous interface, and make use of it in the implementation of Storage''': The storage object requires to know the channel on which the task is looping in order to send it requests for get, set or other functions. This is done by storing the channel that the storage task creates in the Page Structure which acts as a common object between these 2. Hence, by passing the created channel to the page structure it can now be accessed and utilized by the Storage object in order to delegate the methods onto the storage task and communicate.&lt;br /&gt;
&lt;br /&gt;
== Architecture &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Design&amp;lt;/ref&amp;gt;==&lt;br /&gt;
[[File:task.jpg]] &lt;br /&gt;
&lt;br /&gt;
=== Architecture Explained ===&lt;br /&gt;
*Each box represents a Rust task.&lt;br /&gt;
*Blue boxes represent the primary tasks in the browser pipeline.&lt;br /&gt;
*Gray boxes represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
*White boxes represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
*Dashed lines indicate supervisor relationships.&lt;br /&gt;
*Solid lines indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
== Component Design ==&lt;br /&gt;
[[File:servo.jpg]]&lt;br /&gt;
&lt;br /&gt;
There will be a Storage Task which will be responsible to hold all the data that the web page requests to save. This happens via Channels in Rust, which implements a Sender Receiver protocol. The task is runnning in the background and waits to receive the data sent from the web page.&lt;br /&gt;
&lt;br /&gt;
=== Task &amp;lt;ref&amp;gt;http://doc.rust-lang.org/guide-tasks.html&amp;lt;/ref&amp;gt;===&lt;br /&gt;
Rust provides safe concurrent abstractions through a number of core library primitives. This guide will describe the concurrency model in Rust, how it relates to the Rust type system, and introduce the fundamental library abstractions for constructing concurrent programs.&lt;br /&gt;
&lt;br /&gt;
Tasks provide failure isolation and recovery. When a fatal error occurs in Rust code as a result of an explicit call to panic!(), an assertion failure, or another invalid operation, the runtime system destroys the entire task. Unlike in languages such as Java and C++, there is no way to catch an exception. Instead, tasks may monitor each other to see if they panic.&lt;br /&gt;
&lt;br /&gt;
Tasks use Rust's type system to provide strong memory safety guarantees. In particular, the type system guarantees that tasks cannot induce a data race from shared mutable state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Generate some state locally&lt;br /&gt;
let child_task_number = generate_task_number();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    // Capture it in the remote task&lt;br /&gt;
    println!(&amp;quot;I am child number {}&amp;quot;, child_task_number);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Channel &amp;lt;ref&amp;gt;http://doc.rust-lang.org/guide-tasks.html&amp;lt;/ref&amp;gt;===&lt;br /&gt;
Now that we have spawned a new task, it would be nice if we could communicate with it. For this, we use channels. A channel is simply a pair of endpoints: one for sending messages and another for receiving messages.&lt;br /&gt;
&lt;br /&gt;
The simplest way to create a channel is to use the channel function to create a (Sender, Receiver) pair. In Rust parlance, a sender is a sending endpoint of a channel, and a receiver is the receiving endpoint. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
let (tx, rx): (Sender&amp;lt;int&amp;gt;, Receiver&amp;lt;int&amp;gt;) = channel();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    let result = some_expensive_computation();&lt;br /&gt;
    tx.send(result);&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
some_other_expensive_computation();&lt;br /&gt;
let result = rx.recv();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Data Design ==&lt;br /&gt;
&lt;br /&gt;
===  Data Description ===&lt;br /&gt;
&lt;br /&gt;
''The following data structure has been used ''&lt;br /&gt;
&lt;br /&gt;
'''StorageTask''' | HashMap&amp;lt;String, TreeMap&amp;lt;DomString,DomString&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Pattern ==&lt;br /&gt;
&lt;br /&gt;
We will be using '''&amp;quot;Delegation Pattern&amp;quot;''' in our project. The Storage interface is used by web applications to access the web storage provided by the browser. However, the actual data is stored somewhere else(Servo Memory Space). So, it makes sense to create another class which will maintain the actual stored data. The Storage class can then delegate the task of storing/retrieving data to this class. We will create a class &amp;quot;WebStorageTask&amp;quot; for this purpose.&lt;br /&gt;
&lt;br /&gt;
Also we are using an '''&amp;quot;Observer Pattern&amp;quot;''' where the Storage task will run in the background and observe the commands issued using a channel, it will keep listening to changes on a port and as soon as it receives a message i.e. sees a call towards it , it will perform the required function.&lt;br /&gt;
&lt;br /&gt;
== UML Diagrams ==&lt;br /&gt;
&lt;br /&gt;
=== Flow Chart ===&lt;br /&gt;
[[File:Flow_Chart_Storage.png]]&lt;br /&gt;
&lt;br /&gt;
1. First, we need to build rust and servo. &amp;lt;br/&amp;gt;&lt;br /&gt;
2. Generate the corresponding WebIDL bindings - Storage.webidl &amp;lt;br/&amp;gt;&lt;br /&gt;
3. Define Storage.rs which has the actual code for creating the storage object. &amp;lt;br/&amp;gt;&lt;br /&gt;
4. Call the receiver via a channel- this is actually used for creating an instance for each unique URL. &amp;lt;br/&amp;gt;&lt;br /&gt;
5. Build the servo again. &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Use Case Diagram ===&lt;br /&gt;
[[File:Use_Case_-_Storage.png‎]]&lt;br /&gt;
&lt;br /&gt;
1. Here the user can open multiple domains( multiple URL's).&amp;lt;br/&amp;gt;&lt;br /&gt;
2. Thereby the user will be creating multiple storage instances.&amp;lt;br/&amp;gt;&lt;br /&gt;
3. An user can traverse deep into the website but the storage instance is same for that URL.&amp;lt;br/&amp;gt;&lt;br /&gt;
4. The user can reopen the domain for a later period.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Proposed Test Cases ==&lt;br /&gt;
&lt;br /&gt;
Some of the test cases which will be used to validate our changes are as follows:&lt;br /&gt;
&lt;br /&gt;
* Allow a web page to clear its session storage ''i.e. storage.clear() function should work''&lt;br /&gt;
* Allow a web page to store an item in its session storage ''i.e. test storage.setitem(key,value)''&lt;br /&gt;
* Allow a web page to retrieve stored items from its session storage ''i.e. test storage.getitem(key)''&lt;br /&gt;
* Do not allow a web page to retrieve stored items from the session storage of a web page in another domain ''i.e. try to access elements by forging url&lt;br /&gt;
* Check the number of items stored in session storage i.e storage.count()''&lt;br /&gt;
* On removing an item from storage, it should be inaccessible ''i.e check if storage.remove(key) is functional''&lt;br /&gt;
* Should return null as value for a key not present in the session storage ''i.e. test storage.getitem(key) for non-existent key''&lt;br /&gt;
* Should give an error on exceeding the space limit of session storage ''i.e check for available memory on each command'' &lt;br /&gt;
&lt;br /&gt;
The complete list of test cases can be found [http://github.com/servo/web-platform-tests/tree/servo/webstorage here].&lt;br /&gt;
&lt;br /&gt;
== Further Readings ==&lt;br /&gt;
&lt;br /&gt;
Learning Rust by Examples: http://rustbyexample.com/ &amp;lt;br/&amp;gt;&lt;br /&gt;
Javascript as Servo's Garbage Collector: http://blog.mozilla.org/research/2014/08/26/javascript-servos-only-garbage-collector/  &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92496</id>
		<title>CSC/ECE 517 Fall 2014/final design doc M1450 navr</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92496"/>
		<updated>2014-12-04T04:57:11Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implement Window.sessionStorage ==&lt;br /&gt;
&lt;br /&gt;
This is the design document for the task &amp;lt;code&amp;gt;[http://github.com/servo/servo/wiki/Storage-student-project Implement Window.sessionStorage]&amp;lt;/code&amp;gt; for the [http://www.mozilla.org/ Mozilla] research project [http://github.com/servo/servo/wiki/Design Servo].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== [http://www.rust-lang.org/ Rust]===&lt;br /&gt;
&lt;br /&gt;
Rust is a modern systems programming language focusing on safety and speed to build reliable and efficient systems &amp;lt;ref&amp;gt; http://doc.rust-lang.org/nightly/intro.html &amp;lt;/ref&amp;gt;. It accomplishes the goals of memory safe without using garbage collection and it supports concurrency and parallelism in building platforms. &lt;br /&gt;
&lt;br /&gt;
Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://github.com/servo/servo/wiki/Design Servo] ===&lt;br /&gt;
&lt;br /&gt;
Mozilla Research team is currently working on an experimental project to develop a new Web browser engine &amp;quot;Servo&amp;quot;, that is capable of supporting a variety of current and next generation of hardware like mobile devices, multi-core processors and high-performance GPUs. Servo builds on top of Rust to provide a secure and reliable foundation. It is currently developed on 64 bit devices.&amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main objectives of this experimentation project is improving the layout to graphics rendering - to optimize for power efficiency and maximize parallelism. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
=== [http://html.spec.whatwg.org/multipage/webstorage.html#webstorage Web Storage] ===&lt;br /&gt;
The web storage specification defines the means by which a web application can store string key/value pairs in a browser and later retrieve them for use.&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage&amp;lt;/ref&amp;gt; It supports persistent data storage, similar to [http://en.wikipedia.org/wiki/HTTP_cookie cookies] but with a greatly enhanced capacity and no information stored in the [http://en.wikipedia.org/wiki/List_of_HTTP_headers HTTP request header].&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Web_storage&amp;lt;/ref&amp;gt; There are two types of web storage: [http://html.spec.whatwg.org/multipage/webstorage.html#dom-localstorage local storage] and [http://html.spec.whatwg.org/multipage/webstorage.html#dom-sessionstorage session storage].&lt;br /&gt;
&lt;br /&gt;
Browsers that support web storage have the global variables 'sessionStorage' and 'localStorage' declared at the [http://developer.mozilla.org/en-US/docs/Web/API/Window?redirectlocale=en-US&amp;amp;redirectslug=DOM%2Fwindow window] level. The following JavaScript code gives an example of how to use web storage:&lt;br /&gt;
&lt;br /&gt;
'''sessionStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on browser for duration of the session&lt;br /&gt;
sessionStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (gets deleted when browser is closed and re-opened)&lt;br /&gt;
alert(sessionStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''localStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on the browser beyond the duration of the session&lt;br /&gt;
localStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (persists even after closing and re-opening the browser)&lt;br /&gt;
alert(localStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
&lt;br /&gt;
As part of our [http://github.com/servo/servo/wiki/Storage-student-project project], we have to implement the web storage specification in the Servo browser. Implementing this important specification in Servo will allow stateful web applications to run, and will help expose any architectural problems that Servo's radical design may cause. &amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Requirement Analysis &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
In order to introduce the support for session storage and local storage in the Servo Browser, we have to create the Storage structure and allow web pages to store data in the Servo memory space.&lt;br /&gt;
&lt;br /&gt;
Below is a overview of the various steps identified as part of requirement analysis:&lt;br /&gt;
&lt;br /&gt;
'''Storage Interface'''&lt;br /&gt;
* We have to create the Storage interface and its stub implementation.&lt;br /&gt;
* This interface is used by the web pages to communicate to the web storage.&lt;br /&gt;
&lt;br /&gt;
'''WindowSessionStorage Interface'''&lt;br /&gt;
* We have to create the WindowSessionStorage interface which will return a Storage instance.&lt;br /&gt;
* A web page will use this interface to access its session storage.&lt;br /&gt;
&lt;br /&gt;
'''WebStorageTask'''&lt;br /&gt;
* We have to create a Storage Task which will be used to store all the web storage data.&lt;br /&gt;
* This is a separate thread which starts when browser starts.&lt;br /&gt;
* The class implementing the Storage interface uses it to store and retrieve the actual data.&lt;br /&gt;
&lt;br /&gt;
'''Communication Channel'''&lt;br /&gt;
* It provides the means to communicate to the separate thread 'WebStorageTask'.&lt;br /&gt;
* We need to define a message-passing interface for reading and writing stored data for a particular browser tab and use it in the implementation of Storage interface to communicate to WebStorageTask.&lt;br /&gt;
&lt;br /&gt;
'''Notification Event'''&lt;br /&gt;
* We need to notify the respective browser tab when the value of a stored data is changed so that other browser objects which may be using this data can take appropriate action.&lt;br /&gt;
&lt;br /&gt;
'''Web Storage Tests'''&lt;br /&gt;
* We need to pass as many [http://github.com/servo/web-platform-tests/tree/servo/webstorage tests] as possible.&lt;br /&gt;
* These tests are part of the web storage specification. Any browser implementing the web storage interface must pass as many tests as possible out of these.&lt;br /&gt;
&lt;br /&gt;
'''WindowLocalStorage Interface'''&lt;br /&gt;
* We need to implement the WindowLocalStorage interface which behaves slightly different from the WindowSessionStorage interface.&lt;br /&gt;
* This will provide the interface to access browser's local storage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
The implementation of the project was divided into the following milestones :&lt;br /&gt;
 &lt;br /&gt;
* '''Create and stub the Storage WebIDL interface defined in the spec :''' This milestone involved the initial creation of the Storage interface on which the entire project is based. The storage web idl was created as defined in the specifications : https://html.spec.whatwg.org/multipage/webstorage.html#storage-2&lt;br /&gt;
&lt;br /&gt;
* '''Create and stub the WindowSessionStorage WebIDL interface defined in the spec, making it return a Storage instance''' : Once the Storage interface was created, we had to implement the interface to actually define the functions which were a part of the interface. Here we extended the Storage interface to specialize it as Session Storage interface namely WindowSessionStorage. The methods in this interface were then further implemented in Storage.rs which was made to return a Storage instance to the web page or application requiring the support of sessionstorage.&lt;br /&gt;
&lt;br /&gt;
* '''Create a storage task (similar to the resource task) which will contain all stored data''' : The actual data is stored in a background task known as Storage Task, A task in rust terms is nothing but a thread which can run in the background keep polling until it is required, it does so by looping over a channel until a request comes its way. The Storage task contains a HashMap of TreeMap. The Hashmap is used to store the storage data for all the sites. Its keys represent the origin of the request (determined from the URL it is coming from). There is an entry in the HashMap for each different origin. The respective value represents the storage data for the site. This site specific data is stored as a TreeMap which maintains the &amp;lt;key , value&amp;gt; pair in a ordered fashion. Thus the storage task contains the actual data structure which holds all the values and the Storage.rs acts as a mediator between the object and the data stored in the task.&lt;br /&gt;
&lt;br /&gt;
* '''Define a message-passing interface for reading and writing stored data for a particular origin''': The Storage object requires a medium to delegate the functions to storage task where the actual implementation takes place. This is done using [http://doc.rust-lang.org/std/comm/fn.channel.html Channels]. There are 2 major channels. First one is the one which the storage task creates and keeps on listening for any the request. The other is when the storage object wants to get some data from the task. The Storage object creates a temporary channel on which it listens for any reply by the Storage task. This is how the message-passing interface has been implemented in the given milestone.&lt;br /&gt;
&lt;br /&gt;
* '''Store a channel to the storage task in the Page structure that sends messages from the previous interface, and make use of it in the implementation of Storage''': The storage object requires to know the channel on which the task is looping in order to send it requests for get, set or other functions. This is done by storing the channel that the storage task creates in the Page Structure which acts as a common object between these 2. Hence, by passing the created channel to the page structure it can now be accessed and utilized by the Storage object in order to delegate the methods onto the storage task and communicate.&lt;br /&gt;
&lt;br /&gt;
== Architecture &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Design&amp;lt;/ref&amp;gt;==&lt;br /&gt;
[[File:task.jpg]] &lt;br /&gt;
&lt;br /&gt;
=== Architecture Explained ===&lt;br /&gt;
*Each box represents a Rust task.&lt;br /&gt;
*Blue boxes represent the primary tasks in the browser pipeline.&lt;br /&gt;
*Gray boxes represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
*White boxes represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
*Dashed lines indicate supervisor relationships.&lt;br /&gt;
*Solid lines indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
== Component Design ==&lt;br /&gt;
[[File:servo.jpg]]&lt;br /&gt;
&lt;br /&gt;
There will be a Storage Task which will be responsible to hold all the data that the web page requests to save. This happens via Channels in Rust, which implements a Sender Receiver protocol. The task is runnning in the background and waits to receive the data sent from the web page.&lt;br /&gt;
&lt;br /&gt;
=== Task &amp;lt;ref&amp;gt;http://doc.rust-lang.org/guide-tasks.html&amp;lt;/ref&amp;gt;===&lt;br /&gt;
Rust provides safe concurrent abstractions through a number of core library primitives. This guide will describe the concurrency model in Rust, how it relates to the Rust type system, and introduce the fundamental library abstractions for constructing concurrent programs.&lt;br /&gt;
&lt;br /&gt;
Tasks provide failure isolation and recovery. When a fatal error occurs in Rust code as a result of an explicit call to panic!(), an assertion failure, or another invalid operation, the runtime system destroys the entire task. Unlike in languages such as Java and C++, there is no way to catch an exception. Instead, tasks may monitor each other to see if they panic.&lt;br /&gt;
&lt;br /&gt;
Tasks use Rust's type system to provide strong memory safety guarantees. In particular, the type system guarantees that tasks cannot induce a data race from shared mutable state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Generate some state locally&lt;br /&gt;
let child_task_number = generate_task_number();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    // Capture it in the remote task&lt;br /&gt;
    println!(&amp;quot;I am child number {}&amp;quot;, child_task_number);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Channel &amp;lt;ref&amp;gt;http://doc.rust-lang.org/guide-tasks.html&amp;lt;/ref&amp;gt;===&lt;br /&gt;
Now that we have spawned a new task, it would be nice if we could communicate with it. For this, we use channels. A channel is simply a pair of endpoints: one for sending messages and another for receiving messages.&lt;br /&gt;
&lt;br /&gt;
The simplest way to create a channel is to use the channel function to create a (Sender, Receiver) pair. In Rust parlance, a sender is a sending endpoint of a channel, and a receiver is the receiving endpoint. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
let (tx, rx): (Sender&amp;lt;int&amp;gt;, Receiver&amp;lt;int&amp;gt;) = channel();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    let result = some_expensive_computation();&lt;br /&gt;
    tx.send(result);&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
some_other_expensive_computation();&lt;br /&gt;
let result = rx.recv();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Data Design ==&lt;br /&gt;
&lt;br /&gt;
===  Data Description ===&lt;br /&gt;
&lt;br /&gt;
''The following are the data structures that will be used.''&lt;br /&gt;
&lt;br /&gt;
'''Storage''' | TreeMap&amp;lt;String,String&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''UrlMap''' | TreeMap&amp;lt;String,TreeMap&amp;lt;String,String&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Pattern ==&lt;br /&gt;
&lt;br /&gt;
We will be using '''&amp;quot;Delegation Pattern&amp;quot;''' in our project. The Storage interface is used by web applications to access the web storage provided by the browser. However, the actual data is stored somewhere else(Servo Memory Space). So, it makes sense to create another class which will maintain the actual stored data. The Storage class can then delegate the task of storing/retrieving data to this class. We will create a class &amp;quot;WebStorageTask&amp;quot; for this purpose.&lt;br /&gt;
&lt;br /&gt;
Also we are using an '''&amp;quot;Observer Pattern&amp;quot;''' where the Storage task will run in the background and observe the commands issued using a channel, it will keep listening to changes on a port and as soon as it receives a message i.e. sees a call towards it , it will perform the required function.&lt;br /&gt;
&lt;br /&gt;
== UML Diagrams ==&lt;br /&gt;
&lt;br /&gt;
=== Flow Chart ===&lt;br /&gt;
[[File:Flow_Chart_Storage.png]]&lt;br /&gt;
&lt;br /&gt;
1. First, we need to build rust and servo. &amp;lt;br/&amp;gt;&lt;br /&gt;
2. Generate the corresponding WebIDL bindings - Storage.webidl &amp;lt;br/&amp;gt;&lt;br /&gt;
3. Define Storage.rs which has the actual code for creating the storage object. &amp;lt;br/&amp;gt;&lt;br /&gt;
4. Call the receiver via a channel- this is actually used for creating an instance for each unique URL. &amp;lt;br/&amp;gt;&lt;br /&gt;
5. Build the servo again. &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Use Case Diagram ===&lt;br /&gt;
[[File:Use_Case_-_Storage.png‎]]&lt;br /&gt;
&lt;br /&gt;
1. Here the user can open multiple domains( multiple URL's).&amp;lt;br/&amp;gt;&lt;br /&gt;
2. Thereby the user will be creating multiple storage instances.&amp;lt;br/&amp;gt;&lt;br /&gt;
3. An user can traverse deep into the website but the storage instance is same for that URL.&amp;lt;br/&amp;gt;&lt;br /&gt;
4. The user can reopen the domain for a later period.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Proposed Test Cases ==&lt;br /&gt;
&lt;br /&gt;
Some of the test cases which will be used to validate our changes are as follows:&lt;br /&gt;
&lt;br /&gt;
* Allow a web page to clear its session storage ''i.e. storage.clear() function should work''&lt;br /&gt;
* Allow a web page to store an item in its session storage ''i.e. test storage.setitem(key,value)''&lt;br /&gt;
* Allow a web page to retrieve stored items from its session storage ''i.e. test storage.getitem(key)''&lt;br /&gt;
* Do not allow a web page to retrieve stored items from the session storage of a web page in another domain ''i.e. try to access elements by forging url&lt;br /&gt;
* Check the number of items stored in session storage i.e storage.count()''&lt;br /&gt;
* On removing an item from storage, it should be inaccessible ''i.e check if storage.remove(key) is functional''&lt;br /&gt;
* Should return null as value for a key not present in the session storage ''i.e. test storage.getitem(key) for non-existent key''&lt;br /&gt;
* Should give an error on exceeding the space limit of session storage ''i.e check for available memory on each command'' &lt;br /&gt;
&lt;br /&gt;
The complete list of test cases can be found [http://github.com/servo/web-platform-tests/tree/servo/webstorage here].&lt;br /&gt;
&lt;br /&gt;
== Further Readings ==&lt;br /&gt;
&lt;br /&gt;
Learning Rust by Examples: http://rustbyexample.com/ &amp;lt;br/&amp;gt;&lt;br /&gt;
Javascript as Servo's Garbage Collector: http://blog.mozilla.org/research/2014/08/26/javascript-servos-only-garbage-collector/  &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92152</id>
		<title>CSC/ECE 517 Fall 2014/final design doc M1450 navr</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92152"/>
		<updated>2014-11-18T04:55:39Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: /* UML Diagrams */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implement Window.sessionStorage ==&lt;br /&gt;
&lt;br /&gt;
This is the design document for the task &amp;lt;code&amp;gt;[http://github.com/servo/servo/wiki/Storage-student-project Implement Window.sessionStorage]&amp;lt;/code&amp;gt; for the [http://www.mozilla.org/ Mozilla] research project [http://github.com/servo/servo/wiki/Design Servo].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== [http://www.rust-lang.org/ Rust]===&lt;br /&gt;
&lt;br /&gt;
Rust is a modern systems programming language focusing on safety and speed to build reliable and efficient systems &amp;lt;ref&amp;gt; http://doc.rust-lang.org/nightly/intro.html &amp;lt;/ref&amp;gt;. It accomplishes the goals of memory safe without using garbage collection and it supports concurrency and parallelism in building platforms. &lt;br /&gt;
&lt;br /&gt;
Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://github.com/servo/servo/wiki/Design Servo] ===&lt;br /&gt;
&lt;br /&gt;
Mozilla Research team is currently working on an experimental project to develop a new Web browser engine &amp;quot;Servo&amp;quot;, that is capable of supporting a variety of current and next generation of hardware like mobile devices, multi-core processors and high-performance GPUs. Servo builds on top of Rust to provide a secure and reliable foundation. It is currently developed on 64 bit devices.&amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main objectives of this experimentation project is improving the layout to graphics rendering - to optimize for power efficiency and maximize parallelism. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
=== [http://html.spec.whatwg.org/multipage/webstorage.html#webstorage Web Storage] ===&lt;br /&gt;
The web storage specification defines the means by which a web application can store string key/value pairs in a browser and later retrieve them for use.&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage&amp;lt;/ref&amp;gt; It supports persistent data storage, similar to [http://en.wikipedia.org/wiki/HTTP_cookie cookies] but with a greatly enhanced capacity and no information stored in the [http://en.wikipedia.org/wiki/List_of_HTTP_headers HTTP request header].&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Web_storage&amp;lt;/ref&amp;gt; There are two types of web storage: [http://html.spec.whatwg.org/multipage/webstorage.html#dom-localstorage local storage] and [http://html.spec.whatwg.org/multipage/webstorage.html#dom-sessionstorage session storage].&lt;br /&gt;
&lt;br /&gt;
Browsers that support web storage have the global variables 'sessionStorage' and 'localStorage' declared at the [http://developer.mozilla.org/en-US/docs/Web/API/Window?redirectlocale=en-US&amp;amp;redirectslug=DOM%2Fwindow window] level. The following JavaScript code gives an example of how to use web storage:&lt;br /&gt;
&lt;br /&gt;
'''sessionStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on browser for duration of the session&lt;br /&gt;
sessionStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (gets deleted when browser is closed and re-opened)&lt;br /&gt;
alert(sessionStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''localStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on the browser beyond the duration of the session&lt;br /&gt;
localStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (persists even after closing and re-opening the browser)&lt;br /&gt;
alert(localStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
&lt;br /&gt;
As part of our [http://github.com/servo/servo/wiki/Storage-student-project project], we have to implement the web storage specification in the Servo browser. Implementing this important specification in Servo will allow stateful web applications to run, and will help expose any architectural problems that Servo's radical design may cause. &amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Requirement Analysis &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
In order to introduce the support for session storage and local storage in the Servo Browser, we have to create the Storage structure and allow web pages to store data in the Servo memory space.&lt;br /&gt;
&lt;br /&gt;
Below is a overview of the various steps identified as part of requirement analysis:&lt;br /&gt;
&lt;br /&gt;
'''Storage Interface'''&lt;br /&gt;
* We have to create the Storage interface and its stub implementation.&lt;br /&gt;
* This interface is used by the web pages to communicate to the web storage.&lt;br /&gt;
&lt;br /&gt;
'''WindowSessionStorage Interface'''&lt;br /&gt;
* We have to create the WindowSessionStorage interface which will return a Storage instance.&lt;br /&gt;
* A web page will use this interface to access its session storage.&lt;br /&gt;
&lt;br /&gt;
'''WebStorageTask'''&lt;br /&gt;
* We have to create a Storage Task which will be used to store all the web storage data.&lt;br /&gt;
* This is a separate thread which starts when browser starts.&lt;br /&gt;
* The class implementing the Storage interface uses it to store and retrieve the actual data.&lt;br /&gt;
&lt;br /&gt;
'''Communication Channel'''&lt;br /&gt;
* It provides the means to communicate to the separate thread 'WebStorageTask'.&lt;br /&gt;
* We need to define a message-passing interface for reading and writing stored data for a particular browser tab and use it in the implementation of Storage interface to communicate to WebStorageTask.&lt;br /&gt;
&lt;br /&gt;
'''Notification Event'''&lt;br /&gt;
* We need to notify the respective browser tab when the value of a stored data is changed so that other browser objects which may be using this data can take appropriate action.&lt;br /&gt;
&lt;br /&gt;
'''Web Storage Tests'''&lt;br /&gt;
* We need to pass as many [http://github.com/servo/web-platform-tests/tree/servo/webstorage tests] as possible.&lt;br /&gt;
* These tests are part of the web storage specification. Any browser implementing the web storage interface must pass as many tests as possible out of these.&lt;br /&gt;
&lt;br /&gt;
'''WindowLocalStorage Interface'''&lt;br /&gt;
* We need to implement the WindowLocalStorage interface which behaves slightly different from the WindowSessionStorage interface.&lt;br /&gt;
* This will provide the interface to access browser's local storage.&lt;br /&gt;
&lt;br /&gt;
== Architecture &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Design&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
[[File:task.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Architecture Explained ===&lt;br /&gt;
*Each box represents a Rust task.&lt;br /&gt;
*Blue boxes represent the primary tasks in the browser pipeline.&lt;br /&gt;
*Gray boxes represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
*White boxes represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
*Dashed lines indicate supervisor relationships.&lt;br /&gt;
*Solid lines indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
== Component Design ==&lt;br /&gt;
[[File:servo.jpg]]&lt;br /&gt;
&lt;br /&gt;
There will be a Storage Task which will be responsible to hold all the data that the web page requests to save. This happens via Channels in Rust, which implements a Sender Receiver protocol. The task is runnning in the background and waits to receive the data sent from the web page.&lt;br /&gt;
&lt;br /&gt;
=== Task &amp;lt;ref&amp;gt;http://doc.rust-lang.org/guide-tasks.html&amp;lt;/ref&amp;gt;===&lt;br /&gt;
Rust provides safe concurrent abstractions through a number of core library primitives. This guide will describe the concurrency model in Rust, how it relates to the Rust type system, and introduce the fundamental library abstractions for constructing concurrent programs.&lt;br /&gt;
&lt;br /&gt;
Tasks provide failure isolation and recovery. When a fatal error occurs in Rust code as a result of an explicit call to panic!(), an assertion failure, or another invalid operation, the runtime system destroys the entire task. Unlike in languages such as Java and C++, there is no way to catch an exception. Instead, tasks may monitor each other to see if they panic.&lt;br /&gt;
&lt;br /&gt;
Tasks use Rust's type system to provide strong memory safety guarantees. In particular, the type system guarantees that tasks cannot induce a data race from shared mutable state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Generate some state locally&lt;br /&gt;
let child_task_number = generate_task_number();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    // Capture it in the remote task&lt;br /&gt;
    println!(&amp;quot;I am child number {}&amp;quot;, child_task_number);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Channel &amp;lt;ref&amp;gt;http://doc.rust-lang.org/guide-tasks.html&amp;lt;/ref&amp;gt;===&lt;br /&gt;
Now that we have spawned a new task, it would be nice if we could communicate with it. For this, we use channels. A channel is simply a pair of endpoints: one for sending messages and another for receiving messages.&lt;br /&gt;
&lt;br /&gt;
The simplest way to create a channel is to use the channel function to create a (Sender, Receiver) pair. In Rust parlance, a sender is a sending endpoint of a channel, and a receiver is the receiving endpoint. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
let (tx, rx): (Sender&amp;lt;int&amp;gt;, Receiver&amp;lt;int&amp;gt;) = channel();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    let result = some_expensive_computation();&lt;br /&gt;
    tx.send(result);&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
some_other_expensive_computation();&lt;br /&gt;
let result = rx.recv();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Data Design ==&lt;br /&gt;
&lt;br /&gt;
===  Data Description ===&lt;br /&gt;
&lt;br /&gt;
''The following are the data structures that will be used.''&lt;br /&gt;
&lt;br /&gt;
'''Storage''' | TreeMap&amp;lt;String,String&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''UrlMap''' | TreeMap&amp;lt;String,TreeMap&amp;lt;String,String&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Pattern ==&lt;br /&gt;
&lt;br /&gt;
We will be using '''&amp;quot;Delegation Pattern&amp;quot;''' in our project. The Storage interface is used by web applications to access the web storage provided by the browser. However, the actual data is stored somewhere else(Servo Memory Space). So, it makes sense to create another class which will maintain the actual stored data. The Storage class can then delegate the task of storing/retrieving data to this class. We will create a class &amp;quot;WebStorageTask&amp;quot; for this purpose.&lt;br /&gt;
&lt;br /&gt;
Also we are using an '''&amp;quot;Observer Pattern&amp;quot;''' where the Storage task will run in the background and observe the commands issued using a channel, it will keep listening to changes on a port and as soon as it receives a message i.e. sees a call towards it , it will perform the required function.&lt;br /&gt;
&lt;br /&gt;
== UML Diagrams ==&lt;br /&gt;
&lt;br /&gt;
=== Flow Chart ===&lt;br /&gt;
[[File:Flow_Chart_Storage.png]]&lt;br /&gt;
&lt;br /&gt;
1. First, we need to build rust and servo. &amp;lt;br/&amp;gt;&lt;br /&gt;
2. Generate the corresponding WebIDL bindings - Storage.webidl &amp;lt;br/&amp;gt;&lt;br /&gt;
3. Define Storage.rs which has the actual code for creating the storage object. &amp;lt;br/&amp;gt;&lt;br /&gt;
4. Call the receiver via a channel- this is actually used for creating an instance for each unique URL. &amp;lt;br/&amp;gt;&lt;br /&gt;
5. Build the servo again. &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Use Case Diagram ===&lt;br /&gt;
[[File:Use_Case_-_Storage.png‎]]&lt;br /&gt;
&lt;br /&gt;
1. Here the user can open multiple domains( multiple URL's).&amp;lt;br/&amp;gt;&lt;br /&gt;
2. Thereby the user will be creating multiple storage instances.&amp;lt;br/&amp;gt;&lt;br /&gt;
3. An user can traverse deep into the website but the storage instance is same for that URL.&amp;lt;br/&amp;gt;&lt;br /&gt;
4. The user can reopen the domain for a later period.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Proposed Test Cases ==&lt;br /&gt;
&lt;br /&gt;
Some of the test cases which will be used to validate our changes are as follows:&lt;br /&gt;
&lt;br /&gt;
* Allow a web page to clear its session storage ''i.e. storage.clear() function should work''&lt;br /&gt;
* Allow a web page to store an item in its session storage ''i.e. test storage.setitem(key,value)''&lt;br /&gt;
* Allow a web page to retrieve stored items from its session storage ''i.e. test storage.getitem(key)''&lt;br /&gt;
* Do not allow a web page to retrieve stored items from the session storage of a web page in another domain ''i.e. try to access elements by forging url&lt;br /&gt;
* Check the number of items stored in session storage i.e storage.count()''&lt;br /&gt;
* On removing an item from storage, it should be inaccessible ''i.e check if storage.remove(key) is functional''&lt;br /&gt;
* Should return null as value for a key not present in the session storage ''i.e. test storage.getitem(key) for non-existent key''&lt;br /&gt;
* Should give an error on exceeding the space limit of session storage ''i.e check for available memory on each command'' &lt;br /&gt;
&lt;br /&gt;
The complete list of test cases can be found [http://github.com/servo/web-platform-tests/tree/servo/webstorage here].&lt;br /&gt;
&lt;br /&gt;
== Further Readings ==&lt;br /&gt;
&lt;br /&gt;
Learning Rust by Examples: http://rustbyexample.com/ &amp;lt;br/&amp;gt;&lt;br /&gt;
Javascript as Servo's Garbage Collector: http://blog.mozilla.org/research/2014/08/26/javascript-servos-only-garbage-collector/  &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92151</id>
		<title>CSC/ECE 517 Fall 2014/final design doc M1450 navr</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92151"/>
		<updated>2014-11-18T04:48:14Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: /* Requirement Analysis https://github.com/servo/servo/wiki/Storage-student-project */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implement Window.sessionStorage ==&lt;br /&gt;
&lt;br /&gt;
This is the design document for the task &amp;lt;code&amp;gt;[http://github.com/servo/servo/wiki/Storage-student-project Implement Window.sessionStorage]&amp;lt;/code&amp;gt; for the [http://www.mozilla.org/ Mozilla] research project [http://github.com/servo/servo/wiki/Design Servo].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== [http://www.rust-lang.org/ Rust]===&lt;br /&gt;
&lt;br /&gt;
Rust is a modern systems programming language focusing on safety and speed to build reliable and efficient systems &amp;lt;ref&amp;gt; http://doc.rust-lang.org/nightly/intro.html &amp;lt;/ref&amp;gt;. It accomplishes the goals of memory safe without using garbage collection and it supports concurrency and parallelism in building platforms. &lt;br /&gt;
&lt;br /&gt;
Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://github.com/servo/servo/wiki/Design Servo] ===&lt;br /&gt;
&lt;br /&gt;
Mozilla Research team is currently working on an experimental project to develop a new Web browser engine &amp;quot;Servo&amp;quot;, that is capable of supporting a variety of current and next generation of hardware like mobile devices, multi-core processors and high-performance GPUs. Servo builds on top of Rust to provide a secure and reliable foundation. It is currently developed on 64 bit devices.&amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main objectives of this experimentation project is improving the layout to graphics rendering - to optimize for power efficiency and maximize parallelism. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
=== [http://html.spec.whatwg.org/multipage/webstorage.html#webstorage Web Storage] ===&lt;br /&gt;
The web storage specification defines the means by which a web application can store string key/value pairs in a browser and later retrieve them for use.&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage&amp;lt;/ref&amp;gt; It supports persistent data storage, similar to [http://en.wikipedia.org/wiki/HTTP_cookie cookies] but with a greatly enhanced capacity and no information stored in the [http://en.wikipedia.org/wiki/List_of_HTTP_headers HTTP request header].&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Web_storage&amp;lt;/ref&amp;gt; There are two types of web storage: [http://html.spec.whatwg.org/multipage/webstorage.html#dom-localstorage local storage] and [http://html.spec.whatwg.org/multipage/webstorage.html#dom-sessionstorage session storage].&lt;br /&gt;
&lt;br /&gt;
Browsers that support web storage have the global variables 'sessionStorage' and 'localStorage' declared at the [http://developer.mozilla.org/en-US/docs/Web/API/Window?redirectlocale=en-US&amp;amp;redirectslug=DOM%2Fwindow window] level. The following JavaScript code gives an example of how to use web storage:&lt;br /&gt;
&lt;br /&gt;
'''sessionStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on browser for duration of the session&lt;br /&gt;
sessionStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (gets deleted when browser is closed and re-opened)&lt;br /&gt;
alert(sessionStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''localStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on the browser beyond the duration of the session&lt;br /&gt;
localStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (persists even after closing and re-opening the browser)&lt;br /&gt;
alert(localStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
&lt;br /&gt;
As part of our [http://github.com/servo/servo/wiki/Storage-student-project project], we have to implement the web storage specification in the Servo browser. Implementing this important specification in Servo will allow stateful web applications to run, and will help expose any architectural problems that Servo's radical design may cause. &amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Requirement Analysis &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
In order to introduce the support for session storage and local storage in the Servo Browser, we have to create the Storage structure and allow web pages to store data in the Servo memory space.&lt;br /&gt;
&lt;br /&gt;
Below is a overview of the various steps identified as part of requirement analysis:&lt;br /&gt;
&lt;br /&gt;
'''Storage Interface'''&lt;br /&gt;
* We have to create the Storage interface and its stub implementation.&lt;br /&gt;
* This interface is used by the web pages to communicate to the web storage.&lt;br /&gt;
&lt;br /&gt;
'''WindowSessionStorage Interface'''&lt;br /&gt;
* We have to create the WindowSessionStorage interface which will return a Storage instance.&lt;br /&gt;
* A web page will use this interface to access its session storage.&lt;br /&gt;
&lt;br /&gt;
'''WebStorageTask'''&lt;br /&gt;
* We have to create a Storage Task which will be used to store all the web storage data.&lt;br /&gt;
* This is a separate thread which starts when browser starts.&lt;br /&gt;
* The class implementing the Storage interface uses it to store and retrieve the actual data.&lt;br /&gt;
&lt;br /&gt;
'''Communication Channel'''&lt;br /&gt;
* It provides the means to communicate to the separate thread 'WebStorageTask'.&lt;br /&gt;
* We need to define a message-passing interface for reading and writing stored data for a particular browser tab and use it in the implementation of Storage interface to communicate to WebStorageTask.&lt;br /&gt;
&lt;br /&gt;
'''Notification Event'''&lt;br /&gt;
* We need to notify the respective browser tab when the value of a stored data is changed so that other browser objects which may be using this data can take appropriate action.&lt;br /&gt;
&lt;br /&gt;
'''Web Storage Tests'''&lt;br /&gt;
* We need to pass as many [http://github.com/servo/web-platform-tests/tree/servo/webstorage tests] as possible.&lt;br /&gt;
* These tests are part of the web storage specification. Any browser implementing the web storage interface must pass as many tests as possible out of these.&lt;br /&gt;
&lt;br /&gt;
'''WindowLocalStorage Interface'''&lt;br /&gt;
* We need to implement the WindowLocalStorage interface which behaves slightly different from the WindowSessionStorage interface.&lt;br /&gt;
* This will provide the interface to access browser's local storage.&lt;br /&gt;
&lt;br /&gt;
== Architecture &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Design&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
[[File:task.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Architecture Explained ===&lt;br /&gt;
*Each box represents a Rust task.&lt;br /&gt;
*Blue boxes represent the primary tasks in the browser pipeline.&lt;br /&gt;
*Gray boxes represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
*White boxes represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
*Dashed lines indicate supervisor relationships.&lt;br /&gt;
*Solid lines indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
== Component Design ==&lt;br /&gt;
[[File:servo.jpg]]&lt;br /&gt;
&lt;br /&gt;
There will be a Storage Task which will be responsible to hold all the data that the web page requests to save. This happens via Channels in Rust, which implements a Sender Receiver protocol. The task is runnning in the background and waits to receive the data sent from the web page.&lt;br /&gt;
&lt;br /&gt;
=== Task &amp;lt;ref&amp;gt;http://doc.rust-lang.org/guide-tasks.html&amp;lt;/ref&amp;gt;===&lt;br /&gt;
Rust provides safe concurrent abstractions through a number of core library primitives. This guide will describe the concurrency model in Rust, how it relates to the Rust type system, and introduce the fundamental library abstractions for constructing concurrent programs.&lt;br /&gt;
&lt;br /&gt;
Tasks provide failure isolation and recovery. When a fatal error occurs in Rust code as a result of an explicit call to panic!(), an assertion failure, or another invalid operation, the runtime system destroys the entire task. Unlike in languages such as Java and C++, there is no way to catch an exception. Instead, tasks may monitor each other to see if they panic.&lt;br /&gt;
&lt;br /&gt;
Tasks use Rust's type system to provide strong memory safety guarantees. In particular, the type system guarantees that tasks cannot induce a data race from shared mutable state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Generate some state locally&lt;br /&gt;
let child_task_number = generate_task_number();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    // Capture it in the remote task&lt;br /&gt;
    println!(&amp;quot;I am child number {}&amp;quot;, child_task_number);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Channel &amp;lt;ref&amp;gt;http://doc.rust-lang.org/guide-tasks.html&amp;lt;/ref&amp;gt;===&lt;br /&gt;
Now that we have spawned a new task, it would be nice if we could communicate with it. For this, we use channels. A channel is simply a pair of endpoints: one for sending messages and another for receiving messages.&lt;br /&gt;
&lt;br /&gt;
The simplest way to create a channel is to use the channel function to create a (Sender, Receiver) pair. In Rust parlance, a sender is a sending endpoint of a channel, and a receiver is the receiving endpoint. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
let (tx, rx): (Sender&amp;lt;int&amp;gt;, Receiver&amp;lt;int&amp;gt;) = channel();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    let result = some_expensive_computation();&lt;br /&gt;
    tx.send(result);&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
some_other_expensive_computation();&lt;br /&gt;
let result = rx.recv();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Data Design ==&lt;br /&gt;
&lt;br /&gt;
===  Data Description ===&lt;br /&gt;
&lt;br /&gt;
''The following are the data structures that will be used.''&lt;br /&gt;
&lt;br /&gt;
'''Storage''' | TreeMap&amp;lt;String,String&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''UrlMap''' | TreeMap&amp;lt;String,TreeMap&amp;lt;String,String&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Pattern ==&lt;br /&gt;
&lt;br /&gt;
We will be using '''&amp;quot;Delegation Pattern&amp;quot;''' in our project. The Storage interface is used by web applications to access the web storage provided by the browser. However, the actual data is stored somewhere else(Servo Memory Space). So, it makes sense to create another class which will maintain the actual stored data. The Storage class can then delegate the task of storing/retrieving data to this class. We will create a class &amp;quot;WebStorageTask&amp;quot; for this purpose.&lt;br /&gt;
&lt;br /&gt;
Also we are using an '''&amp;quot;Observer Pattern&amp;quot;''' where the Storage task will run in the background and observe the commands issued using a channel, it will keep listening to changes on a port and as soon as it receives a message i.e. sees a call towards it , it will perform the required function.&lt;br /&gt;
&lt;br /&gt;
== UML Diagrams ==&lt;br /&gt;
             &lt;br /&gt;
[[File:Flow_Chart_Storage.png|left]] &lt;br /&gt;
[[File:Use_Case_-_Storage.png‎|right]]&lt;br /&gt;
&lt;br /&gt;
'''Steps:'''&lt;br /&gt;
&lt;br /&gt;
1. First, we need to build rust and servo. &amp;lt;br/&amp;gt;&lt;br /&gt;
2. Generate the corresponding WebIDL bindings - Storage.webidl &amp;lt;br/&amp;gt;&lt;br /&gt;
3. Define Storage.rs which has the actual code for creating the storage object. &amp;lt;br/&amp;gt;&lt;br /&gt;
4. Call the receiver via a channel- this is actually used for creating an instance for each unique URL. &amp;lt;br/&amp;gt;&lt;br /&gt;
5. Build the servo again. &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Use Case Functionality'''&lt;br /&gt;
&lt;br /&gt;
1. Here the user can open multiple domains( multiple URL's).&amp;lt;br/&amp;gt;&lt;br /&gt;
2. Thereby the user will be creating multiple storage instances.&amp;lt;br/&amp;gt;&lt;br /&gt;
3. An user can traverse deep into the website but the storage instance is same for that URL.&amp;lt;br/&amp;gt;&lt;br /&gt;
4. The user can reopen the domain for a later period.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Proposed Test Cases ==&lt;br /&gt;
&lt;br /&gt;
Some of the test cases which will be used to validate our changes are as follows:&lt;br /&gt;
&lt;br /&gt;
* Allow a web page to clear its session storage ''i.e. storage.clear() function should work''&lt;br /&gt;
* Allow a web page to store an item in its session storage ''i.e. test storage.setitem(key,value)''&lt;br /&gt;
* Allow a web page to retrieve stored items from its session storage ''i.e. test storage.getitem(key)''&lt;br /&gt;
* Do not allow a web page to retrieve stored items from the session storage of a web page in another domain ''i.e. try to access elements by forging url&lt;br /&gt;
* Check the number of items stored in session storage i.e storage.count()''&lt;br /&gt;
* On removing an item from storage, it should be inaccessible ''i.e check if storage.remove(key) is functional''&lt;br /&gt;
* Should return null as value for a key not present in the session storage ''i.e. test storage.getitem(key) for non-existent key''&lt;br /&gt;
* Should give an error on exceeding the space limit of session storage ''i.e check for available memory on each command'' &lt;br /&gt;
&lt;br /&gt;
The complete list of test cases can be found [http://github.com/servo/web-platform-tests/tree/servo/webstorage here].&lt;br /&gt;
&lt;br /&gt;
== Further Readings ==&lt;br /&gt;
&lt;br /&gt;
Learning Rust by Examples: http://rustbyexample.com/ &amp;lt;br/&amp;gt;&lt;br /&gt;
Javascript as Servo's Garbage Collector: http://blog.mozilla.org/research/2014/08/26/javascript-servos-only-garbage-collector/  &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92150</id>
		<title>CSC/ECE 517 Fall 2014/final design doc M1450 navr</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92150"/>
		<updated>2014-11-18T04:46:27Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: /* Requirement Analysis https://github.com/servo/servo/wiki/Storage-student-project */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implement Window.sessionStorage ==&lt;br /&gt;
&lt;br /&gt;
This is the design document for the task &amp;lt;code&amp;gt;[http://github.com/servo/servo/wiki/Storage-student-project Implement Window.sessionStorage]&amp;lt;/code&amp;gt; for the [http://www.mozilla.org/ Mozilla] research project [http://github.com/servo/servo/wiki/Design Servo].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== [http://www.rust-lang.org/ Rust]===&lt;br /&gt;
&lt;br /&gt;
Rust is a modern systems programming language focusing on safety and speed to build reliable and efficient systems &amp;lt;ref&amp;gt; http://doc.rust-lang.org/nightly/intro.html &amp;lt;/ref&amp;gt;. It accomplishes the goals of memory safe without using garbage collection and it supports concurrency and parallelism in building platforms. &lt;br /&gt;
&lt;br /&gt;
Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://github.com/servo/servo/wiki/Design Servo] ===&lt;br /&gt;
&lt;br /&gt;
Mozilla Research team is currently working on an experimental project to develop a new Web browser engine &amp;quot;Servo&amp;quot;, that is capable of supporting a variety of current and next generation of hardware like mobile devices, multi-core processors and high-performance GPUs. Servo builds on top of Rust to provide a secure and reliable foundation. It is currently developed on 64 bit devices.&amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main objectives of this experimentation project is improving the layout to graphics rendering - to optimize for power efficiency and maximize parallelism. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
=== [http://html.spec.whatwg.org/multipage/webstorage.html#webstorage Web Storage] ===&lt;br /&gt;
The web storage specification defines the means by which a web application can store string key/value pairs in a browser and later retrieve them for use.&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage&amp;lt;/ref&amp;gt; It supports persistent data storage, similar to [http://en.wikipedia.org/wiki/HTTP_cookie cookies] but with a greatly enhanced capacity and no information stored in the [http://en.wikipedia.org/wiki/List_of_HTTP_headers HTTP request header].&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Web_storage&amp;lt;/ref&amp;gt; There are two types of web storage: [http://html.spec.whatwg.org/multipage/webstorage.html#dom-localstorage local storage] and [http://html.spec.whatwg.org/multipage/webstorage.html#dom-sessionstorage session storage].&lt;br /&gt;
&lt;br /&gt;
Browsers that support web storage have the global variables 'sessionStorage' and 'localStorage' declared at the [http://developer.mozilla.org/en-US/docs/Web/API/Window?redirectlocale=en-US&amp;amp;redirectslug=DOM%2Fwindow window] level. The following JavaScript code gives an example of how to use web storage:&lt;br /&gt;
&lt;br /&gt;
'''sessionStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on browser for duration of the session&lt;br /&gt;
sessionStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (gets deleted when browser is closed and re-opened)&lt;br /&gt;
alert(sessionStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''localStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on the browser beyond the duration of the session&lt;br /&gt;
localStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (persists even after closing and re-opening the browser)&lt;br /&gt;
alert(localStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
&lt;br /&gt;
As part of our [http://github.com/servo/servo/wiki/Storage-student-project project], we have to implement the web storage specification in the Servo browser. Implementing this important specification in Servo will allow stateful web applications to run, and will help expose any architectural problems that Servo's radical design may cause. &amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Requirement Analysis &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
In order to introduce the support for session storage and local storage in the Servo Browser, we have to create the Storage structure and allow web pages to store data in the Servo memory space.&lt;br /&gt;
&lt;br /&gt;
Below is a overview of the various steps identified as part of requirement analysis:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Storage Interface'''&lt;br /&gt;
* We have to create the Storage interface and its stub implementation.&lt;br /&gt;
* This interface is used by the web pages to communicate to the web storage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''WindowSessionStorage Interface'''&lt;br /&gt;
* We have to create the WindowSessionStorage interface which will return a Storage instance.&lt;br /&gt;
* A web page will use this interface to access its session storage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''WebStorageTask'''&lt;br /&gt;
* We have to create a Storage Task which will be used to store all the web storage data.&lt;br /&gt;
* This is a separate thread which starts when browser starts.&lt;br /&gt;
* The class implementing the Storage interface uses it to store and retrieve the actual data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Communication Channel'''&lt;br /&gt;
* It provides the means to communicate to the separate thread 'WebStorageTask'.&lt;br /&gt;
* We need to define a message-passing interface for reading and writing stored data for a particular browser tab and use it in the implementation of Storage interface to communicate to WebStorageTask.&lt;br /&gt;
&lt;br /&gt;
'''Notification Event'''&lt;br /&gt;
* We need to notify the respective browser tab when the value of a stored data is changed so that other browser objects which may be using this data can take appropriate action.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Web Storage Tests'''&lt;br /&gt;
* We need to pass as many [http://github.com/servo/web-platform-tests/tree/servo/webstorage tests] as possible.&lt;br /&gt;
* These tests are part of the web storage specification. Any browser implementing the web storage interface must pass as many tests as possible out of these.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''WindowLocalStorage Interface'''&lt;br /&gt;
* We need to implement the WindowLocalStorage interface which behaves slightly different from the WindowSessionStorage interface.&lt;br /&gt;
* This will provide the interface to access browser's local storage.&lt;br /&gt;
&lt;br /&gt;
== Architecture &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Design&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
[[File:task.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Architecture Explained ===&lt;br /&gt;
*Each box represents a Rust task.&lt;br /&gt;
*Blue boxes represent the primary tasks in the browser pipeline.&lt;br /&gt;
*Gray boxes represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
*White boxes represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
*Dashed lines indicate supervisor relationships.&lt;br /&gt;
*Solid lines indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
== Component Design ==&lt;br /&gt;
[[File:servo.jpg]]&lt;br /&gt;
&lt;br /&gt;
There will be a Storage Task which will be responsible to hold all the data that the web page requests to save. This happens via Channels in Rust, which implements a Sender Receiver protocol. The task is runnning in the background and waits to receive the data sent from the web page.&lt;br /&gt;
&lt;br /&gt;
=== Task &amp;lt;ref&amp;gt;http://doc.rust-lang.org/guide-tasks.html&amp;lt;/ref&amp;gt;===&lt;br /&gt;
Rust provides safe concurrent abstractions through a number of core library primitives. This guide will describe the concurrency model in Rust, how it relates to the Rust type system, and introduce the fundamental library abstractions for constructing concurrent programs.&lt;br /&gt;
&lt;br /&gt;
Tasks provide failure isolation and recovery. When a fatal error occurs in Rust code as a result of an explicit call to panic!(), an assertion failure, or another invalid operation, the runtime system destroys the entire task. Unlike in languages such as Java and C++, there is no way to catch an exception. Instead, tasks may monitor each other to see if they panic.&lt;br /&gt;
&lt;br /&gt;
Tasks use Rust's type system to provide strong memory safety guarantees. In particular, the type system guarantees that tasks cannot induce a data race from shared mutable state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Generate some state locally&lt;br /&gt;
let child_task_number = generate_task_number();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    // Capture it in the remote task&lt;br /&gt;
    println!(&amp;quot;I am child number {}&amp;quot;, child_task_number);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Channel &amp;lt;ref&amp;gt;http://doc.rust-lang.org/guide-tasks.html&amp;lt;/ref&amp;gt;===&lt;br /&gt;
Now that we have spawned a new task, it would be nice if we could communicate with it. For this, we use channels. A channel is simply a pair of endpoints: one for sending messages and another for receiving messages.&lt;br /&gt;
&lt;br /&gt;
The simplest way to create a channel is to use the channel function to create a (Sender, Receiver) pair. In Rust parlance, a sender is a sending endpoint of a channel, and a receiver is the receiving endpoint. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
let (tx, rx): (Sender&amp;lt;int&amp;gt;, Receiver&amp;lt;int&amp;gt;) = channel();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    let result = some_expensive_computation();&lt;br /&gt;
    tx.send(result);&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
some_other_expensive_computation();&lt;br /&gt;
let result = rx.recv();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Data Design ==&lt;br /&gt;
&lt;br /&gt;
===  Data Description ===&lt;br /&gt;
&lt;br /&gt;
''The following are the data structures that will be used.''&lt;br /&gt;
&lt;br /&gt;
'''Storage''' | TreeMap&amp;lt;String,String&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''UrlMap''' | TreeMap&amp;lt;String,TreeMap&amp;lt;String,String&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Pattern ==&lt;br /&gt;
&lt;br /&gt;
We will be using '''&amp;quot;Delegation Pattern&amp;quot;''' in our project. The Storage interface is used by web applications to access the web storage provided by the browser. However, the actual data is stored somewhere else(Servo Memory Space). So, it makes sense to create another class which will maintain the actual stored data. The Storage class can then delegate the task of storing/retrieving data to this class. We will create a class &amp;quot;WebStorageTask&amp;quot; for this purpose.&lt;br /&gt;
&lt;br /&gt;
Also we are using an '''&amp;quot;Observer Pattern&amp;quot;''' where the Storage task will run in the background and observe the commands issued using a channel, it will keep listening to changes on a port and as soon as it receives a message i.e. sees a call towards it , it will perform the required function.&lt;br /&gt;
&lt;br /&gt;
== UML Diagrams ==&lt;br /&gt;
             &lt;br /&gt;
[[File:Flow_Chart_Storage.png|left]] &lt;br /&gt;
[[File:Use_Case_-_Storage.png‎|right]]&lt;br /&gt;
&lt;br /&gt;
'''Steps:'''&lt;br /&gt;
&lt;br /&gt;
1. First, we need to build rust and servo. &amp;lt;br/&amp;gt;&lt;br /&gt;
2. Generate the corresponding WebIDL bindings - Storage.webidl &amp;lt;br/&amp;gt;&lt;br /&gt;
3. Define Storage.rs which has the actual code for creating the storage object. &amp;lt;br/&amp;gt;&lt;br /&gt;
4. Call the receiver via a channel- this is actually used for creating an instance for each unique URL. &amp;lt;br/&amp;gt;&lt;br /&gt;
5. Build the servo again. &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Use Case Functionality'''&lt;br /&gt;
&lt;br /&gt;
1. Here the user can open multiple domains( multiple URL's).&amp;lt;br/&amp;gt;&lt;br /&gt;
2. Thereby the user will be creating multiple storage instances.&amp;lt;br/&amp;gt;&lt;br /&gt;
3. An user can traverse deep into the website but the storage instance is same for that URL.&amp;lt;br/&amp;gt;&lt;br /&gt;
4. The user can reopen the domain for a later period.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Proposed Test Cases ==&lt;br /&gt;
&lt;br /&gt;
Some of the test cases which will be used to validate our changes are as follows:&lt;br /&gt;
&lt;br /&gt;
* Allow a web page to clear its session storage ''i.e. storage.clear() function should work''&lt;br /&gt;
* Allow a web page to store an item in its session storage ''i.e. test storage.setitem(key,value)''&lt;br /&gt;
* Allow a web page to retrieve stored items from its session storage ''i.e. test storage.getitem(key)''&lt;br /&gt;
* Do not allow a web page to retrieve stored items from the session storage of a web page in another domain ''i.e. try to access elements by forging url&lt;br /&gt;
* Check the number of items stored in session storage i.e storage.count()''&lt;br /&gt;
* On removing an item from storage, it should be inaccessible ''i.e check if storage.remove(key) is functional''&lt;br /&gt;
* Should return null as value for a key not present in the session storage ''i.e. test storage.getitem(key) for non-existent key''&lt;br /&gt;
* Should give an error on exceeding the space limit of session storage ''i.e check for available memory on each command'' &lt;br /&gt;
&lt;br /&gt;
The complete list of test cases can be found [http://github.com/servo/web-platform-tests/tree/servo/webstorage here].&lt;br /&gt;
&lt;br /&gt;
== Further Readings ==&lt;br /&gt;
&lt;br /&gt;
Learning Rust by Examples: http://rustbyexample.com/ &amp;lt;br/&amp;gt;&lt;br /&gt;
Javascript as Servo's Garbage Collector: http://blog.mozilla.org/research/2014/08/26/javascript-servos-only-garbage-collector/  &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92047</id>
		<title>CSC/ECE 517 Fall 2014/final design doc M1450 navr</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92047"/>
		<updated>2014-11-12T05:17:02Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: /* Design Patterns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implement Window.sessionStorage ==&lt;br /&gt;
&lt;br /&gt;
This is the design document for the task &amp;lt;code&amp;gt;[http://github.com/servo/servo/wiki/Storage-student-project Implement Window.sessionStorage]&amp;lt;/code&amp;gt; for the [http://www.mozilla.org/ Mozilla] research project [http://github.com/servo/servo/wiki/Design Servo].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== [http://www.rust-lang.org/ Rust]===&lt;br /&gt;
&lt;br /&gt;
Rust is a modern systems programming language focusing on safety and speed to build reliable and efficient systems &amp;lt;ref&amp;gt; http://doc.rust-lang.org/nightly/intro.html &amp;lt;/ref&amp;gt;. It accomplishes the goals of memory safe without using garbage collection and it supports concurrency and parallelism in building platforms. &lt;br /&gt;
&lt;br /&gt;
Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://github.com/servo/servo/wiki/Design Servo] ===&lt;br /&gt;
&lt;br /&gt;
Mozilla Research team is currently working on an experimental project to develop a new Web browser engine &amp;quot;Servo&amp;quot;, that is capable of supporting a variety of current and next generation of hardware like mobile devices, multi-core processors and high-performance GPUs. Servo builds on top of Rust to provide a secure and reliable foundation. It is currently developed on 64 bit devices.&amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main objectives of this experimentation project is improving the layout to graphics rendering - to optimize for power efficiency and maximize parallelism. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
=== [http://html.spec.whatwg.org/multipage/webstorage.html#webstorage Web Storage] ===&lt;br /&gt;
The web storage specification defines the means by which a web application can store string key/value pairs in a browser and later retrieve them for use.&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage&amp;lt;/ref&amp;gt; It supports persistent data storage, similar to [http://en.wikipedia.org/wiki/HTTP_cookie cookies] but with a greatly enhanced capacity and no information stored in the [http://en.wikipedia.org/wiki/List_of_HTTP_headers HTTP request header].&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Web_storage&amp;lt;/ref&amp;gt; There are two types of web storage: [http://html.spec.whatwg.org/multipage/webstorage.html#dom-localstorage local storage] and [http://html.spec.whatwg.org/multipage/webstorage.html#dom-sessionstorage session storage].&lt;br /&gt;
&lt;br /&gt;
Browsers that support web storage have the global variables 'sessionStorage' and 'localStorage' declared at the [http://developer.mozilla.org/en-US/docs/Web/API/Window?redirectlocale=en-US&amp;amp;redirectslug=DOM%2Fwindow window] level. The following JavaScript code gives an example of how to use web storage:&lt;br /&gt;
&lt;br /&gt;
'''sessionStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on browser for duration of the session&lt;br /&gt;
sessionStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (gets deleted when browser is closed and re-opened)&lt;br /&gt;
alert(sessionStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''localStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on the browser beyond the duration of the session&lt;br /&gt;
localStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (persists even after closing and re-opening the browser)&lt;br /&gt;
alert(localStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
&lt;br /&gt;
As part of our [http://github.com/servo/servo/wiki/Storage-student-project project], we have to implement the web storage specification in the Servo browser. Implementing this important specification in Servo will allow stateful web applications to run, and will help expose any architectural problems that Servo's radical design may cause. &amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Requirement Analysis &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
In order to introduce the support for session storage and local storage in the Servo Broswer, we have to create the Storage structure and allow web pages to store data in the Servo memory space.&lt;br /&gt;
&lt;br /&gt;
Below is a high level overview of the various steps that need to be carried out to achieve this:&lt;br /&gt;
&lt;br /&gt;
* Create the Storage interface and its stub implementation.&lt;br /&gt;
* Create the WindowSessionStorage interface making it return a Storage instance.&lt;br /&gt;
* Create a Storage Task which will be used to contain all stored data.&lt;br /&gt;
* Define a message-passing interface for reading and writing stored data for a particular browser tab.&lt;br /&gt;
* Use the Storage task in the implementation of Storage.&lt;br /&gt;
* When the value of a stored data is changed, notify its respective browser tab.&lt;br /&gt;
* Pass as many [http://github.com/servo/web-platform-tests/tree/servo/webstorage tests] as possible.&lt;br /&gt;
* Implement the WindowLocalStorage interface which behaves slightly different from the WindowSessionStorage interface.&lt;br /&gt;
&lt;br /&gt;
== Architecture &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Design&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
[[File:task.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Architecture Explained ===&lt;br /&gt;
*Each box represents a Rust task.&lt;br /&gt;
*Blue boxes represent the primary tasks in the browser pipeline.&lt;br /&gt;
*Gray boxes represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
*White boxes represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
*Dashed lines indicate supervisor relationships.&lt;br /&gt;
*Solid lines indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
== Component Design ==&lt;br /&gt;
[[File:servo.jpg]]&lt;br /&gt;
&lt;br /&gt;
There will be a Storage Task which will be responsible to hold all the data that the web page requests to save. This happens via Channels in Rust, which implements a Sender Receiver protocol. The task is runnning in the background and waits to receive the data sent from the web page.&lt;br /&gt;
&lt;br /&gt;
=== Task &amp;lt;ref&amp;gt;http://doc.rust-lang.org/guide-tasks.html&amp;lt;/ref&amp;gt;===&lt;br /&gt;
Rust provides safe concurrent abstractions through a number of core library primitives. This guide will describe the concurrency model in Rust, how it relates to the Rust type system, and introduce the fundamental library abstractions for constructing concurrent programs.&lt;br /&gt;
&lt;br /&gt;
Tasks provide failure isolation and recovery. When a fatal error occurs in Rust code as a result of an explicit call to panic!(), an assertion failure, or another invalid operation, the runtime system destroys the entire task. Unlike in languages such as Java and C++, there is no way to catch an exception. Instead, tasks may monitor each other to see if they panic.&lt;br /&gt;
&lt;br /&gt;
Tasks use Rust's type system to provide strong memory safety guarantees. In particular, the type system guarantees that tasks cannot induce a data race from shared mutable state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Generate some state locally&lt;br /&gt;
let child_task_number = generate_task_number();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    // Capture it in the remote task&lt;br /&gt;
    println!(&amp;quot;I am child number {}&amp;quot;, child_task_number);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Channel &amp;lt;ref&amp;gt;http://doc.rust-lang.org/guide-tasks.html&amp;lt;/ref&amp;gt;===&lt;br /&gt;
Now that we have spawned a new task, it would be nice if we could communicate with it. For this, we use channels. A channel is simply a pair of endpoints: one for sending messages and another for receiving messages.&lt;br /&gt;
&lt;br /&gt;
The simplest way to create a channel is to use the channel function to create a (Sender, Receiver) pair. In Rust parlance, a sender is a sending endpoint of a channel, and a receiver is the receiving endpoint. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
let (tx, rx): (Sender&amp;lt;int&amp;gt;, Receiver&amp;lt;int&amp;gt;) = channel();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    let result = some_expensive_computation();&lt;br /&gt;
    tx.send(result);&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
some_other_expensive_computation();&lt;br /&gt;
let result = rx.recv();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Data Design ==&lt;br /&gt;
&lt;br /&gt;
===  Data Description ===&lt;br /&gt;
&lt;br /&gt;
''The following are the data structures that will be used.''&lt;br /&gt;
&lt;br /&gt;
'''Storage''' | TreeMap&amp;lt;String,String&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''UrlMap''' | TreeMap&amp;lt;String,TreeMap&amp;lt;String,String&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Pattern ==&lt;br /&gt;
&lt;br /&gt;
We will be using &amp;quot;Delegation Pattern&amp;quot; in our project. The Storage interface is used by web applications to access the web storage provided by the browser. However, the actual data is stored somewhere else(Servo Memory Space). So, it makes sense to create another class which will maintain the actual stored data. The Storage class can then delegate the task of storing/retrieving data to this class. We will create a class &amp;quot;WebStorageTask&amp;quot; for this purpose.&lt;br /&gt;
&lt;br /&gt;
== UML Diagrams ==&lt;br /&gt;
&lt;br /&gt;
[[File:Flow_Chart_Storage.png]][[File:Use_Case_Storage.jpg|right]]&lt;br /&gt;
&lt;br /&gt;
== Proposed Test Cases ==&lt;br /&gt;
&lt;br /&gt;
Some of the test cases which will be used to validate our changes are as follows:&lt;br /&gt;
&lt;br /&gt;
* Allow a web page to clear its session storage&lt;br /&gt;
* Allow a web page to store an item in its session storage&lt;br /&gt;
* Allow a web page to retrieve stored items from its session storage&lt;br /&gt;
* Do not allow a web page to retrieve stored items from the session storage of a web page in another domain&lt;br /&gt;
* Check the number of items stored in session storage&lt;br /&gt;
* On removing an item from storage, it should be inaccessible&lt;br /&gt;
* Should return null as value for a key not present in the session storage&lt;br /&gt;
* Should give an error on exceeding the space limit of session storage&lt;br /&gt;
&lt;br /&gt;
The complete list of test cases can be found [http://github.com/servo/web-platform-tests/tree/servo/webstorage here].&lt;br /&gt;
&lt;br /&gt;
== Further Readings ==&lt;br /&gt;
&lt;br /&gt;
Learning Rust by Examples: http://rustbyexample.com/ &amp;lt;br/&amp;gt;&lt;br /&gt;
Javascript as Servo's Garbage Collector: http://blog.mozilla.org/research/2014/08/26/javascript-servos-only-garbage-collector/  &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92046</id>
		<title>CSC/ECE 517 Fall 2014/final design doc M1450 navr</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92046"/>
		<updated>2014-11-12T05:08:13Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: /* Proposed Test Cases */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implement Window.sessionStorage ==&lt;br /&gt;
&lt;br /&gt;
This is the design document for the task &amp;lt;code&amp;gt;[http://github.com/servo/servo/wiki/Storage-student-project Implement Window.sessionStorage]&amp;lt;/code&amp;gt; for the [http://www.mozilla.org/ Mozilla] research project [http://github.com/servo/servo/wiki/Design Servo].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== [http://www.rust-lang.org/ Rust]===&lt;br /&gt;
&lt;br /&gt;
Rust is a modern systems programming language focusing on safety and speed to build reliable and efficient systems &amp;lt;ref&amp;gt; http://doc.rust-lang.org/nightly/intro.html &amp;lt;/ref&amp;gt;. It accomplishes the goals of memory safe without using garbage collection and it supports concurrency and parallelism in building platforms. &lt;br /&gt;
&lt;br /&gt;
Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://github.com/servo/servo/wiki/Design Servo] ===&lt;br /&gt;
&lt;br /&gt;
Mozilla Research team is currently working on an experimental project to develop a new Web browser engine &amp;quot;Servo&amp;quot;, that is capable of supporting a variety of current and next generation of hardware like mobile devices, multi-core processors and high-performance GPUs. Servo builds on top of Rust to provide a secure and reliable foundation. It is currently developed on 64 bit devices.&amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main objectives of this experimentation project is improving the layout to graphics rendering - to optimize for power efficiency and maximize parallelism. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
=== [http://html.spec.whatwg.org/multipage/webstorage.html#webstorage Web Storage] ===&lt;br /&gt;
The web storage specification defines the means by which a web application can store string key/value pairs in a browser and later retrieve them for use.&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage&amp;lt;/ref&amp;gt; It supports persistent data storage, similar to [http://en.wikipedia.org/wiki/HTTP_cookie cookies] but with a greatly enhanced capacity and no information stored in the [http://en.wikipedia.org/wiki/List_of_HTTP_headers HTTP request header].&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Web_storage&amp;lt;/ref&amp;gt; There are two types of web storage: [http://html.spec.whatwg.org/multipage/webstorage.html#dom-localstorage local storage] and [http://html.spec.whatwg.org/multipage/webstorage.html#dom-sessionstorage session storage].&lt;br /&gt;
&lt;br /&gt;
Browsers that support web storage have the global variables 'sessionStorage' and 'localStorage' declared at the [http://developer.mozilla.org/en-US/docs/Web/API/Window?redirectlocale=en-US&amp;amp;redirectslug=DOM%2Fwindow window] level. The following JavaScript code gives an example of how to use web storage:&lt;br /&gt;
&lt;br /&gt;
'''sessionStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on browser for duration of the session&lt;br /&gt;
sessionStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (gets deleted when browser is closed and re-opened)&lt;br /&gt;
alert(sessionStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''localStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on the browser beyond the duration of the session&lt;br /&gt;
localStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (persists even after closing and re-opening the browser)&lt;br /&gt;
alert(localStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
&lt;br /&gt;
As part of our [http://github.com/servo/servo/wiki/Storage-student-project project], we have to implement the web storage specification in the Servo browser. Implementing this important specification in Servo will allow stateful web applications to run, and will help expose any architectural problems that Servo's radical design may cause. &amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Requirement Analysis &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
In order to introduce the support for session storage and local storage in the Servo Broswer, we have to create the Storage structure and allow web pages to store data in the Servo memory space.&lt;br /&gt;
&lt;br /&gt;
Below is a high level overview of the various steps that need to be carried out to achieve this:&lt;br /&gt;
&lt;br /&gt;
* Create the Storage interface and its stub implementation.&lt;br /&gt;
* Create the WindowSessionStorage interface making it return a Storage instance.&lt;br /&gt;
* Create a Storage Task which will be used to contain all stored data.&lt;br /&gt;
* Define a message-passing interface for reading and writing stored data for a particular browser tab.&lt;br /&gt;
* Use the Storage task in the implementation of Storage.&lt;br /&gt;
* When the value of a stored data is changed, notify its respective browser tab.&lt;br /&gt;
* Pass as many [http://github.com/servo/web-platform-tests/tree/servo/webstorage tests] as possible.&lt;br /&gt;
* Implement the WindowLocalStorage interface which behaves slightly different from the WindowSessionStorage interface.&lt;br /&gt;
&lt;br /&gt;
== Architecture &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Design&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
[[File:task.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Architecture Explained ===&lt;br /&gt;
*Each box represents a Rust task.&lt;br /&gt;
*Blue boxes represent the primary tasks in the browser pipeline.&lt;br /&gt;
*Gray boxes represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
*White boxes represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
*Dashed lines indicate supervisor relationships.&lt;br /&gt;
*Solid lines indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
== Component Design ==&lt;br /&gt;
[[File:servo.jpg]]&lt;br /&gt;
&lt;br /&gt;
There will be a Storage Task which will be responsible to hold all the data that the web page requests to save. This happens via Channels in Rust, which implements a Sender Receiver protocol. The task is runnning in the background and waits to receive the data sent from the web page.&lt;br /&gt;
&lt;br /&gt;
=== Task &amp;lt;ref&amp;gt;http://doc.rust-lang.org/guide-tasks.html&amp;lt;/ref&amp;gt;===&lt;br /&gt;
Rust provides safe concurrent abstractions through a number of core library primitives. This guide will describe the concurrency model in Rust, how it relates to the Rust type system, and introduce the fundamental library abstractions for constructing concurrent programs.&lt;br /&gt;
&lt;br /&gt;
Tasks provide failure isolation and recovery. When a fatal error occurs in Rust code as a result of an explicit call to panic!(), an assertion failure, or another invalid operation, the runtime system destroys the entire task. Unlike in languages such as Java and C++, there is no way to catch an exception. Instead, tasks may monitor each other to see if they panic.&lt;br /&gt;
&lt;br /&gt;
Tasks use Rust's type system to provide strong memory safety guarantees. In particular, the type system guarantees that tasks cannot induce a data race from shared mutable state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Generate some state locally&lt;br /&gt;
let child_task_number = generate_task_number();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    // Capture it in the remote task&lt;br /&gt;
    println!(&amp;quot;I am child number {}&amp;quot;, child_task_number);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Channel &amp;lt;ref&amp;gt;http://doc.rust-lang.org/guide-tasks.html&amp;lt;/ref&amp;gt;===&lt;br /&gt;
Now that we have spawned a new task, it would be nice if we could communicate with it. For this, we use channels. A channel is simply a pair of endpoints: one for sending messages and another for receiving messages.&lt;br /&gt;
&lt;br /&gt;
The simplest way to create a channel is to use the channel function to create a (Sender, Receiver) pair. In Rust parlance, a sender is a sending endpoint of a channel, and a receiver is the receiving endpoint. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
let (tx, rx): (Sender&amp;lt;int&amp;gt;, Receiver&amp;lt;int&amp;gt;) = channel();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    let result = some_expensive_computation();&lt;br /&gt;
    tx.send(result);&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
some_other_expensive_computation();&lt;br /&gt;
let result = rx.recv();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Data Design ==&lt;br /&gt;
&lt;br /&gt;
===  Data Description ===&lt;br /&gt;
&lt;br /&gt;
''The following are the data structures that will be used.''&lt;br /&gt;
&lt;br /&gt;
'''Storage''' | TreeMap&amp;lt;String,String&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''UrlMap''' | TreeMap&amp;lt;String,TreeMap&amp;lt;String,String&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
We will be using &amp;quot;Delegation Pattern&amp;quot; in our project. The Storage interface is used by web applications to access the web storage provided by the browser. However, the actual data is stored somewhere else(Servo Memory Space). So, it makes sense to create another class which will maintain the actual stored data. The Storage class can then delegate the task of storing/retrieving data to this class. We will create a class &amp;quot;WebStorageTask&amp;quot; for this purpose.&lt;br /&gt;
&lt;br /&gt;
== UML Diagrams ==&lt;br /&gt;
&lt;br /&gt;
[[File:Flow_Chart_Storage.png]][[File:Use_Case_Storage.jpg|right]]&lt;br /&gt;
&lt;br /&gt;
== Proposed Test Cases ==&lt;br /&gt;
&lt;br /&gt;
Some of the test cases which will be used to validate our changes are as follows:&lt;br /&gt;
&lt;br /&gt;
* Allow a web page to clear its session storage&lt;br /&gt;
* Allow a web page to store an item in its session storage&lt;br /&gt;
* Allow a web page to retrieve stored items from its session storage&lt;br /&gt;
* Do not allow a web page to retrieve stored items from the session storage of a web page in another domain&lt;br /&gt;
* Check the number of items stored in session storage&lt;br /&gt;
* On removing an item from storage, it should be inaccessible&lt;br /&gt;
* Should return null as value for a key not present in the session storage&lt;br /&gt;
* Should give an error on exceeding the space limit of session storage&lt;br /&gt;
&lt;br /&gt;
The complete list of test cases can be found [http://github.com/servo/web-platform-tests/tree/servo/webstorage here].&lt;br /&gt;
&lt;br /&gt;
== Further Readings ==&lt;br /&gt;
&lt;br /&gt;
Learning Rust by Examples: http://rustbyexample.com/ &amp;lt;br/&amp;gt;&lt;br /&gt;
Javascript as Servo's Garbage Collector: http://blog.mozilla.org/research/2014/08/26/javascript-servos-only-garbage-collector/  &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92045</id>
		<title>CSC/ECE 517 Fall 2014/final design doc M1450 navr</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92045"/>
		<updated>2014-11-12T05:04:47Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: /* Architecture https://github.com/servo/servo/wiki/Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implement Window.sessionStorage ==&lt;br /&gt;
&lt;br /&gt;
This is the design document for the task &amp;lt;code&amp;gt;[http://github.com/servo/servo/wiki/Storage-student-project Implement Window.sessionStorage]&amp;lt;/code&amp;gt; for the [http://www.mozilla.org/ Mozilla] research project [http://github.com/servo/servo/wiki/Design Servo].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== [http://www.rust-lang.org/ Rust]===&lt;br /&gt;
&lt;br /&gt;
Rust is a modern systems programming language focusing on safety and speed to build reliable and efficient systems &amp;lt;ref&amp;gt; http://doc.rust-lang.org/nightly/intro.html &amp;lt;/ref&amp;gt;. It accomplishes the goals of memory safe without using garbage collection and it supports concurrency and parallelism in building platforms. &lt;br /&gt;
&lt;br /&gt;
Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://github.com/servo/servo/wiki/Design Servo] ===&lt;br /&gt;
&lt;br /&gt;
Mozilla Research team is currently working on an experimental project to develop a new Web browser engine &amp;quot;Servo&amp;quot;, that is capable of supporting a variety of current and next generation of hardware like mobile devices, multi-core processors and high-performance GPUs. Servo builds on top of Rust to provide a secure and reliable foundation. It is currently developed on 64 bit devices.&amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main objectives of this experimentation project is improving the layout to graphics rendering - to optimize for power efficiency and maximize parallelism. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
=== [http://html.spec.whatwg.org/multipage/webstorage.html#webstorage Web Storage] ===&lt;br /&gt;
The web storage specification defines the means by which a web application can store string key/value pairs in a browser and later retrieve them for use.&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage&amp;lt;/ref&amp;gt; It supports persistent data storage, similar to [http://en.wikipedia.org/wiki/HTTP_cookie cookies] but with a greatly enhanced capacity and no information stored in the [http://en.wikipedia.org/wiki/List_of_HTTP_headers HTTP request header].&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Web_storage&amp;lt;/ref&amp;gt; There are two types of web storage: [http://html.spec.whatwg.org/multipage/webstorage.html#dom-localstorage local storage] and [http://html.spec.whatwg.org/multipage/webstorage.html#dom-sessionstorage session storage].&lt;br /&gt;
&lt;br /&gt;
Browsers that support web storage have the global variables 'sessionStorage' and 'localStorage' declared at the [http://developer.mozilla.org/en-US/docs/Web/API/Window?redirectlocale=en-US&amp;amp;redirectslug=DOM%2Fwindow window] level. The following JavaScript code gives an example of how to use web storage:&lt;br /&gt;
&lt;br /&gt;
'''sessionStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on browser for duration of the session&lt;br /&gt;
sessionStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (gets deleted when browser is closed and re-opened)&lt;br /&gt;
alert(sessionStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''localStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on the browser beyond the duration of the session&lt;br /&gt;
localStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (persists even after closing and re-opening the browser)&lt;br /&gt;
alert(localStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
&lt;br /&gt;
As part of our [http://github.com/servo/servo/wiki/Storage-student-project project], we have to implement the web storage specification in the Servo browser. Implementing this important specification in Servo will allow stateful web applications to run, and will help expose any architectural problems that Servo's radical design may cause. &amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Requirement Analysis &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
In order to introduce the support for session storage and local storage in the Servo Broswer, we have to create the Storage structure and allow web pages to store data in the Servo memory space.&lt;br /&gt;
&lt;br /&gt;
Below is a high level overview of the various steps that need to be carried out to achieve this:&lt;br /&gt;
&lt;br /&gt;
* Create the Storage interface and its stub implementation.&lt;br /&gt;
* Create the WindowSessionStorage interface making it return a Storage instance.&lt;br /&gt;
* Create a Storage Task which will be used to contain all stored data.&lt;br /&gt;
* Define a message-passing interface for reading and writing stored data for a particular browser tab.&lt;br /&gt;
* Use the Storage task in the implementation of Storage.&lt;br /&gt;
* When the value of a stored data is changed, notify its respective browser tab.&lt;br /&gt;
* Pass as many [http://github.com/servo/web-platform-tests/tree/servo/webstorage tests] as possible.&lt;br /&gt;
* Implement the WindowLocalStorage interface which behaves slightly different from the WindowSessionStorage interface.&lt;br /&gt;
&lt;br /&gt;
== Architecture &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Design&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
[[File:task.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Architecture Explained ===&lt;br /&gt;
*Each box represents a Rust task.&lt;br /&gt;
*Blue boxes represent the primary tasks in the browser pipeline.&lt;br /&gt;
*Gray boxes represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
*White boxes represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
*Dashed lines indicate supervisor relationships.&lt;br /&gt;
*Solid lines indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
== Component Design ==&lt;br /&gt;
[[File:servo.jpg]]&lt;br /&gt;
&lt;br /&gt;
There will be a Storage Task which will be responsible to hold all the data that the web page requests to save. This happens via Channels in Rust, which implements a Sender Receiver protocol. The task is runnning in the background and waits to receive the data sent from the web page.&lt;br /&gt;
&lt;br /&gt;
=== Task &amp;lt;ref&amp;gt;http://doc.rust-lang.org/guide-tasks.html&amp;lt;/ref&amp;gt;===&lt;br /&gt;
Rust provides safe concurrent abstractions through a number of core library primitives. This guide will describe the concurrency model in Rust, how it relates to the Rust type system, and introduce the fundamental library abstractions for constructing concurrent programs.&lt;br /&gt;
&lt;br /&gt;
Tasks provide failure isolation and recovery. When a fatal error occurs in Rust code as a result of an explicit call to panic!(), an assertion failure, or another invalid operation, the runtime system destroys the entire task. Unlike in languages such as Java and C++, there is no way to catch an exception. Instead, tasks may monitor each other to see if they panic.&lt;br /&gt;
&lt;br /&gt;
Tasks use Rust's type system to provide strong memory safety guarantees. In particular, the type system guarantees that tasks cannot induce a data race from shared mutable state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Generate some state locally&lt;br /&gt;
let child_task_number = generate_task_number();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    // Capture it in the remote task&lt;br /&gt;
    println!(&amp;quot;I am child number {}&amp;quot;, child_task_number);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Channel &amp;lt;ref&amp;gt;http://doc.rust-lang.org/guide-tasks.html&amp;lt;/ref&amp;gt;===&lt;br /&gt;
Now that we have spawned a new task, it would be nice if we could communicate with it. For this, we use channels. A channel is simply a pair of endpoints: one for sending messages and another for receiving messages.&lt;br /&gt;
&lt;br /&gt;
The simplest way to create a channel is to use the channel function to create a (Sender, Receiver) pair. In Rust parlance, a sender is a sending endpoint of a channel, and a receiver is the receiving endpoint. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
let (tx, rx): (Sender&amp;lt;int&amp;gt;, Receiver&amp;lt;int&amp;gt;) = channel();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    let result = some_expensive_computation();&lt;br /&gt;
    tx.send(result);&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
some_other_expensive_computation();&lt;br /&gt;
let result = rx.recv();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Data Design ==&lt;br /&gt;
&lt;br /&gt;
===  Data Description ===&lt;br /&gt;
&lt;br /&gt;
''The following are the data structures that will be used.''&lt;br /&gt;
&lt;br /&gt;
'''Storage''' | TreeMap&amp;lt;String,String&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''UrlMap''' | TreeMap&amp;lt;String,TreeMap&amp;lt;String,String&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
We will be using &amp;quot;Delegation Pattern&amp;quot; in our project. The Storage interface is used by web applications to access the web storage provided by the browser. However, the actual data is stored somewhere else(Servo Memory Space). So, it makes sense to create another class which will maintain the actual stored data. The Storage class can then delegate the task of storing/retrieving data to this class. We will create a class &amp;quot;WebStorageTask&amp;quot; for this purpose.&lt;br /&gt;
&lt;br /&gt;
== UML Diagrams ==&lt;br /&gt;
&lt;br /&gt;
[[File:Flow_Chart_Storage.png]][[File:Use_Case_Storage.jpg|right]]&lt;br /&gt;
&lt;br /&gt;
== Proposed Test Cases ==&lt;br /&gt;
&lt;br /&gt;
Some of the test cases which will be used to validate our changes are as follows:&lt;br /&gt;
&lt;br /&gt;
* Allow a web page to clear its session storage&lt;br /&gt;
* Allow a web page to store an item in session storage&lt;br /&gt;
* Allow a web page to retrieve stored items from its session storage&lt;br /&gt;
* Do not allow a web page to retrieve stored items from another page's session storage&lt;br /&gt;
* Check the number of items stored in session storage&lt;br /&gt;
* On removing the item from storage, it should be inaccessible&lt;br /&gt;
* Should return null as value for a key not present in the session storage&lt;br /&gt;
* Should give an error on exceeding the space limit of session storage&lt;br /&gt;
&lt;br /&gt;
The complete list of test cases can be found [http://github.com/servo/web-platform-tests/tree/servo/webstorage here].&lt;br /&gt;
&lt;br /&gt;
== Further Readings ==&lt;br /&gt;
&lt;br /&gt;
Learning Rust by Examples: http://rustbyexample.com/ &amp;lt;br/&amp;gt;&lt;br /&gt;
Javascript as Servo's Garbage Collector: http://blog.mozilla.org/research/2014/08/26/javascript-servos-only-garbage-collector/  &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92044</id>
		<title>CSC/ECE 517 Fall 2014/final design doc M1450 navr</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92044"/>
		<updated>2014-11-12T05:04:12Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: /* Architecture */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implement Window.sessionStorage ==&lt;br /&gt;
&lt;br /&gt;
This is the design document for the task &amp;lt;code&amp;gt;[http://github.com/servo/servo/wiki/Storage-student-project Implement Window.sessionStorage]&amp;lt;/code&amp;gt; for the [http://www.mozilla.org/ Mozilla] research project [http://github.com/servo/servo/wiki/Design Servo].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== [http://www.rust-lang.org/ Rust]===&lt;br /&gt;
&lt;br /&gt;
Rust is a modern systems programming language focusing on safety and speed to build reliable and efficient systems &amp;lt;ref&amp;gt; http://doc.rust-lang.org/nightly/intro.html &amp;lt;/ref&amp;gt;. It accomplishes the goals of memory safe without using garbage collection and it supports concurrency and parallelism in building platforms. &lt;br /&gt;
&lt;br /&gt;
Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://github.com/servo/servo/wiki/Design Servo] ===&lt;br /&gt;
&lt;br /&gt;
Mozilla Research team is currently working on an experimental project to develop a new Web browser engine &amp;quot;Servo&amp;quot;, that is capable of supporting a variety of current and next generation of hardware like mobile devices, multi-core processors and high-performance GPUs. Servo builds on top of Rust to provide a secure and reliable foundation. It is currently developed on 64 bit devices.&amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main objectives of this experimentation project is improving the layout to graphics rendering - to optimize for power efficiency and maximize parallelism. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
=== [http://html.spec.whatwg.org/multipage/webstorage.html#webstorage Web Storage] ===&lt;br /&gt;
The web storage specification defines the means by which a web application can store string key/value pairs in a browser and later retrieve them for use.&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage&amp;lt;/ref&amp;gt; It supports persistent data storage, similar to [http://en.wikipedia.org/wiki/HTTP_cookie cookies] but with a greatly enhanced capacity and no information stored in the [http://en.wikipedia.org/wiki/List_of_HTTP_headers HTTP request header].&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Web_storage&amp;lt;/ref&amp;gt; There are two types of web storage: [http://html.spec.whatwg.org/multipage/webstorage.html#dom-localstorage local storage] and [http://html.spec.whatwg.org/multipage/webstorage.html#dom-sessionstorage session storage].&lt;br /&gt;
&lt;br /&gt;
Browsers that support web storage have the global variables 'sessionStorage' and 'localStorage' declared at the [http://developer.mozilla.org/en-US/docs/Web/API/Window?redirectlocale=en-US&amp;amp;redirectslug=DOM%2Fwindow window] level. The following JavaScript code gives an example of how to use web storage:&lt;br /&gt;
&lt;br /&gt;
'''sessionStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on browser for duration of the session&lt;br /&gt;
sessionStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (gets deleted when browser is closed and re-opened)&lt;br /&gt;
alert(sessionStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''localStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on the browser beyond the duration of the session&lt;br /&gt;
localStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (persists even after closing and re-opening the browser)&lt;br /&gt;
alert(localStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
&lt;br /&gt;
As part of our [http://github.com/servo/servo/wiki/Storage-student-project project], we have to implement the web storage specification in the Servo browser. Implementing this important specification in Servo will allow stateful web applications to run, and will help expose any architectural problems that Servo's radical design may cause. &amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Requirement Analysis &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
In order to introduce the support for session storage and local storage in the Servo Broswer, we have to create the Storage structure and allow web pages to store data in the Servo memory space.&lt;br /&gt;
&lt;br /&gt;
Below is a high level overview of the various steps that need to be carried out to achieve this:&lt;br /&gt;
&lt;br /&gt;
* Create the Storage interface and its stub implementation.&lt;br /&gt;
* Create the WindowSessionStorage interface making it return a Storage instance.&lt;br /&gt;
* Create a Storage Task which will be used to contain all stored data.&lt;br /&gt;
* Define a message-passing interface for reading and writing stored data for a particular browser tab.&lt;br /&gt;
* Use the Storage task in the implementation of Storage.&lt;br /&gt;
* When the value of a stored data is changed, notify its respective browser tab.&lt;br /&gt;
* Pass as many [http://github.com/servo/web-platform-tests/tree/servo/webstorage tests] as possible.&lt;br /&gt;
* Implement the WindowLocalStorage interface which behaves slightly different from the WindowSessionStorage interface.&lt;br /&gt;
&lt;br /&gt;
== Architecture &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Design&amp;lt;ref/&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
[[File:task.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Architecture Explained ===&lt;br /&gt;
*Each box represents a Rust task.&lt;br /&gt;
*Blue boxes represent the primary tasks in the browser pipeline.&lt;br /&gt;
*Gray boxes represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
*White boxes represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
*Dashed lines indicate supervisor relationships.&lt;br /&gt;
*Solid lines indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
== Component Design ==&lt;br /&gt;
[[File:servo.jpg]]&lt;br /&gt;
&lt;br /&gt;
There will be a Storage Task which will be responsible to hold all the data that the web page requests to save. This happens via Channels in Rust, which implements a Sender Receiver protocol. The task is runnning in the background and waits to receive the data sent from the web page.&lt;br /&gt;
&lt;br /&gt;
=== Task &amp;lt;ref&amp;gt;http://doc.rust-lang.org/guide-tasks.html&amp;lt;/ref&amp;gt;===&lt;br /&gt;
Rust provides safe concurrent abstractions through a number of core library primitives. This guide will describe the concurrency model in Rust, how it relates to the Rust type system, and introduce the fundamental library abstractions for constructing concurrent programs.&lt;br /&gt;
&lt;br /&gt;
Tasks provide failure isolation and recovery. When a fatal error occurs in Rust code as a result of an explicit call to panic!(), an assertion failure, or another invalid operation, the runtime system destroys the entire task. Unlike in languages such as Java and C++, there is no way to catch an exception. Instead, tasks may monitor each other to see if they panic.&lt;br /&gt;
&lt;br /&gt;
Tasks use Rust's type system to provide strong memory safety guarantees. In particular, the type system guarantees that tasks cannot induce a data race from shared mutable state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Generate some state locally&lt;br /&gt;
let child_task_number = generate_task_number();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    // Capture it in the remote task&lt;br /&gt;
    println!(&amp;quot;I am child number {}&amp;quot;, child_task_number);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Channel &amp;lt;ref&amp;gt;http://doc.rust-lang.org/guide-tasks.html&amp;lt;/ref&amp;gt;===&lt;br /&gt;
Now that we have spawned a new task, it would be nice if we could communicate with it. For this, we use channels. A channel is simply a pair of endpoints: one for sending messages and another for receiving messages.&lt;br /&gt;
&lt;br /&gt;
The simplest way to create a channel is to use the channel function to create a (Sender, Receiver) pair. In Rust parlance, a sender is a sending endpoint of a channel, and a receiver is the receiving endpoint. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
let (tx, rx): (Sender&amp;lt;int&amp;gt;, Receiver&amp;lt;int&amp;gt;) = channel();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    let result = some_expensive_computation();&lt;br /&gt;
    tx.send(result);&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
some_other_expensive_computation();&lt;br /&gt;
let result = rx.recv();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Data Design ==&lt;br /&gt;
&lt;br /&gt;
===  Data Description ===&lt;br /&gt;
&lt;br /&gt;
''The following are the data structures that will be used.''&lt;br /&gt;
&lt;br /&gt;
'''Storage''' | TreeMap&amp;lt;String,String&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''UrlMap''' | TreeMap&amp;lt;String,TreeMap&amp;lt;String,String&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
We will be using &amp;quot;Delegation Pattern&amp;quot; in our project. The Storage interface is used by web applications to access the web storage provided by the browser. However, the actual data is stored somewhere else(Servo Memory Space). So, it makes sense to create another class which will maintain the actual stored data. The Storage class can then delegate the task of storing/retrieving data to this class. We will create a class &amp;quot;WebStorageTask&amp;quot; for this purpose.&lt;br /&gt;
&lt;br /&gt;
== UML Diagrams ==&lt;br /&gt;
&lt;br /&gt;
[[File:Flow_Chart_Storage.png]][[File:Use_Case_Storage.jpg|right]]&lt;br /&gt;
&lt;br /&gt;
== Proposed Test Cases ==&lt;br /&gt;
&lt;br /&gt;
Some of the test cases which will be used to validate our changes are as follows:&lt;br /&gt;
&lt;br /&gt;
* Allow a web page to clear its session storage&lt;br /&gt;
* Allow a web page to store an item in session storage&lt;br /&gt;
* Allow a web page to retrieve stored items from its session storage&lt;br /&gt;
* Do not allow a web page to retrieve stored items from another page's session storage&lt;br /&gt;
* Check the number of items stored in session storage&lt;br /&gt;
* On removing the item from storage, it should be inaccessible&lt;br /&gt;
* Should return null as value for a key not present in the session storage&lt;br /&gt;
* Should give an error on exceeding the space limit of session storage&lt;br /&gt;
&lt;br /&gt;
The complete list of test cases can be found [http://github.com/servo/web-platform-tests/tree/servo/webstorage here].&lt;br /&gt;
&lt;br /&gt;
== Further Readings ==&lt;br /&gt;
&lt;br /&gt;
Learning Rust by Examples: http://rustbyexample.com/ &amp;lt;br/&amp;gt;&lt;br /&gt;
Javascript as Servo's Garbage Collector: http://blog.mozilla.org/research/2014/08/26/javascript-servos-only-garbage-collector/  &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92043</id>
		<title>CSC/ECE 517 Fall 2014/final design doc M1450 navr</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92043"/>
		<updated>2014-11-12T05:02:26Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: /* Channel */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implement Window.sessionStorage ==&lt;br /&gt;
&lt;br /&gt;
This is the design document for the task &amp;lt;code&amp;gt;[http://github.com/servo/servo/wiki/Storage-student-project Implement Window.sessionStorage]&amp;lt;/code&amp;gt; for the [http://www.mozilla.org/ Mozilla] research project [http://github.com/servo/servo/wiki/Design Servo].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== [http://www.rust-lang.org/ Rust]===&lt;br /&gt;
&lt;br /&gt;
Rust is a modern systems programming language focusing on safety and speed to build reliable and efficient systems &amp;lt;ref&amp;gt; http://doc.rust-lang.org/nightly/intro.html &amp;lt;/ref&amp;gt;. It accomplishes the goals of memory safe without using garbage collection and it supports concurrency and parallelism in building platforms. &lt;br /&gt;
&lt;br /&gt;
Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://github.com/servo/servo/wiki/Design Servo] ===&lt;br /&gt;
&lt;br /&gt;
Mozilla Research team is currently working on an experimental project to develop a new Web browser engine &amp;quot;Servo&amp;quot;, that is capable of supporting a variety of current and next generation of hardware like mobile devices, multi-core processors and high-performance GPUs. Servo builds on top of Rust to provide a secure and reliable foundation. It is currently developed on 64 bit devices.&amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main objectives of this experimentation project is improving the layout to graphics rendering - to optimize for power efficiency and maximize parallelism. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
=== [http://html.spec.whatwg.org/multipage/webstorage.html#webstorage Web Storage] ===&lt;br /&gt;
The web storage specification defines the means by which a web application can store string key/value pairs in a browser and later retrieve them for use.&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage&amp;lt;/ref&amp;gt; It supports persistent data storage, similar to [http://en.wikipedia.org/wiki/HTTP_cookie cookies] but with a greatly enhanced capacity and no information stored in the [http://en.wikipedia.org/wiki/List_of_HTTP_headers HTTP request header].&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Web_storage&amp;lt;/ref&amp;gt; There are two types of web storage: [http://html.spec.whatwg.org/multipage/webstorage.html#dom-localstorage local storage] and [http://html.spec.whatwg.org/multipage/webstorage.html#dom-sessionstorage session storage].&lt;br /&gt;
&lt;br /&gt;
Browsers that support web storage have the global variables 'sessionStorage' and 'localStorage' declared at the [http://developer.mozilla.org/en-US/docs/Web/API/Window?redirectlocale=en-US&amp;amp;redirectslug=DOM%2Fwindow window] level. The following JavaScript code gives an example of how to use web storage:&lt;br /&gt;
&lt;br /&gt;
'''sessionStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on browser for duration of the session&lt;br /&gt;
sessionStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (gets deleted when browser is closed and re-opened)&lt;br /&gt;
alert(sessionStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''localStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on the browser beyond the duration of the session&lt;br /&gt;
localStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (persists even after closing and re-opening the browser)&lt;br /&gt;
alert(localStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
&lt;br /&gt;
As part of our [http://github.com/servo/servo/wiki/Storage-student-project project], we have to implement the web storage specification in the Servo browser. Implementing this important specification in Servo will allow stateful web applications to run, and will help expose any architectural problems that Servo's radical design may cause. &amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Requirement Analysis &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
In order to introduce the support for session storage and local storage in the Servo Broswer, we have to create the Storage structure and allow web pages to store data in the Servo memory space.&lt;br /&gt;
&lt;br /&gt;
Below is a high level overview of the various steps that need to be carried out to achieve this:&lt;br /&gt;
&lt;br /&gt;
* Create the Storage interface and its stub implementation.&lt;br /&gt;
* Create the WindowSessionStorage interface making it return a Storage instance.&lt;br /&gt;
* Create a Storage Task which will be used to contain all stored data.&lt;br /&gt;
* Define a message-passing interface for reading and writing stored data for a particular browser tab.&lt;br /&gt;
* Use the Storage task in the implementation of Storage.&lt;br /&gt;
* When the value of a stored data is changed, notify its respective browser tab.&lt;br /&gt;
* Pass as many [http://github.com/servo/web-platform-tests/tree/servo/webstorage tests] as possible.&lt;br /&gt;
* Implement the WindowLocalStorage interface which behaves slightly different from the WindowSessionStorage interface.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
[[File:task.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Architecture Explained ===&lt;br /&gt;
*Each box represents a Rust task.&lt;br /&gt;
*Blue boxes represent the primary tasks in the browser pipeline.&lt;br /&gt;
*Gray boxes represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
*White boxes represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
*Dashed lines indicate supervisor relationships.&lt;br /&gt;
*Solid lines indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
== Component Design ==&lt;br /&gt;
[[File:servo.jpg]]&lt;br /&gt;
&lt;br /&gt;
There will be a Storage Task which will be responsible to hold all the data that the web page requests to save. This happens via Channels in Rust, which implements a Sender Receiver protocol. The task is runnning in the background and waits to receive the data sent from the web page.&lt;br /&gt;
&lt;br /&gt;
=== Task &amp;lt;ref&amp;gt;http://doc.rust-lang.org/guide-tasks.html&amp;lt;/ref&amp;gt;===&lt;br /&gt;
Rust provides safe concurrent abstractions through a number of core library primitives. This guide will describe the concurrency model in Rust, how it relates to the Rust type system, and introduce the fundamental library abstractions for constructing concurrent programs.&lt;br /&gt;
&lt;br /&gt;
Tasks provide failure isolation and recovery. When a fatal error occurs in Rust code as a result of an explicit call to panic!(), an assertion failure, or another invalid operation, the runtime system destroys the entire task. Unlike in languages such as Java and C++, there is no way to catch an exception. Instead, tasks may monitor each other to see if they panic.&lt;br /&gt;
&lt;br /&gt;
Tasks use Rust's type system to provide strong memory safety guarantees. In particular, the type system guarantees that tasks cannot induce a data race from shared mutable state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Generate some state locally&lt;br /&gt;
let child_task_number = generate_task_number();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    // Capture it in the remote task&lt;br /&gt;
    println!(&amp;quot;I am child number {}&amp;quot;, child_task_number);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Channel &amp;lt;ref&amp;gt;http://doc.rust-lang.org/guide-tasks.html&amp;lt;/ref&amp;gt;===&lt;br /&gt;
Now that we have spawned a new task, it would be nice if we could communicate with it. For this, we use channels. A channel is simply a pair of endpoints: one for sending messages and another for receiving messages.&lt;br /&gt;
&lt;br /&gt;
The simplest way to create a channel is to use the channel function to create a (Sender, Receiver) pair. In Rust parlance, a sender is a sending endpoint of a channel, and a receiver is the receiving endpoint. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
let (tx, rx): (Sender&amp;lt;int&amp;gt;, Receiver&amp;lt;int&amp;gt;) = channel();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    let result = some_expensive_computation();&lt;br /&gt;
    tx.send(result);&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
some_other_expensive_computation();&lt;br /&gt;
let result = rx.recv();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Data Design ==&lt;br /&gt;
&lt;br /&gt;
===  Data Description ===&lt;br /&gt;
&lt;br /&gt;
''The following are the data structures that will be used.''&lt;br /&gt;
&lt;br /&gt;
'''Storage''' | TreeMap&amp;lt;String,String&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''UrlMap''' | TreeMap&amp;lt;String,TreeMap&amp;lt;String,String&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
We will be using &amp;quot;Delegation Pattern&amp;quot; in our project. The Storage interface is used by web applications to access the web storage provided by the browser. However, the actual data is stored somewhere else(Servo Memory Space). So, it makes sense to create another class which will maintain the actual stored data. The Storage class can then delegate the task of storing/retrieving data to this class. We will create a class &amp;quot;WebStorageTask&amp;quot; for this purpose.&lt;br /&gt;
&lt;br /&gt;
== UML Diagrams ==&lt;br /&gt;
&lt;br /&gt;
[[File:Flow_Chart_Storage.png]][[File:Use_Case_Storage.jpg|right]]&lt;br /&gt;
&lt;br /&gt;
== Proposed Test Cases ==&lt;br /&gt;
&lt;br /&gt;
Some of the test cases which will be used to validate our changes are as follows:&lt;br /&gt;
&lt;br /&gt;
* Allow a web page to clear its session storage&lt;br /&gt;
* Allow a web page to store an item in session storage&lt;br /&gt;
* Allow a web page to retrieve stored items from its session storage&lt;br /&gt;
* Do not allow a web page to retrieve stored items from another page's session storage&lt;br /&gt;
* Check the number of items stored in session storage&lt;br /&gt;
* On removing the item from storage, it should be inaccessible&lt;br /&gt;
* Should return null as value for a key not present in the session storage&lt;br /&gt;
* Should give an error on exceeding the space limit of session storage&lt;br /&gt;
&lt;br /&gt;
The complete list of test cases can be found [http://github.com/servo/web-platform-tests/tree/servo/webstorage here].&lt;br /&gt;
&lt;br /&gt;
== Further Readings ==&lt;br /&gt;
&lt;br /&gt;
Learning Rust by Examples: http://rustbyexample.com/ &amp;lt;br/&amp;gt;&lt;br /&gt;
Javascript as Servo's Garbage Collector: http://blog.mozilla.org/research/2014/08/26/javascript-servos-only-garbage-collector/  &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92042</id>
		<title>CSC/ECE 517 Fall 2014/final design doc M1450 navr</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92042"/>
		<updated>2014-11-12T05:02:04Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: /* Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implement Window.sessionStorage ==&lt;br /&gt;
&lt;br /&gt;
This is the design document for the task &amp;lt;code&amp;gt;[http://github.com/servo/servo/wiki/Storage-student-project Implement Window.sessionStorage]&amp;lt;/code&amp;gt; for the [http://www.mozilla.org/ Mozilla] research project [http://github.com/servo/servo/wiki/Design Servo].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== [http://www.rust-lang.org/ Rust]===&lt;br /&gt;
&lt;br /&gt;
Rust is a modern systems programming language focusing on safety and speed to build reliable and efficient systems &amp;lt;ref&amp;gt; http://doc.rust-lang.org/nightly/intro.html &amp;lt;/ref&amp;gt;. It accomplishes the goals of memory safe without using garbage collection and it supports concurrency and parallelism in building platforms. &lt;br /&gt;
&lt;br /&gt;
Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://github.com/servo/servo/wiki/Design Servo] ===&lt;br /&gt;
&lt;br /&gt;
Mozilla Research team is currently working on an experimental project to develop a new Web browser engine &amp;quot;Servo&amp;quot;, that is capable of supporting a variety of current and next generation of hardware like mobile devices, multi-core processors and high-performance GPUs. Servo builds on top of Rust to provide a secure and reliable foundation. It is currently developed on 64 bit devices.&amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main objectives of this experimentation project is improving the layout to graphics rendering - to optimize for power efficiency and maximize parallelism. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
=== [http://html.spec.whatwg.org/multipage/webstorage.html#webstorage Web Storage] ===&lt;br /&gt;
The web storage specification defines the means by which a web application can store string key/value pairs in a browser and later retrieve them for use.&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage&amp;lt;/ref&amp;gt; It supports persistent data storage, similar to [http://en.wikipedia.org/wiki/HTTP_cookie cookies] but with a greatly enhanced capacity and no information stored in the [http://en.wikipedia.org/wiki/List_of_HTTP_headers HTTP request header].&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Web_storage&amp;lt;/ref&amp;gt; There are two types of web storage: [http://html.spec.whatwg.org/multipage/webstorage.html#dom-localstorage local storage] and [http://html.spec.whatwg.org/multipage/webstorage.html#dom-sessionstorage session storage].&lt;br /&gt;
&lt;br /&gt;
Browsers that support web storage have the global variables 'sessionStorage' and 'localStorage' declared at the [http://developer.mozilla.org/en-US/docs/Web/API/Window?redirectlocale=en-US&amp;amp;redirectslug=DOM%2Fwindow window] level. The following JavaScript code gives an example of how to use web storage:&lt;br /&gt;
&lt;br /&gt;
'''sessionStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on browser for duration of the session&lt;br /&gt;
sessionStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (gets deleted when browser is closed and re-opened)&lt;br /&gt;
alert(sessionStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''localStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on the browser beyond the duration of the session&lt;br /&gt;
localStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (persists even after closing and re-opening the browser)&lt;br /&gt;
alert(localStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
&lt;br /&gt;
As part of our [http://github.com/servo/servo/wiki/Storage-student-project project], we have to implement the web storage specification in the Servo browser. Implementing this important specification in Servo will allow stateful web applications to run, and will help expose any architectural problems that Servo's radical design may cause. &amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Requirement Analysis &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
In order to introduce the support for session storage and local storage in the Servo Broswer, we have to create the Storage structure and allow web pages to store data in the Servo memory space.&lt;br /&gt;
&lt;br /&gt;
Below is a high level overview of the various steps that need to be carried out to achieve this:&lt;br /&gt;
&lt;br /&gt;
* Create the Storage interface and its stub implementation.&lt;br /&gt;
* Create the WindowSessionStorage interface making it return a Storage instance.&lt;br /&gt;
* Create a Storage Task which will be used to contain all stored data.&lt;br /&gt;
* Define a message-passing interface for reading and writing stored data for a particular browser tab.&lt;br /&gt;
* Use the Storage task in the implementation of Storage.&lt;br /&gt;
* When the value of a stored data is changed, notify its respective browser tab.&lt;br /&gt;
* Pass as many [http://github.com/servo/web-platform-tests/tree/servo/webstorage tests] as possible.&lt;br /&gt;
* Implement the WindowLocalStorage interface which behaves slightly different from the WindowSessionStorage interface.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
[[File:task.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Architecture Explained ===&lt;br /&gt;
*Each box represents a Rust task.&lt;br /&gt;
*Blue boxes represent the primary tasks in the browser pipeline.&lt;br /&gt;
*Gray boxes represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
*White boxes represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
*Dashed lines indicate supervisor relationships.&lt;br /&gt;
*Solid lines indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
== Component Design ==&lt;br /&gt;
[[File:servo.jpg]]&lt;br /&gt;
&lt;br /&gt;
There will be a Storage Task which will be responsible to hold all the data that the web page requests to save. This happens via Channels in Rust, which implements a Sender Receiver protocol. The task is runnning in the background and waits to receive the data sent from the web page.&lt;br /&gt;
&lt;br /&gt;
=== Task &amp;lt;ref&amp;gt;http://doc.rust-lang.org/guide-tasks.html&amp;lt;/ref&amp;gt;===&lt;br /&gt;
Rust provides safe concurrent abstractions through a number of core library primitives. This guide will describe the concurrency model in Rust, how it relates to the Rust type system, and introduce the fundamental library abstractions for constructing concurrent programs.&lt;br /&gt;
&lt;br /&gt;
Tasks provide failure isolation and recovery. When a fatal error occurs in Rust code as a result of an explicit call to panic!(), an assertion failure, or another invalid operation, the runtime system destroys the entire task. Unlike in languages such as Java and C++, there is no way to catch an exception. Instead, tasks may monitor each other to see if they panic.&lt;br /&gt;
&lt;br /&gt;
Tasks use Rust's type system to provide strong memory safety guarantees. In particular, the type system guarantees that tasks cannot induce a data race from shared mutable state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Generate some state locally&lt;br /&gt;
let child_task_number = generate_task_number();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    // Capture it in the remote task&lt;br /&gt;
    println!(&amp;quot;I am child number {}&amp;quot;, child_task_number);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Channel ===&lt;br /&gt;
Now that we have spawned a new task, it would be nice if we could communicate with it. For this, we use channels. A channel is simply a pair of endpoints: one for sending messages and another for receiving messages.&lt;br /&gt;
&lt;br /&gt;
The simplest way to create a channel is to use the channel function to create a (Sender, Receiver) pair. In Rust parlance, a sender is a sending endpoint of a channel, and a receiver is the receiving endpoint. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
let (tx, rx): (Sender&amp;lt;int&amp;gt;, Receiver&amp;lt;int&amp;gt;) = channel();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    let result = some_expensive_computation();&lt;br /&gt;
    tx.send(result);&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
some_other_expensive_computation();&lt;br /&gt;
let result = rx.recv();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Data Design ==&lt;br /&gt;
&lt;br /&gt;
===  Data Description ===&lt;br /&gt;
&lt;br /&gt;
''The following are the data structures that will be used.''&lt;br /&gt;
&lt;br /&gt;
'''Storage''' | TreeMap&amp;lt;String,String&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''UrlMap''' | TreeMap&amp;lt;String,TreeMap&amp;lt;String,String&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
We will be using &amp;quot;Delegation Pattern&amp;quot; in our project. The Storage interface is used by web applications to access the web storage provided by the browser. However, the actual data is stored somewhere else(Servo Memory Space). So, it makes sense to create another class which will maintain the actual stored data. The Storage class can then delegate the task of storing/retrieving data to this class. We will create a class &amp;quot;WebStorageTask&amp;quot; for this purpose.&lt;br /&gt;
&lt;br /&gt;
== UML Diagrams ==&lt;br /&gt;
&lt;br /&gt;
[[File:Flow_Chart_Storage.png]][[File:Use_Case_Storage.jpg|right]]&lt;br /&gt;
&lt;br /&gt;
== Proposed Test Cases ==&lt;br /&gt;
&lt;br /&gt;
Some of the test cases which will be used to validate our changes are as follows:&lt;br /&gt;
&lt;br /&gt;
* Allow a web page to clear its session storage&lt;br /&gt;
* Allow a web page to store an item in session storage&lt;br /&gt;
* Allow a web page to retrieve stored items from its session storage&lt;br /&gt;
* Do not allow a web page to retrieve stored items from another page's session storage&lt;br /&gt;
* Check the number of items stored in session storage&lt;br /&gt;
* On removing the item from storage, it should be inaccessible&lt;br /&gt;
* Should return null as value for a key not present in the session storage&lt;br /&gt;
* Should give an error on exceeding the space limit of session storage&lt;br /&gt;
&lt;br /&gt;
The complete list of test cases can be found [http://github.com/servo/web-platform-tests/tree/servo/webstorage here].&lt;br /&gt;
&lt;br /&gt;
== Further Readings ==&lt;br /&gt;
&lt;br /&gt;
Learning Rust by Examples: http://rustbyexample.com/ &amp;lt;br/&amp;gt;&lt;br /&gt;
Javascript as Servo's Garbage Collector: http://blog.mozilla.org/research/2014/08/26/javascript-servos-only-garbage-collector/  &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92041</id>
		<title>CSC/ECE 517 Fall 2014/final design doc M1450 navr</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92041"/>
		<updated>2014-11-12T04:59:10Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: /* Proposed Test Cases */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implement Window.sessionStorage ==&lt;br /&gt;
&lt;br /&gt;
This is the design document for the task &amp;lt;code&amp;gt;[http://github.com/servo/servo/wiki/Storage-student-project Implement Window.sessionStorage]&amp;lt;/code&amp;gt; for the [http://www.mozilla.org/ Mozilla] research project [http://github.com/servo/servo/wiki/Design Servo].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== [http://www.rust-lang.org/ Rust]===&lt;br /&gt;
&lt;br /&gt;
Rust is a modern systems programming language focusing on safety and speed to build reliable and efficient systems &amp;lt;ref&amp;gt; http://doc.rust-lang.org/nightly/intro.html &amp;lt;/ref&amp;gt;. It accomplishes the goals of memory safe without using garbage collection and it supports concurrency and parallelism in building platforms. &lt;br /&gt;
&lt;br /&gt;
Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://github.com/servo/servo/wiki/Design Servo] ===&lt;br /&gt;
&lt;br /&gt;
Mozilla Research team is currently working on an experimental project to develop a new Web browser engine &amp;quot;Servo&amp;quot;, that is capable of supporting a variety of current and next generation of hardware like mobile devices, multi-core processors and high-performance GPUs. Servo builds on top of Rust to provide a secure and reliable foundation. It is currently developed on 64 bit devices.&amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main objectives of this experimentation project is improving the layout to graphics rendering - to optimize for power efficiency and maximize parallelism. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
=== [http://html.spec.whatwg.org/multipage/webstorage.html#webstorage Web Storage] ===&lt;br /&gt;
The web storage specification defines the means by which a web application can store string key/value pairs in a browser and later retrieve them for use.&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage&amp;lt;/ref&amp;gt; It supports persistent data storage, similar to [http://en.wikipedia.org/wiki/HTTP_cookie cookies] but with a greatly enhanced capacity and no information stored in the [http://en.wikipedia.org/wiki/List_of_HTTP_headers HTTP request header].&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Web_storage&amp;lt;/ref&amp;gt; There are two types of web storage: [http://html.spec.whatwg.org/multipage/webstorage.html#dom-localstorage local storage] and [http://html.spec.whatwg.org/multipage/webstorage.html#dom-sessionstorage session storage].&lt;br /&gt;
&lt;br /&gt;
Browsers that support web storage have the global variables 'sessionStorage' and 'localStorage' declared at the [http://developer.mozilla.org/en-US/docs/Web/API/Window?redirectlocale=en-US&amp;amp;redirectslug=DOM%2Fwindow window] level. The following JavaScript code gives an example of how to use web storage:&lt;br /&gt;
&lt;br /&gt;
'''sessionStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on browser for duration of the session&lt;br /&gt;
sessionStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (gets deleted when browser is closed and re-opened)&lt;br /&gt;
alert(sessionStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''localStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on the browser beyond the duration of the session&lt;br /&gt;
localStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (persists even after closing and re-opening the browser)&lt;br /&gt;
alert(localStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
&lt;br /&gt;
As part of our [http://github.com/servo/servo/wiki/Storage-student-project project], we have to implement the web storage specification in the Servo browser. Implementing this important specification in Servo will allow stateful web applications to run, and will help expose any architectural problems that Servo's radical design may cause. &amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Requirement Analysis &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
In order to introduce the support for session storage and local storage in the Servo Broswer, we have to create the Storage structure and allow web pages to store data in the Servo memory space.&lt;br /&gt;
&lt;br /&gt;
Below is a high level overview of the various steps that need to be carried out to achieve this:&lt;br /&gt;
&lt;br /&gt;
* Create the Storage interface and its stub implementation.&lt;br /&gt;
* Create the WindowSessionStorage interface making it return a Storage instance.&lt;br /&gt;
* Create a Storage Task which will be used to contain all stored data.&lt;br /&gt;
* Define a message-passing interface for reading and writing stored data for a particular browser tab.&lt;br /&gt;
* Use the Storage task in the implementation of Storage.&lt;br /&gt;
* When the value of a stored data is changed, notify its respective browser tab.&lt;br /&gt;
* Pass as many [http://github.com/servo/web-platform-tests/tree/servo/webstorage tests] as possible.&lt;br /&gt;
* Implement the WindowLocalStorage interface which behaves slightly different from the WindowSessionStorage interface.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
[[File:task.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Architecture Explained ===&lt;br /&gt;
*Each box represents a Rust task.&lt;br /&gt;
*Blue boxes represent the primary tasks in the browser pipeline.&lt;br /&gt;
*Gray boxes represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
*White boxes represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
*Dashed lines indicate supervisor relationships.&lt;br /&gt;
*Solid lines indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
== Component Design ==&lt;br /&gt;
[[File:servo.jpg]]&lt;br /&gt;
&lt;br /&gt;
There will be a Storage Task which will be responsible to hold all the data that the web page requests to save. This happens via Channels in Rust, which implements a Sender Receiver protocol. The task is runnning in the background and waits to receive the data sent from the web page.&lt;br /&gt;
&lt;br /&gt;
=== Task ===&lt;br /&gt;
Rust provides safe concurrent abstractions through a number of core library primitives. This guide will describe the concurrency model in Rust, how it relates to the Rust type system, and introduce the fundamental library abstractions for constructing concurrent programs.&lt;br /&gt;
&lt;br /&gt;
Tasks provide failure isolation and recovery. When a fatal error occurs in Rust code as a result of an explicit call to panic!(), an assertion failure, or another invalid operation, the runtime system destroys the entire task. Unlike in languages such as Java and C++, there is no way to catch an exception. Instead, tasks may monitor each other to see if they panic.&lt;br /&gt;
&lt;br /&gt;
Tasks use Rust's type system to provide strong memory safety guarantees. In particular, the type system guarantees that tasks cannot induce a data race from shared mutable state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Generate some state locally&lt;br /&gt;
let child_task_number = generate_task_number();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    // Capture it in the remote task&lt;br /&gt;
    println!(&amp;quot;I am child number {}&amp;quot;, child_task_number);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Channel ===&lt;br /&gt;
Now that we have spawned a new task, it would be nice if we could communicate with it. For this, we use channels. A channel is simply a pair of endpoints: one for sending messages and another for receiving messages.&lt;br /&gt;
&lt;br /&gt;
The simplest way to create a channel is to use the channel function to create a (Sender, Receiver) pair. In Rust parlance, a sender is a sending endpoint of a channel, and a receiver is the receiving endpoint. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
let (tx, rx): (Sender&amp;lt;int&amp;gt;, Receiver&amp;lt;int&amp;gt;) = channel();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    let result = some_expensive_computation();&lt;br /&gt;
    tx.send(result);&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
some_other_expensive_computation();&lt;br /&gt;
let result = rx.recv();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Data Design ==&lt;br /&gt;
&lt;br /&gt;
===  Data Description ===&lt;br /&gt;
&lt;br /&gt;
''The following are the data structures that will be used.''&lt;br /&gt;
&lt;br /&gt;
'''Storage''' | TreeMap&amp;lt;String,String&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''UrlMap''' | TreeMap&amp;lt;String,TreeMap&amp;lt;String,String&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
We will be using &amp;quot;Delegation Pattern&amp;quot; in our project. The Storage interface is used by web applications to access the web storage provided by the browser. However, the actual data is stored somewhere else(Servo Memory Space). So, it makes sense to create another class which will maintain the actual stored data. The Storage class can then delegate the task of storing/retrieving data to this class. We will create a class &amp;quot;WebStorageTask&amp;quot; for this purpose.&lt;br /&gt;
&lt;br /&gt;
== UML Diagrams ==&lt;br /&gt;
&lt;br /&gt;
[[File:Flow_Chart_Storage.png]][[File:Use_Case_Storage.jpg|right]]&lt;br /&gt;
&lt;br /&gt;
== Proposed Test Cases ==&lt;br /&gt;
&lt;br /&gt;
Some of the test cases which will be used to validate our changes are as follows:&lt;br /&gt;
&lt;br /&gt;
* Allow a web page to clear its session storage&lt;br /&gt;
* Allow a web page to store an item in session storage&lt;br /&gt;
* Allow a web page to retrieve stored items from its session storage&lt;br /&gt;
* Do not allow a web page to retrieve stored items from another page's session storage&lt;br /&gt;
* Check the number of items stored in session storage&lt;br /&gt;
* On removing the item from storage, it should be inaccessible&lt;br /&gt;
* Should return null as value for a key not present in the session storage&lt;br /&gt;
* Should give an error on exceeding the space limit of session storage&lt;br /&gt;
&lt;br /&gt;
The complete list of test cases can be found [http://github.com/servo/web-platform-tests/tree/servo/webstorage here].&lt;br /&gt;
&lt;br /&gt;
== Further Readings ==&lt;br /&gt;
&lt;br /&gt;
Learning Rust by Examples: http://rustbyexample.com/ &amp;lt;br/&amp;gt;&lt;br /&gt;
Javascript as Servo's Garbage Collector: http://blog.mozilla.org/research/2014/08/26/javascript-servos-only-garbage-collector/  &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92040</id>
		<title>CSC/ECE 517 Fall 2014/final design doc M1450 navr</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92040"/>
		<updated>2014-11-12T04:58:37Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: /* Proposed Test Cases */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implement Window.sessionStorage ==&lt;br /&gt;
&lt;br /&gt;
This is the design document for the task &amp;lt;code&amp;gt;[http://github.com/servo/servo/wiki/Storage-student-project Implement Window.sessionStorage]&amp;lt;/code&amp;gt; for the [http://www.mozilla.org/ Mozilla] research project [http://github.com/servo/servo/wiki/Design Servo].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== [http://www.rust-lang.org/ Rust]===&lt;br /&gt;
&lt;br /&gt;
Rust is a modern systems programming language focusing on safety and speed to build reliable and efficient systems &amp;lt;ref&amp;gt; http://doc.rust-lang.org/nightly/intro.html &amp;lt;/ref&amp;gt;. It accomplishes the goals of memory safe without using garbage collection and it supports concurrency and parallelism in building platforms. &lt;br /&gt;
&lt;br /&gt;
Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://github.com/servo/servo/wiki/Design Servo] ===&lt;br /&gt;
&lt;br /&gt;
Mozilla Research team is currently working on an experimental project to develop a new Web browser engine &amp;quot;Servo&amp;quot;, that is capable of supporting a variety of current and next generation of hardware like mobile devices, multi-core processors and high-performance GPUs. Servo builds on top of Rust to provide a secure and reliable foundation. It is currently developed on 64 bit devices.&amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main objectives of this experimentation project is improving the layout to graphics rendering - to optimize for power efficiency and maximize parallelism. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
=== [http://html.spec.whatwg.org/multipage/webstorage.html#webstorage Web Storage] ===&lt;br /&gt;
The web storage specification defines the means by which a web application can store string key/value pairs in a browser and later retrieve them for use.&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage&amp;lt;/ref&amp;gt; It supports persistent data storage, similar to [http://en.wikipedia.org/wiki/HTTP_cookie cookies] but with a greatly enhanced capacity and no information stored in the [http://en.wikipedia.org/wiki/List_of_HTTP_headers HTTP request header].&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Web_storage&amp;lt;/ref&amp;gt; There are two types of web storage: [http://html.spec.whatwg.org/multipage/webstorage.html#dom-localstorage local storage] and [http://html.spec.whatwg.org/multipage/webstorage.html#dom-sessionstorage session storage].&lt;br /&gt;
&lt;br /&gt;
Browsers that support web storage have the global variables 'sessionStorage' and 'localStorage' declared at the [http://developer.mozilla.org/en-US/docs/Web/API/Window?redirectlocale=en-US&amp;amp;redirectslug=DOM%2Fwindow window] level. The following JavaScript code gives an example of how to use web storage:&lt;br /&gt;
&lt;br /&gt;
'''sessionStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on browser for duration of the session&lt;br /&gt;
sessionStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (gets deleted when browser is closed and re-opened)&lt;br /&gt;
alert(sessionStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''localStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on the browser beyond the duration of the session&lt;br /&gt;
localStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (persists even after closing and re-opening the browser)&lt;br /&gt;
alert(localStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
&lt;br /&gt;
As part of our [http://github.com/servo/servo/wiki/Storage-student-project project], we have to implement the web storage specification in the Servo browser. Implementing this important specification in Servo will allow stateful web applications to run, and will help expose any architectural problems that Servo's radical design may cause. &amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Requirement Analysis &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
In order to introduce the support for session storage and local storage in the Servo Broswer, we have to create the Storage structure and allow web pages to store data in the Servo memory space.&lt;br /&gt;
&lt;br /&gt;
Below is a high level overview of the various steps that need to be carried out to achieve this:&lt;br /&gt;
&lt;br /&gt;
* Create the Storage interface and its stub implementation.&lt;br /&gt;
* Create the WindowSessionStorage interface making it return a Storage instance.&lt;br /&gt;
* Create a Storage Task which will be used to contain all stored data.&lt;br /&gt;
* Define a message-passing interface for reading and writing stored data for a particular browser tab.&lt;br /&gt;
* Use the Storage task in the implementation of Storage.&lt;br /&gt;
* When the value of a stored data is changed, notify its respective browser tab.&lt;br /&gt;
* Pass as many [http://github.com/servo/web-platform-tests/tree/servo/webstorage tests] as possible.&lt;br /&gt;
* Implement the WindowLocalStorage interface which behaves slightly different from the WindowSessionStorage interface.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
[[File:task.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Architecture Explained ===&lt;br /&gt;
*Each box represents a Rust task.&lt;br /&gt;
*Blue boxes represent the primary tasks in the browser pipeline.&lt;br /&gt;
*Gray boxes represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
*White boxes represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
*Dashed lines indicate supervisor relationships.&lt;br /&gt;
*Solid lines indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
== Component Design ==&lt;br /&gt;
[[File:servo.jpg]]&lt;br /&gt;
&lt;br /&gt;
There will be a Storage Task which will be responsible to hold all the data that the web page requests to save. This happens via Channels in Rust, which implements a Sender Receiver protocol. The task is runnning in the background and waits to receive the data sent from the web page.&lt;br /&gt;
&lt;br /&gt;
=== Task ===&lt;br /&gt;
Rust provides safe concurrent abstractions through a number of core library primitives. This guide will describe the concurrency model in Rust, how it relates to the Rust type system, and introduce the fundamental library abstractions for constructing concurrent programs.&lt;br /&gt;
&lt;br /&gt;
Tasks provide failure isolation and recovery. When a fatal error occurs in Rust code as a result of an explicit call to panic!(), an assertion failure, or another invalid operation, the runtime system destroys the entire task. Unlike in languages such as Java and C++, there is no way to catch an exception. Instead, tasks may monitor each other to see if they panic.&lt;br /&gt;
&lt;br /&gt;
Tasks use Rust's type system to provide strong memory safety guarantees. In particular, the type system guarantees that tasks cannot induce a data race from shared mutable state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Generate some state locally&lt;br /&gt;
let child_task_number = generate_task_number();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    // Capture it in the remote task&lt;br /&gt;
    println!(&amp;quot;I am child number {}&amp;quot;, child_task_number);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Channel ===&lt;br /&gt;
Now that we have spawned a new task, it would be nice if we could communicate with it. For this, we use channels. A channel is simply a pair of endpoints: one for sending messages and another for receiving messages.&lt;br /&gt;
&lt;br /&gt;
The simplest way to create a channel is to use the channel function to create a (Sender, Receiver) pair. In Rust parlance, a sender is a sending endpoint of a channel, and a receiver is the receiving endpoint. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
let (tx, rx): (Sender&amp;lt;int&amp;gt;, Receiver&amp;lt;int&amp;gt;) = channel();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    let result = some_expensive_computation();&lt;br /&gt;
    tx.send(result);&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
some_other_expensive_computation();&lt;br /&gt;
let result = rx.recv();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Data Design ==&lt;br /&gt;
&lt;br /&gt;
===  Data Description ===&lt;br /&gt;
&lt;br /&gt;
''The following are the data structures that will be used.''&lt;br /&gt;
&lt;br /&gt;
'''Storage''' | TreeMap&amp;lt;String,String&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''UrlMap''' | TreeMap&amp;lt;String,TreeMap&amp;lt;String,String&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
We will be using &amp;quot;Delegation Pattern&amp;quot; in our project. The Storage interface is used by web applications to access the web storage provided by the browser. However, the actual data is stored somewhere else(Servo Memory Space). So, it makes sense to create another class which will maintain the actual stored data. The Storage class can then delegate the task of storing/retrieving data to this class. We will create a class &amp;quot;WebStorageTask&amp;quot; for this purpose.&lt;br /&gt;
&lt;br /&gt;
== UML Diagrams ==&lt;br /&gt;
&lt;br /&gt;
[[File:Flow_Chart_Storage.png]][[File:Use_Case_Storage.jpg|right]]&lt;br /&gt;
&lt;br /&gt;
== Proposed Test Cases ==&lt;br /&gt;
&lt;br /&gt;
Some of the test cases which will be used to validate our changes are as follows:&lt;br /&gt;
&lt;br /&gt;
* Allow a web page to clear its session storage&lt;br /&gt;
* Allow a web page to store an item in session storage&lt;br /&gt;
* Allow a web page to retrieve stored items from its session storage&lt;br /&gt;
* Do not allow a web page to retrieve stored items from another page's session storage&lt;br /&gt;
* Check the number of items stored in session storage&lt;br /&gt;
* On removing the item from storage, it should be inaccessible&lt;br /&gt;
* Should return null as value for a key not present in the session storage&lt;br /&gt;
* Should give an error on exceeding the space limit of session storage&lt;br /&gt;
&lt;br /&gt;
The complete list of test cases can be found at [https://github.com/servo/web-platform-tests/tree/servo/webstorage Webstorage Tests].&lt;br /&gt;
&lt;br /&gt;
== Further Readings ==&lt;br /&gt;
&lt;br /&gt;
Learning Rust by Examples: http://rustbyexample.com/ &amp;lt;br/&amp;gt;&lt;br /&gt;
Javascript as Servo's Garbage Collector: http://blog.mozilla.org/research/2014/08/26/javascript-servos-only-garbage-collector/  &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92039</id>
		<title>CSC/ECE 517 Fall 2014/final design doc M1450 navr</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92039"/>
		<updated>2014-11-12T04:57:45Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: /* Proposed Test Cases */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implement Window.sessionStorage ==&lt;br /&gt;
&lt;br /&gt;
This is the design document for the task &amp;lt;code&amp;gt;[http://github.com/servo/servo/wiki/Storage-student-project Implement Window.sessionStorage]&amp;lt;/code&amp;gt; for the [http://www.mozilla.org/ Mozilla] research project [http://github.com/servo/servo/wiki/Design Servo].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== [http://www.rust-lang.org/ Rust]===&lt;br /&gt;
&lt;br /&gt;
Rust is a modern systems programming language focusing on safety and speed to build reliable and efficient systems &amp;lt;ref&amp;gt; http://doc.rust-lang.org/nightly/intro.html &amp;lt;/ref&amp;gt;. It accomplishes the goals of memory safe without using garbage collection and it supports concurrency and parallelism in building platforms. &lt;br /&gt;
&lt;br /&gt;
Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://github.com/servo/servo/wiki/Design Servo] ===&lt;br /&gt;
&lt;br /&gt;
Mozilla Research team is currently working on an experimental project to develop a new Web browser engine &amp;quot;Servo&amp;quot;, that is capable of supporting a variety of current and next generation of hardware like mobile devices, multi-core processors and high-performance GPUs. Servo builds on top of Rust to provide a secure and reliable foundation. It is currently developed on 64 bit devices.&amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main objectives of this experimentation project is improving the layout to graphics rendering - to optimize for power efficiency and maximize parallelism. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
=== [http://html.spec.whatwg.org/multipage/webstorage.html#webstorage Web Storage] ===&lt;br /&gt;
The web storage specification defines the means by which a web application can store string key/value pairs in a browser and later retrieve them for use.&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage&amp;lt;/ref&amp;gt; It supports persistent data storage, similar to [http://en.wikipedia.org/wiki/HTTP_cookie cookies] but with a greatly enhanced capacity and no information stored in the [http://en.wikipedia.org/wiki/List_of_HTTP_headers HTTP request header].&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Web_storage&amp;lt;/ref&amp;gt; There are two types of web storage: [http://html.spec.whatwg.org/multipage/webstorage.html#dom-localstorage local storage] and [http://html.spec.whatwg.org/multipage/webstorage.html#dom-sessionstorage session storage].&lt;br /&gt;
&lt;br /&gt;
Browsers that support web storage have the global variables 'sessionStorage' and 'localStorage' declared at the [http://developer.mozilla.org/en-US/docs/Web/API/Window?redirectlocale=en-US&amp;amp;redirectslug=DOM%2Fwindow window] level. The following JavaScript code gives an example of how to use web storage:&lt;br /&gt;
&lt;br /&gt;
'''sessionStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on browser for duration of the session&lt;br /&gt;
sessionStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (gets deleted when browser is closed and re-opened)&lt;br /&gt;
alert(sessionStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''localStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on the browser beyond the duration of the session&lt;br /&gt;
localStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (persists even after closing and re-opening the browser)&lt;br /&gt;
alert(localStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
&lt;br /&gt;
As part of our [http://github.com/servo/servo/wiki/Storage-student-project project], we have to implement the web storage specification in the Servo browser. Implementing this important specification in Servo will allow stateful web applications to run, and will help expose any architectural problems that Servo's radical design may cause. &amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Requirement Analysis &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
In order to introduce the support for session storage and local storage in the Servo Broswer, we have to create the Storage structure and allow web pages to store data in the Servo memory space.&lt;br /&gt;
&lt;br /&gt;
Below is a high level overview of the various steps that need to be carried out to achieve this:&lt;br /&gt;
&lt;br /&gt;
* Create the Storage interface and its stub implementation.&lt;br /&gt;
* Create the WindowSessionStorage interface making it return a Storage instance.&lt;br /&gt;
* Create a Storage Task which will be used to contain all stored data.&lt;br /&gt;
* Define a message-passing interface for reading and writing stored data for a particular browser tab.&lt;br /&gt;
* Use the Storage task in the implementation of Storage.&lt;br /&gt;
* When the value of a stored data is changed, notify its respective browser tab.&lt;br /&gt;
* Pass as many [http://github.com/servo/web-platform-tests/tree/servo/webstorage tests] as possible.&lt;br /&gt;
* Implement the WindowLocalStorage interface which behaves slightly different from the WindowSessionStorage interface.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
[[File:task.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Architecture Explained ===&lt;br /&gt;
*Each box represents a Rust task.&lt;br /&gt;
*Blue boxes represent the primary tasks in the browser pipeline.&lt;br /&gt;
*Gray boxes represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
*White boxes represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
*Dashed lines indicate supervisor relationships.&lt;br /&gt;
*Solid lines indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
== Component Design ==&lt;br /&gt;
[[File:servo.jpg]]&lt;br /&gt;
&lt;br /&gt;
There will be a Storage Task which will be responsible to hold all the data that the web page requests to save. This happens via Channels in Rust, which implements a Sender Receiver protocol. The task is runnning in the background and waits to receive the data sent from the web page.&lt;br /&gt;
&lt;br /&gt;
=== Task ===&lt;br /&gt;
Rust provides safe concurrent abstractions through a number of core library primitives. This guide will describe the concurrency model in Rust, how it relates to the Rust type system, and introduce the fundamental library abstractions for constructing concurrent programs.&lt;br /&gt;
&lt;br /&gt;
Tasks provide failure isolation and recovery. When a fatal error occurs in Rust code as a result of an explicit call to panic!(), an assertion failure, or another invalid operation, the runtime system destroys the entire task. Unlike in languages such as Java and C++, there is no way to catch an exception. Instead, tasks may monitor each other to see if they panic.&lt;br /&gt;
&lt;br /&gt;
Tasks use Rust's type system to provide strong memory safety guarantees. In particular, the type system guarantees that tasks cannot induce a data race from shared mutable state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Generate some state locally&lt;br /&gt;
let child_task_number = generate_task_number();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    // Capture it in the remote task&lt;br /&gt;
    println!(&amp;quot;I am child number {}&amp;quot;, child_task_number);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Channel ===&lt;br /&gt;
Now that we have spawned a new task, it would be nice if we could communicate with it. For this, we use channels. A channel is simply a pair of endpoints: one for sending messages and another for receiving messages.&lt;br /&gt;
&lt;br /&gt;
The simplest way to create a channel is to use the channel function to create a (Sender, Receiver) pair. In Rust parlance, a sender is a sending endpoint of a channel, and a receiver is the receiving endpoint. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
let (tx, rx): (Sender&amp;lt;int&amp;gt;, Receiver&amp;lt;int&amp;gt;) = channel();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    let result = some_expensive_computation();&lt;br /&gt;
    tx.send(result);&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
some_other_expensive_computation();&lt;br /&gt;
let result = rx.recv();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Data Design ==&lt;br /&gt;
&lt;br /&gt;
===  Data Description ===&lt;br /&gt;
&lt;br /&gt;
''The following are the data structures that will be used.''&lt;br /&gt;
&lt;br /&gt;
'''Storage''' | TreeMap&amp;lt;String,String&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''UrlMap''' | TreeMap&amp;lt;String,TreeMap&amp;lt;String,String&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
We will be using &amp;quot;Delegation Pattern&amp;quot; in our project. The Storage interface is used by web applications to access the web storage provided by the browser. However, the actual data is stored somewhere else(Servo Memory Space). So, it makes sense to create another class which will maintain the actual stored data. The Storage class can then delegate the task of storing/retrieving data to this class. We will create a class &amp;quot;WebStorageTask&amp;quot; for this purpose.&lt;br /&gt;
&lt;br /&gt;
== UML Diagrams ==&lt;br /&gt;
&lt;br /&gt;
[[File:Flow_Chart_Storage.png]][[File:Use_Case_Storage.jpg|right]]&lt;br /&gt;
&lt;br /&gt;
== Proposed Test Cases ==&lt;br /&gt;
&lt;br /&gt;
Some of the test cases which will be used to test our changes are as follows:&lt;br /&gt;
&lt;br /&gt;
* Allow a web page to clear its session storage&lt;br /&gt;
* Allow a web page to store an item in session storage&lt;br /&gt;
* Allow a web page to retrieve stored items from its session storage&lt;br /&gt;
* Do not allow a web page to retrieve stored items from another page's session storage&lt;br /&gt;
* Check the number of items stored in session storage&lt;br /&gt;
* On removing the item from storage, it should be inaccessible&lt;br /&gt;
* Should return null as value for a key not present in the session storage&lt;br /&gt;
* Should give an error on exceeding the space limit of session storage&lt;br /&gt;
&lt;br /&gt;
The complete list of test cases can be found at [https://github.com/servo/web-platform-tests/tree/servo/webstorage Webstorage Tests].&lt;br /&gt;
&lt;br /&gt;
== Further Readings ==&lt;br /&gt;
&lt;br /&gt;
Learning Rust by Examples: http://rustbyexample.com/ &amp;lt;br/&amp;gt;&lt;br /&gt;
Javascript as Servo's Garbage Collector: http://blog.mozilla.org/research/2014/08/26/javascript-servos-only-garbage-collector/  &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92038</id>
		<title>CSC/ECE 517 Fall 2014/final design doc M1450 navr</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92038"/>
		<updated>2014-11-12T04:49:30Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: /* UML diagrams (Eg use case diagram, class diagrams) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implement Window.sessionStorage ==&lt;br /&gt;
&lt;br /&gt;
This is the design document for the task &amp;lt;code&amp;gt;[http://github.com/servo/servo/wiki/Storage-student-project Implement Window.sessionStorage]&amp;lt;/code&amp;gt; for the [http://www.mozilla.org/ Mozilla] research project [http://github.com/servo/servo/wiki/Design Servo].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== [http://www.rust-lang.org/ Rust]===&lt;br /&gt;
&lt;br /&gt;
Rust is a modern systems programming language focusing on safety and speed to build reliable and efficient systems &amp;lt;ref&amp;gt; http://doc.rust-lang.org/nightly/intro.html &amp;lt;/ref&amp;gt;. It accomplishes the goals of memory safe without using garbage collection and it supports concurrency and parallelism in building platforms. &lt;br /&gt;
&lt;br /&gt;
Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://github.com/servo/servo/wiki/Design Servo] ===&lt;br /&gt;
&lt;br /&gt;
Mozilla Research team is currently working on an experimental project to develop a new Web browser engine &amp;quot;Servo&amp;quot;, that is capable of supporting a variety of current and next generation of hardware like mobile devices, multi-core processors and high-performance GPUs. Servo builds on top of Rust to provide a secure and reliable foundation. It is currently developed on 64 bit devices.&amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main objectives of this experimentation project is improving the layout to graphics rendering - to optimize for power efficiency and maximize parallelism. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
=== [http://html.spec.whatwg.org/multipage/webstorage.html#webstorage Web Storage] ===&lt;br /&gt;
The web storage specification defines the means by which a web application can store string key/value pairs in a browser and later retrieve them for use.&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage&amp;lt;/ref&amp;gt; It supports persistent data storage, similar to [http://en.wikipedia.org/wiki/HTTP_cookie cookies] but with a greatly enhanced capacity and no information stored in the [http://en.wikipedia.org/wiki/List_of_HTTP_headers HTTP request header].&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Web_storage&amp;lt;/ref&amp;gt; There are two types of web storage: [http://html.spec.whatwg.org/multipage/webstorage.html#dom-localstorage local storage] and [http://html.spec.whatwg.org/multipage/webstorage.html#dom-sessionstorage session storage].&lt;br /&gt;
&lt;br /&gt;
Browsers that support web storage have the global variables 'sessionStorage' and 'localStorage' declared at the [http://developer.mozilla.org/en-US/docs/Web/API/Window?redirectlocale=en-US&amp;amp;redirectslug=DOM%2Fwindow window] level. The following JavaScript code gives an example of how to use web storage:&lt;br /&gt;
&lt;br /&gt;
'''sessionStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on browser for duration of the session&lt;br /&gt;
sessionStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (gets deleted when browser is closed and re-opened)&lt;br /&gt;
alert(sessionStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''localStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on the browser beyond the duration of the session&lt;br /&gt;
localStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (persists even after closing and re-opening the browser)&lt;br /&gt;
alert(localStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
&lt;br /&gt;
As part of our [http://github.com/servo/servo/wiki/Storage-student-project project], we have to implement the web storage specification in the Servo browser. Implementing this important specification in Servo will allow stateful web applications to run, and will help expose any architectural problems that Servo's radical design may cause. &amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Requirement Analysis &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
In order to introduce the support for session storage and local storage in the Servo Broswer, we have to create the Storage structure and allow web pages to store data in the Servo memory space.&lt;br /&gt;
&lt;br /&gt;
Below is a high level overview of the various steps that need to be carried out to achieve this:&lt;br /&gt;
&lt;br /&gt;
* Create the Storage interface and its stub implementation.&lt;br /&gt;
* Create the WindowSessionStorage interface making it return a Storage instance.&lt;br /&gt;
* Create a Storage Task which will be used to contain all stored data.&lt;br /&gt;
* Define a message-passing interface for reading and writing stored data for a particular browser tab.&lt;br /&gt;
* Use the Storage task in the implementation of Storage.&lt;br /&gt;
* When the value of a stored data is changed, notify its respective browser tab.&lt;br /&gt;
* Pass as many [http://github.com/servo/web-platform-tests/tree/servo/webstorage tests] as possible.&lt;br /&gt;
* Implement the WindowLocalStorage interface which behaves slightly different from the WindowSessionStorage interface.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
[[File:task.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Architecture Explained ===&lt;br /&gt;
*Each box represents a Rust task.&lt;br /&gt;
*Blue boxes represent the primary tasks in the browser pipeline.&lt;br /&gt;
*Gray boxes represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
*White boxes represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
*Dashed lines indicate supervisor relationships.&lt;br /&gt;
*Solid lines indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
== Component Design ==&lt;br /&gt;
[[File:servo.jpg]]&lt;br /&gt;
&lt;br /&gt;
There will be a Storage Task which will be responsible to hold all the data that the web page requests to save. This happens via Channels in Rust, which implements a Sender Receiver protocol. The task is runnning in the background and waits to receive the data sent from the web page.&lt;br /&gt;
&lt;br /&gt;
=== Task ===&lt;br /&gt;
Rust provides safe concurrent abstractions through a number of core library primitives. This guide will describe the concurrency model in Rust, how it relates to the Rust type system, and introduce the fundamental library abstractions for constructing concurrent programs.&lt;br /&gt;
&lt;br /&gt;
Tasks provide failure isolation and recovery. When a fatal error occurs in Rust code as a result of an explicit call to panic!(), an assertion failure, or another invalid operation, the runtime system destroys the entire task. Unlike in languages such as Java and C++, there is no way to catch an exception. Instead, tasks may monitor each other to see if they panic.&lt;br /&gt;
&lt;br /&gt;
Tasks use Rust's type system to provide strong memory safety guarantees. In particular, the type system guarantees that tasks cannot induce a data race from shared mutable state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Generate some state locally&lt;br /&gt;
let child_task_number = generate_task_number();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    // Capture it in the remote task&lt;br /&gt;
    println!(&amp;quot;I am child number {}&amp;quot;, child_task_number);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Channel ===&lt;br /&gt;
Now that we have spawned a new task, it would be nice if we could communicate with it. For this, we use channels. A channel is simply a pair of endpoints: one for sending messages and another for receiving messages.&lt;br /&gt;
&lt;br /&gt;
The simplest way to create a channel is to use the channel function to create a (Sender, Receiver) pair. In Rust parlance, a sender is a sending endpoint of a channel, and a receiver is the receiving endpoint. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
let (tx, rx): (Sender&amp;lt;int&amp;gt;, Receiver&amp;lt;int&amp;gt;) = channel();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    let result = some_expensive_computation();&lt;br /&gt;
    tx.send(result);&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
some_other_expensive_computation();&lt;br /&gt;
let result = rx.recv();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Data Design ==&lt;br /&gt;
&lt;br /&gt;
===  Data Description ===&lt;br /&gt;
&lt;br /&gt;
''The following are the data structures that will be used.''&lt;br /&gt;
&lt;br /&gt;
'''Storage''' | TreeMap&amp;lt;String,String&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''UrlMap''' | TreeMap&amp;lt;String,TreeMap&amp;lt;String,String&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
We will be using &amp;quot;Delegation Pattern&amp;quot; in our project. The Storage interface is used by web applications to access the web storage provided by the browser. However, the actual data is stored somewhere else(Servo Memory Space). So, it makes sense to create another class which will maintain the actual stored data. The Storage class can then delegate the task of storing/retrieving data to this class. We will create a class &amp;quot;WebStorageTask&amp;quot; for this purpose.&lt;br /&gt;
&lt;br /&gt;
== UML Diagrams ==&lt;br /&gt;
&lt;br /&gt;
[[File:Flow_Chart_Storage.png]][[File:Use_Case_Storage.jpg|right]]&lt;br /&gt;
&lt;br /&gt;
== Proposed Test Cases ==&lt;br /&gt;
&lt;br /&gt;
To test the session storage in servo, we will be implementing the storage tasks. Some of the test cases for reference are: &lt;br /&gt;
* Clear session storage&lt;br /&gt;
* Set items in sessions storage&lt;br /&gt;
* Get stored items from session storage&lt;br /&gt;
* Check the number of items storage in session storage&lt;br /&gt;
* On removing the item from storage, it should be inaccessible&lt;br /&gt;
* Check if out of range indexes give error&lt;br /&gt;
* Access for out of range arguments as keys should return null&lt;br /&gt;
* Get an error on exceeding the limit of session storage&lt;br /&gt;
&lt;br /&gt;
You can find the detailed list of test cases at [https://github.com/servo/web-platform-tests/tree/servo/webstorage Webstorage Tests]&lt;br /&gt;
&lt;br /&gt;
== Further Readings ==&lt;br /&gt;
&lt;br /&gt;
Learning Rust by Examples: http://rustbyexample.com/ &amp;lt;br/&amp;gt;&lt;br /&gt;
Javascript as Servo's Garbage Collector: http://blog.mozilla.org/research/2014/08/26/javascript-servos-only-garbage-collector/  &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92037</id>
		<title>CSC/ECE 517 Fall 2014/final design doc M1450 navr</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92037"/>
		<updated>2014-11-12T04:48:59Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: /* Design patterns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implement Window.sessionStorage ==&lt;br /&gt;
&lt;br /&gt;
This is the design document for the task &amp;lt;code&amp;gt;[http://github.com/servo/servo/wiki/Storage-student-project Implement Window.sessionStorage]&amp;lt;/code&amp;gt; for the [http://www.mozilla.org/ Mozilla] research project [http://github.com/servo/servo/wiki/Design Servo].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== [http://www.rust-lang.org/ Rust]===&lt;br /&gt;
&lt;br /&gt;
Rust is a modern systems programming language focusing on safety and speed to build reliable and efficient systems &amp;lt;ref&amp;gt; http://doc.rust-lang.org/nightly/intro.html &amp;lt;/ref&amp;gt;. It accomplishes the goals of memory safe without using garbage collection and it supports concurrency and parallelism in building platforms. &lt;br /&gt;
&lt;br /&gt;
Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://github.com/servo/servo/wiki/Design Servo] ===&lt;br /&gt;
&lt;br /&gt;
Mozilla Research team is currently working on an experimental project to develop a new Web browser engine &amp;quot;Servo&amp;quot;, that is capable of supporting a variety of current and next generation of hardware like mobile devices, multi-core processors and high-performance GPUs. Servo builds on top of Rust to provide a secure and reliable foundation. It is currently developed on 64 bit devices.&amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main objectives of this experimentation project is improving the layout to graphics rendering - to optimize for power efficiency and maximize parallelism. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
=== [http://html.spec.whatwg.org/multipage/webstorage.html#webstorage Web Storage] ===&lt;br /&gt;
The web storage specification defines the means by which a web application can store string key/value pairs in a browser and later retrieve them for use.&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage&amp;lt;/ref&amp;gt; It supports persistent data storage, similar to [http://en.wikipedia.org/wiki/HTTP_cookie cookies] but with a greatly enhanced capacity and no information stored in the [http://en.wikipedia.org/wiki/List_of_HTTP_headers HTTP request header].&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Web_storage&amp;lt;/ref&amp;gt; There are two types of web storage: [http://html.spec.whatwg.org/multipage/webstorage.html#dom-localstorage local storage] and [http://html.spec.whatwg.org/multipage/webstorage.html#dom-sessionstorage session storage].&lt;br /&gt;
&lt;br /&gt;
Browsers that support web storage have the global variables 'sessionStorage' and 'localStorage' declared at the [http://developer.mozilla.org/en-US/docs/Web/API/Window?redirectlocale=en-US&amp;amp;redirectslug=DOM%2Fwindow window] level. The following JavaScript code gives an example of how to use web storage:&lt;br /&gt;
&lt;br /&gt;
'''sessionStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on browser for duration of the session&lt;br /&gt;
sessionStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (gets deleted when browser is closed and re-opened)&lt;br /&gt;
alert(sessionStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''localStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on the browser beyond the duration of the session&lt;br /&gt;
localStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (persists even after closing and re-opening the browser)&lt;br /&gt;
alert(localStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
&lt;br /&gt;
As part of our [http://github.com/servo/servo/wiki/Storage-student-project project], we have to implement the web storage specification in the Servo browser. Implementing this important specification in Servo will allow stateful web applications to run, and will help expose any architectural problems that Servo's radical design may cause. &amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Requirement Analysis &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
In order to introduce the support for session storage and local storage in the Servo Broswer, we have to create the Storage structure and allow web pages to store data in the Servo memory space.&lt;br /&gt;
&lt;br /&gt;
Below is a high level overview of the various steps that need to be carried out to achieve this:&lt;br /&gt;
&lt;br /&gt;
* Create the Storage interface and its stub implementation.&lt;br /&gt;
* Create the WindowSessionStorage interface making it return a Storage instance.&lt;br /&gt;
* Create a Storage Task which will be used to contain all stored data.&lt;br /&gt;
* Define a message-passing interface for reading and writing stored data for a particular browser tab.&lt;br /&gt;
* Use the Storage task in the implementation of Storage.&lt;br /&gt;
* When the value of a stored data is changed, notify its respective browser tab.&lt;br /&gt;
* Pass as many [http://github.com/servo/web-platform-tests/tree/servo/webstorage tests] as possible.&lt;br /&gt;
* Implement the WindowLocalStorage interface which behaves slightly different from the WindowSessionStorage interface.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
[[File:task.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Architecture Explained ===&lt;br /&gt;
*Each box represents a Rust task.&lt;br /&gt;
*Blue boxes represent the primary tasks in the browser pipeline.&lt;br /&gt;
*Gray boxes represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
*White boxes represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
*Dashed lines indicate supervisor relationships.&lt;br /&gt;
*Solid lines indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
== Component Design ==&lt;br /&gt;
[[File:servo.jpg]]&lt;br /&gt;
&lt;br /&gt;
There will be a Storage Task which will be responsible to hold all the data that the web page requests to save. This happens via Channels in Rust, which implements a Sender Receiver protocol. The task is runnning in the background and waits to receive the data sent from the web page.&lt;br /&gt;
&lt;br /&gt;
=== Task ===&lt;br /&gt;
Rust provides safe concurrent abstractions through a number of core library primitives. This guide will describe the concurrency model in Rust, how it relates to the Rust type system, and introduce the fundamental library abstractions for constructing concurrent programs.&lt;br /&gt;
&lt;br /&gt;
Tasks provide failure isolation and recovery. When a fatal error occurs in Rust code as a result of an explicit call to panic!(), an assertion failure, or another invalid operation, the runtime system destroys the entire task. Unlike in languages such as Java and C++, there is no way to catch an exception. Instead, tasks may monitor each other to see if they panic.&lt;br /&gt;
&lt;br /&gt;
Tasks use Rust's type system to provide strong memory safety guarantees. In particular, the type system guarantees that tasks cannot induce a data race from shared mutable state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Generate some state locally&lt;br /&gt;
let child_task_number = generate_task_number();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    // Capture it in the remote task&lt;br /&gt;
    println!(&amp;quot;I am child number {}&amp;quot;, child_task_number);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Channel ===&lt;br /&gt;
Now that we have spawned a new task, it would be nice if we could communicate with it. For this, we use channels. A channel is simply a pair of endpoints: one for sending messages and another for receiving messages.&lt;br /&gt;
&lt;br /&gt;
The simplest way to create a channel is to use the channel function to create a (Sender, Receiver) pair. In Rust parlance, a sender is a sending endpoint of a channel, and a receiver is the receiving endpoint. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
let (tx, rx): (Sender&amp;lt;int&amp;gt;, Receiver&amp;lt;int&amp;gt;) = channel();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    let result = some_expensive_computation();&lt;br /&gt;
    tx.send(result);&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
some_other_expensive_computation();&lt;br /&gt;
let result = rx.recv();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Data Design ==&lt;br /&gt;
&lt;br /&gt;
===  Data Description ===&lt;br /&gt;
&lt;br /&gt;
''The following are the data structures that will be used.''&lt;br /&gt;
&lt;br /&gt;
'''Storage''' | TreeMap&amp;lt;String,String&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''UrlMap''' | TreeMap&amp;lt;String,TreeMap&amp;lt;String,String&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
We will be using &amp;quot;Delegation Pattern&amp;quot; in our project. The Storage interface is used by web applications to access the web storage provided by the browser. However, the actual data is stored somewhere else(Servo Memory Space). So, it makes sense to create another class which will maintain the actual stored data. The Storage class can then delegate the task of storing/retrieving data to this class. We will create a class &amp;quot;WebStorageTask&amp;quot; for this purpose.&lt;br /&gt;
&lt;br /&gt;
== UML diagrams (Eg use case diagram, class diagrams) ==&lt;br /&gt;
&lt;br /&gt;
[[File:Flow_Chart_Storage.png]][[File:Use_Case_Storage.jpg|right]]&lt;br /&gt;
&lt;br /&gt;
== Proposed Test Cases ==&lt;br /&gt;
&lt;br /&gt;
To test the session storage in servo, we will be implementing the storage tasks. Some of the test cases for reference are: &lt;br /&gt;
* Clear session storage&lt;br /&gt;
* Set items in sessions storage&lt;br /&gt;
* Get stored items from session storage&lt;br /&gt;
* Check the number of items storage in session storage&lt;br /&gt;
* On removing the item from storage, it should be inaccessible&lt;br /&gt;
* Check if out of range indexes give error&lt;br /&gt;
* Access for out of range arguments as keys should return null&lt;br /&gt;
* Get an error on exceeding the limit of session storage&lt;br /&gt;
&lt;br /&gt;
You can find the detailed list of test cases at [https://github.com/servo/web-platform-tests/tree/servo/webstorage Webstorage Tests]&lt;br /&gt;
&lt;br /&gt;
== Further Readings ==&lt;br /&gt;
&lt;br /&gt;
Learning Rust by Examples: http://rustbyexample.com/ &amp;lt;br/&amp;gt;&lt;br /&gt;
Javascript as Servo's Garbage Collector: http://blog.mozilla.org/research/2014/08/26/javascript-servos-only-garbage-collector/  &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92036</id>
		<title>CSC/ECE 517 Fall 2014/final design doc M1450 navr</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92036"/>
		<updated>2014-11-12T04:48:31Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: /* Design patterns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implement Window.sessionStorage ==&lt;br /&gt;
&lt;br /&gt;
This is the design document for the task &amp;lt;code&amp;gt;[http://github.com/servo/servo/wiki/Storage-student-project Implement Window.sessionStorage]&amp;lt;/code&amp;gt; for the [http://www.mozilla.org/ Mozilla] research project [http://github.com/servo/servo/wiki/Design Servo].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== [http://www.rust-lang.org/ Rust]===&lt;br /&gt;
&lt;br /&gt;
Rust is a modern systems programming language focusing on safety and speed to build reliable and efficient systems &amp;lt;ref&amp;gt; http://doc.rust-lang.org/nightly/intro.html &amp;lt;/ref&amp;gt;. It accomplishes the goals of memory safe without using garbage collection and it supports concurrency and parallelism in building platforms. &lt;br /&gt;
&lt;br /&gt;
Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://github.com/servo/servo/wiki/Design Servo] ===&lt;br /&gt;
&lt;br /&gt;
Mozilla Research team is currently working on an experimental project to develop a new Web browser engine &amp;quot;Servo&amp;quot;, that is capable of supporting a variety of current and next generation of hardware like mobile devices, multi-core processors and high-performance GPUs. Servo builds on top of Rust to provide a secure and reliable foundation. It is currently developed on 64 bit devices.&amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main objectives of this experimentation project is improving the layout to graphics rendering - to optimize for power efficiency and maximize parallelism. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
=== [http://html.spec.whatwg.org/multipage/webstorage.html#webstorage Web Storage] ===&lt;br /&gt;
The web storage specification defines the means by which a web application can store string key/value pairs in a browser and later retrieve them for use.&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage&amp;lt;/ref&amp;gt; It supports persistent data storage, similar to [http://en.wikipedia.org/wiki/HTTP_cookie cookies] but with a greatly enhanced capacity and no information stored in the [http://en.wikipedia.org/wiki/List_of_HTTP_headers HTTP request header].&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Web_storage&amp;lt;/ref&amp;gt; There are two types of web storage: [http://html.spec.whatwg.org/multipage/webstorage.html#dom-localstorage local storage] and [http://html.spec.whatwg.org/multipage/webstorage.html#dom-sessionstorage session storage].&lt;br /&gt;
&lt;br /&gt;
Browsers that support web storage have the global variables 'sessionStorage' and 'localStorage' declared at the [http://developer.mozilla.org/en-US/docs/Web/API/Window?redirectlocale=en-US&amp;amp;redirectslug=DOM%2Fwindow window] level. The following JavaScript code gives an example of how to use web storage:&lt;br /&gt;
&lt;br /&gt;
'''sessionStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on browser for duration of the session&lt;br /&gt;
sessionStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (gets deleted when browser is closed and re-opened)&lt;br /&gt;
alert(sessionStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''localStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on the browser beyond the duration of the session&lt;br /&gt;
localStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (persists even after closing and re-opening the browser)&lt;br /&gt;
alert(localStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
&lt;br /&gt;
As part of our [http://github.com/servo/servo/wiki/Storage-student-project project], we have to implement the web storage specification in the Servo browser. Implementing this important specification in Servo will allow stateful web applications to run, and will help expose any architectural problems that Servo's radical design may cause. &amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Requirement Analysis &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
In order to introduce the support for session storage and local storage in the Servo Broswer, we have to create the Storage structure and allow web pages to store data in the Servo memory space.&lt;br /&gt;
&lt;br /&gt;
Below is a high level overview of the various steps that need to be carried out to achieve this:&lt;br /&gt;
&lt;br /&gt;
* Create the Storage interface and its stub implementation.&lt;br /&gt;
* Create the WindowSessionStorage interface making it return a Storage instance.&lt;br /&gt;
* Create a Storage Task which will be used to contain all stored data.&lt;br /&gt;
* Define a message-passing interface for reading and writing stored data for a particular browser tab.&lt;br /&gt;
* Use the Storage task in the implementation of Storage.&lt;br /&gt;
* When the value of a stored data is changed, notify its respective browser tab.&lt;br /&gt;
* Pass as many [http://github.com/servo/web-platform-tests/tree/servo/webstorage tests] as possible.&lt;br /&gt;
* Implement the WindowLocalStorage interface which behaves slightly different from the WindowSessionStorage interface.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
[[File:task.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Architecture Explained ===&lt;br /&gt;
*Each box represents a Rust task.&lt;br /&gt;
*Blue boxes represent the primary tasks in the browser pipeline.&lt;br /&gt;
*Gray boxes represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
*White boxes represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
*Dashed lines indicate supervisor relationships.&lt;br /&gt;
*Solid lines indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
== Component Design ==&lt;br /&gt;
[[File:servo.jpg]]&lt;br /&gt;
&lt;br /&gt;
There will be a Storage Task which will be responsible to hold all the data that the web page requests to save. This happens via Channels in Rust, which implements a Sender Receiver protocol. The task is runnning in the background and waits to receive the data sent from the web page.&lt;br /&gt;
&lt;br /&gt;
=== Task ===&lt;br /&gt;
Rust provides safe concurrent abstractions through a number of core library primitives. This guide will describe the concurrency model in Rust, how it relates to the Rust type system, and introduce the fundamental library abstractions for constructing concurrent programs.&lt;br /&gt;
&lt;br /&gt;
Tasks provide failure isolation and recovery. When a fatal error occurs in Rust code as a result of an explicit call to panic!(), an assertion failure, or another invalid operation, the runtime system destroys the entire task. Unlike in languages such as Java and C++, there is no way to catch an exception. Instead, tasks may monitor each other to see if they panic.&lt;br /&gt;
&lt;br /&gt;
Tasks use Rust's type system to provide strong memory safety guarantees. In particular, the type system guarantees that tasks cannot induce a data race from shared mutable state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Generate some state locally&lt;br /&gt;
let child_task_number = generate_task_number();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    // Capture it in the remote task&lt;br /&gt;
    println!(&amp;quot;I am child number {}&amp;quot;, child_task_number);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Channel ===&lt;br /&gt;
Now that we have spawned a new task, it would be nice if we could communicate with it. For this, we use channels. A channel is simply a pair of endpoints: one for sending messages and another for receiving messages.&lt;br /&gt;
&lt;br /&gt;
The simplest way to create a channel is to use the channel function to create a (Sender, Receiver) pair. In Rust parlance, a sender is a sending endpoint of a channel, and a receiver is the receiving endpoint. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
let (tx, rx): (Sender&amp;lt;int&amp;gt;, Receiver&amp;lt;int&amp;gt;) = channel();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    let result = some_expensive_computation();&lt;br /&gt;
    tx.send(result);&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
some_other_expensive_computation();&lt;br /&gt;
let result = rx.recv();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Data Design ==&lt;br /&gt;
&lt;br /&gt;
===  Data Description ===&lt;br /&gt;
&lt;br /&gt;
''The following are the data structures that will be used.''&lt;br /&gt;
&lt;br /&gt;
'''Storage''' | TreeMap&amp;lt;String,String&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''UrlMap''' | TreeMap&amp;lt;String,TreeMap&amp;lt;String,String&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
We will be using &amp;quot;Delegation Pattern&amp;quot; in our project. The Storage interface is used by web applications to access the web storage provided by the browser. However, the actual data is stored somewhere else(Servo Memory Space). So, it makes sense to create another class which will maintain the actual stored data. The Storage class can then delegate the task of storing/retrieving data to this class. We will create a class &amp;quot;WebStorageTask&amp;quot; for this purpose.&lt;br /&gt;
&lt;br /&gt;
== UML diagrams (Eg use case diagram, class diagrams) ==&lt;br /&gt;
&lt;br /&gt;
[[File:Flow_Chart_Storage.png]][[File:Use_Case_Storage.jpg|right]]&lt;br /&gt;
&lt;br /&gt;
== Proposed Test Cases ==&lt;br /&gt;
&lt;br /&gt;
To test the session storage in servo, we will be implementing the storage tasks. Some of the test cases for reference are: &lt;br /&gt;
* Clear session storage&lt;br /&gt;
* Set items in sessions storage&lt;br /&gt;
* Get stored items from session storage&lt;br /&gt;
* Check the number of items storage in session storage&lt;br /&gt;
* On removing the item from storage, it should be inaccessible&lt;br /&gt;
* Check if out of range indexes give error&lt;br /&gt;
* Access for out of range arguments as keys should return null&lt;br /&gt;
* Get an error on exceeding the limit of session storage&lt;br /&gt;
&lt;br /&gt;
You can find the detailed list of test cases at [https://github.com/servo/web-platform-tests/tree/servo/webstorage Webstorage Tests]&lt;br /&gt;
&lt;br /&gt;
== Further Readings ==&lt;br /&gt;
&lt;br /&gt;
Learning Rust by Examples: http://rustbyexample.com/ &amp;lt;br/&amp;gt;&lt;br /&gt;
Javascript as Servo's Garbage Collector: http://blog.mozilla.org/research/2014/08/26/javascript-servos-only-garbage-collector/  &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92035</id>
		<title>CSC/ECE 517 Fall 2014/final design doc M1450 navr</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92035"/>
		<updated>2014-11-12T04:44:27Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implement Window.sessionStorage ==&lt;br /&gt;
&lt;br /&gt;
This is the design document for the task &amp;lt;code&amp;gt;[http://github.com/servo/servo/wiki/Storage-student-project Implement Window.sessionStorage]&amp;lt;/code&amp;gt; for the [http://www.mozilla.org/ Mozilla] research project [http://github.com/servo/servo/wiki/Design Servo].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== [http://www.rust-lang.org/ Rust]===&lt;br /&gt;
&lt;br /&gt;
Rust is a modern systems programming language focusing on safety and speed to build reliable and efficient systems &amp;lt;ref&amp;gt; http://doc.rust-lang.org/nightly/intro.html &amp;lt;/ref&amp;gt;. It accomplishes the goals of memory safe without using garbage collection and it supports concurrency and parallelism in building platforms. &lt;br /&gt;
&lt;br /&gt;
Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://github.com/servo/servo/wiki/Design Servo] ===&lt;br /&gt;
&lt;br /&gt;
Mozilla Research team is currently working on an experimental project to develop a new Web browser engine &amp;quot;Servo&amp;quot;, that is capable of supporting a variety of current and next generation of hardware like mobile devices, multi-core processors and high-performance GPUs. Servo builds on top of Rust to provide a secure and reliable foundation. It is currently developed on 64 bit devices.&amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main objectives of this experimentation project is improving the layout to graphics rendering - to optimize for power efficiency and maximize parallelism. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
=== [http://html.spec.whatwg.org/multipage/webstorage.html#webstorage Web Storage] ===&lt;br /&gt;
The web storage specification defines the means by which a web application can store string key/value pairs in a browser and later retrieve them for use.&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage&amp;lt;/ref&amp;gt; It supports persistent data storage, similar to [http://en.wikipedia.org/wiki/HTTP_cookie cookies] but with a greatly enhanced capacity and no information stored in the [http://en.wikipedia.org/wiki/List_of_HTTP_headers HTTP request header].&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Web_storage&amp;lt;/ref&amp;gt; There are two types of web storage: [http://html.spec.whatwg.org/multipage/webstorage.html#dom-localstorage local storage] and [http://html.spec.whatwg.org/multipage/webstorage.html#dom-sessionstorage session storage].&lt;br /&gt;
&lt;br /&gt;
Browsers that support web storage have the global variables 'sessionStorage' and 'localStorage' declared at the [http://developer.mozilla.org/en-US/docs/Web/API/Window?redirectlocale=en-US&amp;amp;redirectslug=DOM%2Fwindow window] level. The following JavaScript code gives an example of how to use web storage:&lt;br /&gt;
&lt;br /&gt;
'''sessionStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on browser for duration of the session&lt;br /&gt;
sessionStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (gets deleted when browser is closed and re-opened)&lt;br /&gt;
alert(sessionStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''localStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on the browser beyond the duration of the session&lt;br /&gt;
localStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (persists even after closing and re-opening the browser)&lt;br /&gt;
alert(localStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
&lt;br /&gt;
As part of our [http://github.com/servo/servo/wiki/Storage-student-project project], we have to implement the web storage specification in the Servo browser. Implementing this important specification in Servo will allow stateful web applications to run, and will help expose any architectural problems that Servo's radical design may cause. &amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Requirement Analysis &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
In order to introduce the support for session storage and local storage in the Servo Broswer, we have to create the Storage structure and allow web pages to store data in the Servo memory space.&lt;br /&gt;
&lt;br /&gt;
Below is a high level overview of the various steps that need to be carried out to achieve this:&lt;br /&gt;
&lt;br /&gt;
* Create the Storage interface and its stub implementation.&lt;br /&gt;
* Create the WindowSessionStorage interface making it return a Storage instance.&lt;br /&gt;
* Create a Storage Task which will be used to contain all stored data.&lt;br /&gt;
* Define a message-passing interface for reading and writing stored data for a particular browser tab.&lt;br /&gt;
* Use the Storage task in the implementation of Storage.&lt;br /&gt;
* When the value of a stored data is changed, notify its respective browser tab.&lt;br /&gt;
* Pass as many [http://github.com/servo/web-platform-tests/tree/servo/webstorage tests] as possible.&lt;br /&gt;
* Implement the WindowLocalStorage interface which behaves slightly different from the WindowSessionStorage interface.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
[[File:task.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Architecture Explained ===&lt;br /&gt;
*Each box represents a Rust task.&lt;br /&gt;
*Blue boxes represent the primary tasks in the browser pipeline.&lt;br /&gt;
*Gray boxes represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
*White boxes represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
*Dashed lines indicate supervisor relationships.&lt;br /&gt;
*Solid lines indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
== Component Design ==&lt;br /&gt;
[[File:servo.jpg]]&lt;br /&gt;
&lt;br /&gt;
There will be a Storage Task which will be responsible to hold all the data that the web page requests to save. This happens via Channels in Rust, which implements a Sender Receiver protocol. The task is runnning in the background and waits to receive the data sent from the web page.&lt;br /&gt;
&lt;br /&gt;
=== Task ===&lt;br /&gt;
Rust provides safe concurrent abstractions through a number of core library primitives. This guide will describe the concurrency model in Rust, how it relates to the Rust type system, and introduce the fundamental library abstractions for constructing concurrent programs.&lt;br /&gt;
&lt;br /&gt;
Tasks provide failure isolation and recovery. When a fatal error occurs in Rust code as a result of an explicit call to panic!(), an assertion failure, or another invalid operation, the runtime system destroys the entire task. Unlike in languages such as Java and C++, there is no way to catch an exception. Instead, tasks may monitor each other to see if they panic.&lt;br /&gt;
&lt;br /&gt;
Tasks use Rust's type system to provide strong memory safety guarantees. In particular, the type system guarantees that tasks cannot induce a data race from shared mutable state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Generate some state locally&lt;br /&gt;
let child_task_number = generate_task_number();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    // Capture it in the remote task&lt;br /&gt;
    println!(&amp;quot;I am child number {}&amp;quot;, child_task_number);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Channel ===&lt;br /&gt;
Now that we have spawned a new task, it would be nice if we could communicate with it. For this, we use channels. A channel is simply a pair of endpoints: one for sending messages and another for receiving messages.&lt;br /&gt;
&lt;br /&gt;
The simplest way to create a channel is to use the channel function to create a (Sender, Receiver) pair. In Rust parlance, a sender is a sending endpoint of a channel, and a receiver is the receiving endpoint. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
let (tx, rx): (Sender&amp;lt;int&amp;gt;, Receiver&amp;lt;int&amp;gt;) = channel();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    let result = some_expensive_computation();&lt;br /&gt;
    tx.send(result);&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
some_other_expensive_computation();&lt;br /&gt;
let result = rx.recv();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Data Design ==&lt;br /&gt;
&lt;br /&gt;
===  Data Description ===&lt;br /&gt;
&lt;br /&gt;
''The following are the data structures that will be used.''&lt;br /&gt;
&lt;br /&gt;
'''Storage''' | TreeMap&amp;lt;String,String&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''UrlMap''' | TreeMap&amp;lt;String,TreeMap&amp;lt;String,String&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
We will be using &amp;quot;Delegation Pattern&amp;quot; in our project. The Storage interface is used by web applications to access the Web Storage provided by the browser. However, the actual data is stored somewhere else(Database/FileSystem/Memory). So, it makes sense to create another class which will maintain the actual stored data. The Storage class can then delegate the task of storing/retrieving data to this class. We will create a class &amp;quot;WebStorageTask&amp;quot; for this purpose.&lt;br /&gt;
&lt;br /&gt;
== UML diagrams (Eg use case diagram, class diagrams) ==&lt;br /&gt;
&lt;br /&gt;
[[File:Flow_Chart_Storage.png]][[File:Use_Case_Storage.jpg|right]]&lt;br /&gt;
&lt;br /&gt;
== Proposed Test Cases ==&lt;br /&gt;
&lt;br /&gt;
To test the session storage in servo, we will be implementing the storage tasks. Some of the test cases for reference are: &lt;br /&gt;
* Clear session storage&lt;br /&gt;
* Set items in sessions storage&lt;br /&gt;
* Get stored items from session storage&lt;br /&gt;
* Check the number of items storage in session storage&lt;br /&gt;
* On removing the item from storage, it should be inaccessible&lt;br /&gt;
* Check if out of range indexes give error&lt;br /&gt;
* Access for out of range arguments as keys should return null&lt;br /&gt;
* Get an error on exceeding the limit of session storage&lt;br /&gt;
&lt;br /&gt;
You can find the detailed list of test cases at [https://github.com/servo/web-platform-tests/tree/servo/webstorage Webstorage Tests]&lt;br /&gt;
&lt;br /&gt;
== Further Readings ==&lt;br /&gt;
&lt;br /&gt;
Learning Rust by Examples: http://rustbyexample.com/ &amp;lt;br/&amp;gt;&lt;br /&gt;
Javascript as Servo's Garbage Collector: http://blog.mozilla.org/research/2014/08/26/javascript-servos-only-garbage-collector/  &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92031</id>
		<title>CSC/ECE 517 Fall 2014/final design doc M1450 navr</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92031"/>
		<updated>2014-11-12T04:36:15Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: /* Requirement Analysis https://github.com/servo/servo/wiki/Storage-student-project */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implement Window.sessionStorage ==&lt;br /&gt;
&lt;br /&gt;
This is the design document for the task &amp;lt;code&amp;gt;[http://github.com/servo/servo/wiki/Storage-student-project Implement Window.sessionStorage]&amp;lt;/code&amp;gt; for the [http://www.mozilla.org/ Mozilla] research project [http://github.com/servo/servo/wiki/Design Servo].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== [http://www.rust-lang.org/ Rust]===&lt;br /&gt;
&lt;br /&gt;
Rust is a modern systems programming language focusing on safety and speed to build reliable and efficient systems &amp;lt;ref&amp;gt; http://doc.rust-lang.org/nightly/intro.html &amp;lt;/ref&amp;gt;. It accomplishes the goals of memory safe without using garbage collection and it supports concurrency and parallelism in building platforms. &lt;br /&gt;
&lt;br /&gt;
Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://github.com/servo/servo/wiki/Design Servo] ===&lt;br /&gt;
&lt;br /&gt;
Mozilla Research team is currently working on an experimental project to develop a new Web browser engine &amp;quot;Servo&amp;quot;, that is capable of supporting a variety of current and next generation of hardware like mobile devices, multi-core processors and high-performance GPUs. Servo builds on top of Rust to provide a secure and reliable foundation. It is currently developed on 64 bit devices.&amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main objectives of this experimentation project is improving the layout to graphics rendering - to optimize for power efficiency and maximize parallelism. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
=== [http://html.spec.whatwg.org/multipage/webstorage.html#webstorage Web Storage] ===&lt;br /&gt;
The web storage specification defines the means by which a web application can store string key/value pairs in a browser and later retrieve them for use.&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage&amp;lt;/ref&amp;gt; It supports persistent data storage, similar to [http://en.wikipedia.org/wiki/HTTP_cookie cookies] but with a greatly enhanced capacity and no information stored in the [http://en.wikipedia.org/wiki/List_of_HTTP_headers HTTP request header].&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Web_storage&amp;lt;/ref&amp;gt; There are two types of web storage: [http://html.spec.whatwg.org/multipage/webstorage.html#dom-localstorage local storage] and [http://html.spec.whatwg.org/multipage/webstorage.html#dom-sessionstorage session storage].&lt;br /&gt;
&lt;br /&gt;
Browsers that support web storage have the global variables 'sessionStorage' and 'localStorage' declared at the [http://developer.mozilla.org/en-US/docs/Web/API/Window?redirectlocale=en-US&amp;amp;redirectslug=DOM%2Fwindow window] level. The following JavaScript code gives an example of how to use web storage:&lt;br /&gt;
&lt;br /&gt;
'''sessionStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on browser for duration of the session&lt;br /&gt;
sessionStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (gets deleted when browser is closed and re-opened)&lt;br /&gt;
alert(sessionStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''localStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on the browser beyond the duration of the session&lt;br /&gt;
localStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (persists even after closing and re-opening the browser)&lt;br /&gt;
alert(localStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
&lt;br /&gt;
As part of our [http://github.com/servo/servo/wiki/Storage-student-project project], we have to implement the web storage specification in the Servo browser. Implementing this important specification in Servo will allow stateful web applications to run, and will help expose any architectural problems that Servo's radical design may cause. &amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Requirement Analysis &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
In order to introduce the support for session storage and local storage in the Servo Broswer, we have to create the Storage structure and allow web pages to store data in the Servo memory space.&lt;br /&gt;
&lt;br /&gt;
Below is a high level overview of the various steps that need to be carried out to achieve this:&lt;br /&gt;
&lt;br /&gt;
* Create the Storage interface and its stub implementation.&lt;br /&gt;
* Create the WindowSessionStorage interface making it return a Storage instance.&lt;br /&gt;
* Create a Storage Task which will be used to contain all stored data.&lt;br /&gt;
* Define a message-passing interface for reading and writing stored data for a particular browser tab.&lt;br /&gt;
* Use the Storage task in the implementation of Storage.&lt;br /&gt;
* When the value of a stored data is changed, notify its respective browser tab.&lt;br /&gt;
* Pass as many [http://github.com/servo/web-platform-tests/tree/servo/webstorage tests] as possible.&lt;br /&gt;
* Implement the WindowLocalStorage interface which behaves slightly different from the WindowSessionStorage interface.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
[[File:task.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Architecture Explained ===&lt;br /&gt;
*Each box represents a Rust task.&lt;br /&gt;
*Blue boxes represent the primary tasks in the browser pipeline.&lt;br /&gt;
*Gray boxes represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
*White boxes represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
*Dashed lines indicate supervisor relationships.&lt;br /&gt;
*Solid lines indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
The Architecture comprises of a Storage Task which will be responsible to hold all the data that the web page requests to save. This happens via Channels in Rust, which implements a Sender Receiver protocol, the task is runnning in the background and waits to receive the data sent from the web page.&lt;br /&gt;
&lt;br /&gt;
== Data Design ==&lt;br /&gt;
&lt;br /&gt;
===  Data Description ===&lt;br /&gt;
&lt;br /&gt;
''The following are the data structures that will be used.''&lt;br /&gt;
&lt;br /&gt;
'''Storage''' | TreeMap&amp;lt;String,String&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''UrlMap''' | TreeMap&amp;lt;String,TreeMap&amp;lt;String,String&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Component Design ==&lt;br /&gt;
[[File:servo.jpg]]&lt;br /&gt;
=== Task ===&lt;br /&gt;
Rust provides safe concurrent abstractions through a number of core library primitives. This guide will describe the concurrency model in Rust, how it relates to the Rust type system, and introduce the fundamental library abstractions for constructing concurrent programs.&lt;br /&gt;
&lt;br /&gt;
Tasks provide failure isolation and recovery. When a fatal error occurs in Rust code as a result of an explicit call to panic!(), an assertion failure, or another invalid operation, the runtime system destroys the entire task. Unlike in languages such as Java and C++, there is no way to catch an exception. Instead, tasks may monitor each other to see if they panic.&lt;br /&gt;
&lt;br /&gt;
Tasks use Rust's type system to provide strong memory safety guarantees. In particular, the type system guarantees that tasks cannot induce a data race from shared mutable state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Generate some state locally&lt;br /&gt;
let child_task_number = generate_task_number();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    // Capture it in the remote task&lt;br /&gt;
    println!(&amp;quot;I am child number {}&amp;quot;, child_task_number);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Channel ===&lt;br /&gt;
Now that we have spawned a new task, it would be nice if we could communicate with it. For this, we use channels. A channel is simply a pair of endpoints: one for sending messages and another for receiving messages.&lt;br /&gt;
&lt;br /&gt;
The simplest way to create a channel is to use the channel function to create a (Sender, Receiver) pair. In Rust parlance, a sender is a sending endpoint of a channel, and a receiver is the receiving endpoint. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
let (tx, rx): (Sender&amp;lt;int&amp;gt;, Receiver&amp;lt;int&amp;gt;) = channel();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    let result = some_expensive_computation();&lt;br /&gt;
    tx.send(result);&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
some_other_expensive_computation();&lt;br /&gt;
let result = rx.recv();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
We will be using &amp;quot;Delegation Pattern&amp;quot; in our project. The Storage interface is used by web applications to access the Web Storage provided by the browser. However, the actual data is stored somewhere else(Database/FileSystem/Memory). So, it makes sense to create another class which will maintain the actual stored data. The Storage class can then delegate the task of storing/retrieving data to this class. We will create a class &amp;quot;WebStorageTask&amp;quot; for this purpose.&lt;br /&gt;
&lt;br /&gt;
== UML diagrams (Eg use case diagram, class diagrams) ==&lt;br /&gt;
&lt;br /&gt;
[[File:Flow_Chart_Storage.png]][[File:Use_Case_Storage.jpg|right]]&lt;br /&gt;
&lt;br /&gt;
== Proposed Test Cases ==&lt;br /&gt;
&lt;br /&gt;
To test the session storage in servo, we will be implementing the storage tasks. Some of the test cases for reference are: &lt;br /&gt;
* Clear session storage&lt;br /&gt;
* Set items in sessions storage&lt;br /&gt;
* Get stored items from session storage&lt;br /&gt;
* Check the number of items storage in session storage&lt;br /&gt;
* On removing the item from storage, it should be inaccessible&lt;br /&gt;
* Check if out of range indexes give error&lt;br /&gt;
* Access for out of range arguments as keys should return null&lt;br /&gt;
* Get an error on exceeding the limit of session storage&lt;br /&gt;
&lt;br /&gt;
You can find the detailed list of test cases at [https://github.com/servo/web-platform-tests/tree/servo/webstorage Webstorage Tests]&lt;br /&gt;
&lt;br /&gt;
== Further Readings ==&lt;br /&gt;
&lt;br /&gt;
Learning Rust by Examples: http://rustbyexample.com/ &amp;lt;br/&amp;gt;&lt;br /&gt;
Javascript as Servo's Garbage Collector: http://blog.mozilla.org/research/2014/08/26/javascript-servos-only-garbage-collector/  &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92030</id>
		<title>CSC/ECE 517 Fall 2014/final design doc M1450 navr</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92030"/>
		<updated>2014-11-12T04:35:20Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: /* Requirement Analysis https://github.com/servo/servo/wiki/Storage-student-project */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implement Window.sessionStorage ==&lt;br /&gt;
&lt;br /&gt;
This is the design document for the task &amp;lt;code&amp;gt;[http://github.com/servo/servo/wiki/Storage-student-project Implement Window.sessionStorage]&amp;lt;/code&amp;gt; for the [http://www.mozilla.org/ Mozilla] research project [http://github.com/servo/servo/wiki/Design Servo].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== [http://www.rust-lang.org/ Rust]===&lt;br /&gt;
&lt;br /&gt;
Rust is a modern systems programming language focusing on safety and speed to build reliable and efficient systems &amp;lt;ref&amp;gt; http://doc.rust-lang.org/nightly/intro.html &amp;lt;/ref&amp;gt;. It accomplishes the goals of memory safe without using garbage collection and it supports concurrency and parallelism in building platforms. &lt;br /&gt;
&lt;br /&gt;
Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://github.com/servo/servo/wiki/Design Servo] ===&lt;br /&gt;
&lt;br /&gt;
Mozilla Research team is currently working on an experimental project to develop a new Web browser engine &amp;quot;Servo&amp;quot;, that is capable of supporting a variety of current and next generation of hardware like mobile devices, multi-core processors and high-performance GPUs. Servo builds on top of Rust to provide a secure and reliable foundation. It is currently developed on 64 bit devices.&amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main objectives of this experimentation project is improving the layout to graphics rendering - to optimize for power efficiency and maximize parallelism. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
=== [http://html.spec.whatwg.org/multipage/webstorage.html#webstorage Web Storage] ===&lt;br /&gt;
The web storage specification defines the means by which a web application can store string key/value pairs in a browser and later retrieve them for use.&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage&amp;lt;/ref&amp;gt; It supports persistent data storage, similar to [http://en.wikipedia.org/wiki/HTTP_cookie cookies] but with a greatly enhanced capacity and no information stored in the [http://en.wikipedia.org/wiki/List_of_HTTP_headers HTTP request header].&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Web_storage&amp;lt;/ref&amp;gt; There are two types of web storage: [http://html.spec.whatwg.org/multipage/webstorage.html#dom-localstorage local storage] and [http://html.spec.whatwg.org/multipage/webstorage.html#dom-sessionstorage session storage].&lt;br /&gt;
&lt;br /&gt;
Browsers that support web storage have the global variables 'sessionStorage' and 'localStorage' declared at the [http://developer.mozilla.org/en-US/docs/Web/API/Window?redirectlocale=en-US&amp;amp;redirectslug=DOM%2Fwindow window] level. The following JavaScript code gives an example of how to use web storage:&lt;br /&gt;
&lt;br /&gt;
'''sessionStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on browser for duration of the session&lt;br /&gt;
sessionStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (gets deleted when browser is closed and re-opened)&lt;br /&gt;
alert(sessionStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''localStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on the browser beyond the duration of the session&lt;br /&gt;
localStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (persists even after closing and re-opening the browser)&lt;br /&gt;
alert(localStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
&lt;br /&gt;
As part of our [http://github.com/servo/servo/wiki/Storage-student-project project], we have to implement the web storage specification in the Servo browser. Implementing this important specification in Servo will allow stateful web applications to run, and will help expose any architectural problems that Servo's radical design may cause. &amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Requirement Analysis &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
In order to introduce the support for session storage and local storage in the Servo Broswer, we have to create the Storage structure and allow web pages to store data in the Servo memory space.&lt;br /&gt;
&lt;br /&gt;
Below is a high level overview of the various steps that need to be carried out to achieve this:&lt;br /&gt;
&lt;br /&gt;
* Create the Storage interface and its stub implementation.&lt;br /&gt;
* Create the WindowSessionStorage interface making it return a Storage instance.&lt;br /&gt;
* Create a Storage Task which will be used to contain all stored data.&lt;br /&gt;
* Define a message-passing interface for reading and writing stored data for a particular browser tab.&lt;br /&gt;
* Use the Storage task in the implementation of Storage.&lt;br /&gt;
* When the value of a stored data is changed, notify its respective browser tab.&lt;br /&gt;
* Pass as many tests as possible.&lt;br /&gt;
* Implement the WindowLocalStorage interface which behaves slightly different from the WindowSessionStorage interface.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
[[File:task.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Architecture Explained ===&lt;br /&gt;
*Each box represents a Rust task.&lt;br /&gt;
*Blue boxes represent the primary tasks in the browser pipeline.&lt;br /&gt;
*Gray boxes represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
*White boxes represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
*Dashed lines indicate supervisor relationships.&lt;br /&gt;
*Solid lines indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
The Architecture comprises of a Storage Task which will be responsible to hold all the data that the web page requests to save. This happens via Channels in Rust, which implements a Sender Receiver protocol, the task is runnning in the background and waits to receive the data sent from the web page.&lt;br /&gt;
&lt;br /&gt;
== Data Design ==&lt;br /&gt;
&lt;br /&gt;
===  Data Description ===&lt;br /&gt;
&lt;br /&gt;
''The following are the data structures that will be used.''&lt;br /&gt;
&lt;br /&gt;
'''Storage''' | TreeMap&amp;lt;String,String&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''UrlMap''' | TreeMap&amp;lt;String,TreeMap&amp;lt;String,String&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Component Design ==&lt;br /&gt;
[[File:servo.jpg]]&lt;br /&gt;
=== Task ===&lt;br /&gt;
Rust provides safe concurrent abstractions through a number of core library primitives. This guide will describe the concurrency model in Rust, how it relates to the Rust type system, and introduce the fundamental library abstractions for constructing concurrent programs.&lt;br /&gt;
&lt;br /&gt;
Tasks provide failure isolation and recovery. When a fatal error occurs in Rust code as a result of an explicit call to panic!(), an assertion failure, or another invalid operation, the runtime system destroys the entire task. Unlike in languages such as Java and C++, there is no way to catch an exception. Instead, tasks may monitor each other to see if they panic.&lt;br /&gt;
&lt;br /&gt;
Tasks use Rust's type system to provide strong memory safety guarantees. In particular, the type system guarantees that tasks cannot induce a data race from shared mutable state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Generate some state locally&lt;br /&gt;
let child_task_number = generate_task_number();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    // Capture it in the remote task&lt;br /&gt;
    println!(&amp;quot;I am child number {}&amp;quot;, child_task_number);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Channel ===&lt;br /&gt;
Now that we have spawned a new task, it would be nice if we could communicate with it. For this, we use channels. A channel is simply a pair of endpoints: one for sending messages and another for receiving messages.&lt;br /&gt;
&lt;br /&gt;
The simplest way to create a channel is to use the channel function to create a (Sender, Receiver) pair. In Rust parlance, a sender is a sending endpoint of a channel, and a receiver is the receiving endpoint. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
let (tx, rx): (Sender&amp;lt;int&amp;gt;, Receiver&amp;lt;int&amp;gt;) = channel();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    let result = some_expensive_computation();&lt;br /&gt;
    tx.send(result);&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
some_other_expensive_computation();&lt;br /&gt;
let result = rx.recv();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
We will be using &amp;quot;Delegation Pattern&amp;quot; in our project. The Storage interface is used by web applications to access the Web Storage provided by the browser. However, the actual data is stored somewhere else(Database/FileSystem/Memory). So, it makes sense to create another class which will maintain the actual stored data. The Storage class can then delegate the task of storing/retrieving data to this class. We will create a class &amp;quot;WebStorageTask&amp;quot; for this purpose.&lt;br /&gt;
&lt;br /&gt;
== UML diagrams (Eg use case diagram, class diagrams) ==&lt;br /&gt;
&lt;br /&gt;
[[File:Flow_Chart_Storage.png]][[File:Use_Case_Storage.jpg|right]]&lt;br /&gt;
&lt;br /&gt;
== Proposed Test Cases ==&lt;br /&gt;
&lt;br /&gt;
To test the session storage in servo, we will be implementing the storage tasks. Some of the test cases for reference are: &lt;br /&gt;
* Clear session storage&lt;br /&gt;
* Set items in sessions storage&lt;br /&gt;
* Get stored items from session storage&lt;br /&gt;
* Check the number of items storage in session storage&lt;br /&gt;
* On removing the item from storage, it should be inaccessible&lt;br /&gt;
* Check if out of range indexes give error&lt;br /&gt;
* Access for out of range arguments as keys should return null&lt;br /&gt;
* Get an error on exceeding the limit of session storage&lt;br /&gt;
&lt;br /&gt;
You can find the detailed list of test cases at [https://github.com/servo/web-platform-tests/tree/servo/webstorage Webstorage Tests]&lt;br /&gt;
&lt;br /&gt;
== Further Readings ==&lt;br /&gt;
&lt;br /&gt;
Learning Rust by Examples: http://rustbyexample.com/ &amp;lt;br/&amp;gt;&lt;br /&gt;
Javascript as Servo's Garbage Collector: http://blog.mozilla.org/research/2014/08/26/javascript-servos-only-garbage-collector/  &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92029</id>
		<title>CSC/ECE 517 Fall 2014/final design doc M1450 navr</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92029"/>
		<updated>2014-11-12T04:34:25Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: /* Project Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implement Window.sessionStorage ==&lt;br /&gt;
&lt;br /&gt;
This is the design document for the task &amp;lt;code&amp;gt;[http://github.com/servo/servo/wiki/Storage-student-project Implement Window.sessionStorage]&amp;lt;/code&amp;gt; for the [http://www.mozilla.org/ Mozilla] research project [http://github.com/servo/servo/wiki/Design Servo].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== [http://www.rust-lang.org/ Rust]===&lt;br /&gt;
&lt;br /&gt;
Rust is a modern systems programming language focusing on safety and speed to build reliable and efficient systems &amp;lt;ref&amp;gt; http://doc.rust-lang.org/nightly/intro.html &amp;lt;/ref&amp;gt;. It accomplishes the goals of memory safe without using garbage collection and it supports concurrency and parallelism in building platforms. &lt;br /&gt;
&lt;br /&gt;
Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://github.com/servo/servo/wiki/Design Servo] ===&lt;br /&gt;
&lt;br /&gt;
Mozilla Research team is currently working on an experimental project to develop a new Web browser engine &amp;quot;Servo&amp;quot;, that is capable of supporting a variety of current and next generation of hardware like mobile devices, multi-core processors and high-performance GPUs. Servo builds on top of Rust to provide a secure and reliable foundation. It is currently developed on 64 bit devices.&amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main objectives of this experimentation project is improving the layout to graphics rendering - to optimize for power efficiency and maximize parallelism. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
=== [http://html.spec.whatwg.org/multipage/webstorage.html#webstorage Web Storage] ===&lt;br /&gt;
The web storage specification defines the means by which a web application can store string key/value pairs in a browser and later retrieve them for use.&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage&amp;lt;/ref&amp;gt; It supports persistent data storage, similar to [http://en.wikipedia.org/wiki/HTTP_cookie cookies] but with a greatly enhanced capacity and no information stored in the [http://en.wikipedia.org/wiki/List_of_HTTP_headers HTTP request header].&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Web_storage&amp;lt;/ref&amp;gt; There are two types of web storage: [http://html.spec.whatwg.org/multipage/webstorage.html#dom-localstorage local storage] and [http://html.spec.whatwg.org/multipage/webstorage.html#dom-sessionstorage session storage].&lt;br /&gt;
&lt;br /&gt;
Browsers that support web storage have the global variables 'sessionStorage' and 'localStorage' declared at the [http://developer.mozilla.org/en-US/docs/Web/API/Window?redirectlocale=en-US&amp;amp;redirectslug=DOM%2Fwindow window] level. The following JavaScript code gives an example of how to use web storage:&lt;br /&gt;
&lt;br /&gt;
'''sessionStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on browser for duration of the session&lt;br /&gt;
sessionStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (gets deleted when browser is closed and re-opened)&lt;br /&gt;
alert(sessionStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''localStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on the browser beyond the duration of the session&lt;br /&gt;
localStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (persists even after closing and re-opening the browser)&lt;br /&gt;
alert(localStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
&lt;br /&gt;
As part of our [http://github.com/servo/servo/wiki/Storage-student-project project], we have to implement the web storage specification in the Servo browser. Implementing this important specification in Servo will allow stateful web applications to run, and will help expose any architectural problems that Servo's radical design may cause. &amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Requirement Analysis &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
In order to introduce the support for sessionstorage and localstorage in the Servo Broswer, we have to create the Storage structure and allow web pages to store data in the Servo memory space.&lt;br /&gt;
&lt;br /&gt;
Below is a high level overview of the various steps that need to be carried out to achieve this:&lt;br /&gt;
&lt;br /&gt;
* Create the Storage interface and its stub implementation.&lt;br /&gt;
* Create the WindowSessionStorage interface making it return a Storage instance.&lt;br /&gt;
* Create a Storage Task which will be used to contain all stored data.&lt;br /&gt;
* Define a message-passing interface for reading and writing stored data for a particular browser tab.&lt;br /&gt;
* Use the Storage task in the implementation of Storage.&lt;br /&gt;
* When the value of a stored data is changed, notify its respective browser tab.&lt;br /&gt;
* Pass as many tests as possible.&lt;br /&gt;
* Implement the WindowLocalStorage interface which behaves slightly different from the WindowSessionStorage interface.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
[[File:task.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Architecture Explained ===&lt;br /&gt;
*Each box represents a Rust task.&lt;br /&gt;
*Blue boxes represent the primary tasks in the browser pipeline.&lt;br /&gt;
*Gray boxes represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
*White boxes represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
*Dashed lines indicate supervisor relationships.&lt;br /&gt;
*Solid lines indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
The Architecture comprises of a Storage Task which will be responsible to hold all the data that the web page requests to save. This happens via Channels in Rust, which implements a Sender Receiver protocol, the task is runnning in the background and waits to receive the data sent from the web page.&lt;br /&gt;
&lt;br /&gt;
== Data Design ==&lt;br /&gt;
&lt;br /&gt;
===  Data Description ===&lt;br /&gt;
&lt;br /&gt;
''The following are the data structures that will be used.''&lt;br /&gt;
&lt;br /&gt;
'''Storage''' | TreeMap&amp;lt;String,String&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''UrlMap''' | TreeMap&amp;lt;String,TreeMap&amp;lt;String,String&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Component Design ==&lt;br /&gt;
[[File:servo.jpg]]&lt;br /&gt;
=== Task ===&lt;br /&gt;
Rust provides safe concurrent abstractions through a number of core library primitives. This guide will describe the concurrency model in Rust, how it relates to the Rust type system, and introduce the fundamental library abstractions for constructing concurrent programs.&lt;br /&gt;
&lt;br /&gt;
Tasks provide failure isolation and recovery. When a fatal error occurs in Rust code as a result of an explicit call to panic!(), an assertion failure, or another invalid operation, the runtime system destroys the entire task. Unlike in languages such as Java and C++, there is no way to catch an exception. Instead, tasks may monitor each other to see if they panic.&lt;br /&gt;
&lt;br /&gt;
Tasks use Rust's type system to provide strong memory safety guarantees. In particular, the type system guarantees that tasks cannot induce a data race from shared mutable state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Generate some state locally&lt;br /&gt;
let child_task_number = generate_task_number();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    // Capture it in the remote task&lt;br /&gt;
    println!(&amp;quot;I am child number {}&amp;quot;, child_task_number);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Channel ===&lt;br /&gt;
Now that we have spawned a new task, it would be nice if we could communicate with it. For this, we use channels. A channel is simply a pair of endpoints: one for sending messages and another for receiving messages.&lt;br /&gt;
&lt;br /&gt;
The simplest way to create a channel is to use the channel function to create a (Sender, Receiver) pair. In Rust parlance, a sender is a sending endpoint of a channel, and a receiver is the receiving endpoint. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
let (tx, rx): (Sender&amp;lt;int&amp;gt;, Receiver&amp;lt;int&amp;gt;) = channel();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    let result = some_expensive_computation();&lt;br /&gt;
    tx.send(result);&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
some_other_expensive_computation();&lt;br /&gt;
let result = rx.recv();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
We will be using &amp;quot;Delegation Pattern&amp;quot; in our project. The Storage interface is used by web applications to access the Web Storage provided by the browser. However, the actual data is stored somewhere else(Database/FileSystem/Memory). So, it makes sense to create another class which will maintain the actual stored data. The Storage class can then delegate the task of storing/retrieving data to this class. We will create a class &amp;quot;WebStorageTask&amp;quot; for this purpose.&lt;br /&gt;
&lt;br /&gt;
== UML diagrams (Eg use case diagram, class diagrams) ==&lt;br /&gt;
&lt;br /&gt;
[[File:Flow_Chart_Storage.png]][[File:Use_Case_Storage.jpg|right]]&lt;br /&gt;
&lt;br /&gt;
== Proposed Test Cases ==&lt;br /&gt;
&lt;br /&gt;
To test the session storage in servo, we will be implementing the storage tasks. Some of the test cases for reference are: &lt;br /&gt;
* Clear session storage&lt;br /&gt;
* Set items in sessions storage&lt;br /&gt;
* Get stored items from session storage&lt;br /&gt;
* Check the number of items storage in session storage&lt;br /&gt;
* On removing the item from storage, it should be inaccessible&lt;br /&gt;
* Check if out of range indexes give error&lt;br /&gt;
* Access for out of range arguments as keys should return null&lt;br /&gt;
* Get an error on exceeding the limit of session storage&lt;br /&gt;
&lt;br /&gt;
You can find the detailed list of test cases at [https://github.com/servo/web-platform-tests/tree/servo/webstorage Webstorage Tests]&lt;br /&gt;
&lt;br /&gt;
== Further Readings ==&lt;br /&gt;
&lt;br /&gt;
Learning Rust by Examples: http://rustbyexample.com/ &amp;lt;br/&amp;gt;&lt;br /&gt;
Javascript as Servo's Garbage Collector: http://blog.mozilla.org/research/2014/08/26/javascript-servos-only-garbage-collector/  &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92027</id>
		<title>CSC/ECE 517 Fall 2014/final design doc M1450 navr</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92027"/>
		<updated>2014-11-12T04:33:27Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: /* Web Storage */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implement Window.sessionStorage ==&lt;br /&gt;
&lt;br /&gt;
This is the design document for the task &amp;lt;code&amp;gt;[http://github.com/servo/servo/wiki/Storage-student-project Implement Window.sessionStorage]&amp;lt;/code&amp;gt; for the [http://www.mozilla.org/ Mozilla] research project [http://github.com/servo/servo/wiki/Design Servo].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== [http://www.rust-lang.org/ Rust]===&lt;br /&gt;
&lt;br /&gt;
Rust is a modern systems programming language focusing on safety and speed to build reliable and efficient systems &amp;lt;ref&amp;gt; http://doc.rust-lang.org/nightly/intro.html &amp;lt;/ref&amp;gt;. It accomplishes the goals of memory safe without using garbage collection and it supports concurrency and parallelism in building platforms. &lt;br /&gt;
&lt;br /&gt;
Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://github.com/servo/servo/wiki/Design Servo] ===&lt;br /&gt;
&lt;br /&gt;
Mozilla Research team is currently working on an experimental project to develop a new Web browser engine &amp;quot;Servo&amp;quot;, that is capable of supporting a variety of current and next generation of hardware like mobile devices, multi-core processors and high-performance GPUs. Servo builds on top of Rust to provide a secure and reliable foundation. It is currently developed on 64 bit devices.&amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main objectives of this experimentation project is improving the layout to graphics rendering - to optimize for power efficiency and maximize parallelism. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
=== [http://html.spec.whatwg.org/multipage/webstorage.html#webstorage Web Storage] ===&lt;br /&gt;
The web storage specification defines the means by which a web application can store string key/value pairs in a browser and later retrieve them for use.&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage&amp;lt;/ref&amp;gt; It supports persistent data storage, similar to [http://en.wikipedia.org/wiki/HTTP_cookie cookies] but with a greatly enhanced capacity and no information stored in the [http://en.wikipedia.org/wiki/List_of_HTTP_headers HTTP request header].&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Web_storage&amp;lt;/ref&amp;gt; There are two types of web storage: [http://html.spec.whatwg.org/multipage/webstorage.html#dom-localstorage local storage] and [http://html.spec.whatwg.org/multipage/webstorage.html#dom-sessionstorage session storage].&lt;br /&gt;
&lt;br /&gt;
Browsers that support web storage have the global variables 'sessionStorage' and 'localStorage' declared at the [http://developer.mozilla.org/en-US/docs/Web/API/Window?redirectlocale=en-US&amp;amp;redirectslug=DOM%2Fwindow window] level. The following JavaScript code gives an example of how to use web storage:&lt;br /&gt;
&lt;br /&gt;
'''sessionStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on browser for duration of the session&lt;br /&gt;
sessionStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (gets deleted when browser is closed and re-opened)&lt;br /&gt;
alert(sessionStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''localStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on the browser beyond the duration of the session&lt;br /&gt;
localStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (persists even after closing and re-opening the browser)&lt;br /&gt;
alert(localStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
&lt;br /&gt;
As part of our [http://github.com/servo/servo/wiki/Storage-student-project project], we have to implement this specification in the Servo browser. Implementing this important specification in Servo will allow stateful web applications to run, and will help expose any architectural problems that Servo's radical design may cause. &amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Requirement Analysis &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
In order to introduce the support for sessionstorage and localstorage in the Servo Broswer, we have to create the Storage structure and allow web pages to store data in the Servo memory space.&lt;br /&gt;
&lt;br /&gt;
Below is a high level overview of the various steps that need to be carried out to achieve this:&lt;br /&gt;
&lt;br /&gt;
* Create the Storage interface and its stub implementation.&lt;br /&gt;
* Create the WindowSessionStorage interface making it return a Storage instance.&lt;br /&gt;
* Create a Storage Task which will be used to contain all stored data.&lt;br /&gt;
* Define a message-passing interface for reading and writing stored data for a particular browser tab.&lt;br /&gt;
* Use the Storage task in the implementation of Storage.&lt;br /&gt;
* When the value of a stored data is changed, notify its respective browser tab.&lt;br /&gt;
* Pass as many tests as possible.&lt;br /&gt;
* Implement the WindowLocalStorage interface which behaves slightly different from the WindowSessionStorage interface.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
[[File:task.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Architecture Explained ===&lt;br /&gt;
*Each box represents a Rust task.&lt;br /&gt;
*Blue boxes represent the primary tasks in the browser pipeline.&lt;br /&gt;
*Gray boxes represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
*White boxes represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
*Dashed lines indicate supervisor relationships.&lt;br /&gt;
*Solid lines indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
The Architecture comprises of a Storage Task which will be responsible to hold all the data that the web page requests to save. This happens via Channels in Rust, which implements a Sender Receiver protocol, the task is runnning in the background and waits to receive the data sent from the web page.&lt;br /&gt;
&lt;br /&gt;
== Data Design ==&lt;br /&gt;
&lt;br /&gt;
===  Data Description ===&lt;br /&gt;
&lt;br /&gt;
''The following are the data structures that will be used.''&lt;br /&gt;
&lt;br /&gt;
'''Storage''' | TreeMap&amp;lt;String,String&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''UrlMap''' | TreeMap&amp;lt;String,TreeMap&amp;lt;String,String&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Component Design ==&lt;br /&gt;
[[File:servo.jpg]]&lt;br /&gt;
=== Task ===&lt;br /&gt;
Rust provides safe concurrent abstractions through a number of core library primitives. This guide will describe the concurrency model in Rust, how it relates to the Rust type system, and introduce the fundamental library abstractions for constructing concurrent programs.&lt;br /&gt;
&lt;br /&gt;
Tasks provide failure isolation and recovery. When a fatal error occurs in Rust code as a result of an explicit call to panic!(), an assertion failure, or another invalid operation, the runtime system destroys the entire task. Unlike in languages such as Java and C++, there is no way to catch an exception. Instead, tasks may monitor each other to see if they panic.&lt;br /&gt;
&lt;br /&gt;
Tasks use Rust's type system to provide strong memory safety guarantees. In particular, the type system guarantees that tasks cannot induce a data race from shared mutable state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Generate some state locally&lt;br /&gt;
let child_task_number = generate_task_number();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    // Capture it in the remote task&lt;br /&gt;
    println!(&amp;quot;I am child number {}&amp;quot;, child_task_number);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Channel ===&lt;br /&gt;
Now that we have spawned a new task, it would be nice if we could communicate with it. For this, we use channels. A channel is simply a pair of endpoints: one for sending messages and another for receiving messages.&lt;br /&gt;
&lt;br /&gt;
The simplest way to create a channel is to use the channel function to create a (Sender, Receiver) pair. In Rust parlance, a sender is a sending endpoint of a channel, and a receiver is the receiving endpoint. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
let (tx, rx): (Sender&amp;lt;int&amp;gt;, Receiver&amp;lt;int&amp;gt;) = channel();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    let result = some_expensive_computation();&lt;br /&gt;
    tx.send(result);&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
some_other_expensive_computation();&lt;br /&gt;
let result = rx.recv();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
We will be using &amp;quot;Delegation Pattern&amp;quot; in our project. The Storage interface is used by web applications to access the Web Storage provided by the browser. However, the actual data is stored somewhere else(Database/FileSystem/Memory). So, it makes sense to create another class which will maintain the actual stored data. The Storage class can then delegate the task of storing/retrieving data to this class. We will create a class &amp;quot;WebStorageTask&amp;quot; for this purpose.&lt;br /&gt;
&lt;br /&gt;
== UML diagrams (Eg use case diagram, class diagrams) ==&lt;br /&gt;
&lt;br /&gt;
[[File:Flow_Chart_Storage.png]][[File:Use_Case_Storage.jpg|right]]&lt;br /&gt;
&lt;br /&gt;
== Proposed Test Cases ==&lt;br /&gt;
&lt;br /&gt;
To test the session storage in servo, we will be implementing the storage tasks. Some of the test cases for reference are: &lt;br /&gt;
* Clear session storage&lt;br /&gt;
* Set items in sessions storage&lt;br /&gt;
* Get stored items from session storage&lt;br /&gt;
* Check the number of items storage in session storage&lt;br /&gt;
* On removing the item from storage, it should be inaccessible&lt;br /&gt;
* Check if out of range indexes give error&lt;br /&gt;
* Access for out of range arguments as keys should return null&lt;br /&gt;
* Get an error on exceeding the limit of session storage&lt;br /&gt;
&lt;br /&gt;
You can find the detailed list of test cases at [https://github.com/servo/web-platform-tests/tree/servo/webstorage Webstorage Tests]&lt;br /&gt;
&lt;br /&gt;
== Further Readings ==&lt;br /&gt;
&lt;br /&gt;
Learning Rust by Examples: http://rustbyexample.com/ &amp;lt;br/&amp;gt;&lt;br /&gt;
Javascript as Servo's Garbage Collector: http://blog.mozilla.org/research/2014/08/26/javascript-servos-only-garbage-collector/  &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92026</id>
		<title>CSC/ECE 517 Fall 2014/final design doc M1450 navr</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92026"/>
		<updated>2014-11-12T04:32:43Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: /* Background */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implement Window.sessionStorage ==&lt;br /&gt;
&lt;br /&gt;
This is the design document for the task &amp;lt;code&amp;gt;[http://github.com/servo/servo/wiki/Storage-student-project Implement Window.sessionStorage]&amp;lt;/code&amp;gt; for the [http://www.mozilla.org/ Mozilla] research project [http://github.com/servo/servo/wiki/Design Servo].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== [http://www.rust-lang.org/ Rust]===&lt;br /&gt;
&lt;br /&gt;
Rust is a modern systems programming language focusing on safety and speed to build reliable and efficient systems &amp;lt;ref&amp;gt; http://doc.rust-lang.org/nightly/intro.html &amp;lt;/ref&amp;gt;. It accomplishes the goals of memory safe without using garbage collection and it supports concurrency and parallelism in building platforms. &lt;br /&gt;
&lt;br /&gt;
Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://github.com/servo/servo/wiki/Design Servo] ===&lt;br /&gt;
&lt;br /&gt;
Mozilla Research team is currently working on an experimental project to develop a new Web browser engine &amp;quot;Servo&amp;quot;, that is capable of supporting a variety of current and next generation of hardware like mobile devices, multi-core processors and high-performance GPUs. Servo builds on top of Rust to provide a secure and reliable foundation. It is currently developed on 64 bit devices.&amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main objectives of this experimentation project is improving the layout to graphics rendering - to optimize for power efficiency and maximize parallelism. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
=== [http://html.spec.whatwg.org/multipage/webstorage.html#webstorage Web Storage] ===&lt;br /&gt;
The Web Storage specification defines the means by which a web application can store string key/value pairs in a browser and later retrieve them for use.&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage&amp;lt;/ref&amp;gt; It supports persistent data storage, similar to [http://en.wikipedia.org/wiki/HTTP_cookie cookies] but with a greatly enhanced capacity and no information stored in the [http://en.wikipedia.org/wiki/List_of_HTTP_headers HTTP request header].&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Web_storage&amp;lt;/ref&amp;gt; There are two types of web storage: [http://html.spec.whatwg.org/multipage/webstorage.html#dom-localstorage local storage] and [http://html.spec.whatwg.org/multipage/webstorage.html#dom-sessionstorage session storage].&lt;br /&gt;
&lt;br /&gt;
Browsers that support web storage have the global variables 'sessionStorage' and 'localStorage' declared at the [http://developer.mozilla.org/en-US/docs/Web/API/Window?redirectlocale=en-US&amp;amp;redirectslug=DOM%2Fwindow window] level. The following JavaScript code gives an example of how to use web storage:&lt;br /&gt;
&lt;br /&gt;
'''sessionStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on browser for duration of the session&lt;br /&gt;
sessionStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (gets deleted when browser is closed and re-opened)&lt;br /&gt;
alert(sessionStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''localStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on the browser beyond the duration of the session&lt;br /&gt;
localStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (persists even after closing and re-opening the browser)&lt;br /&gt;
alert(localStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
&lt;br /&gt;
As part of our [http://github.com/servo/servo/wiki/Storage-student-project project], we have to implement this specification in the Servo browser. Implementing this important specification in Servo will allow stateful web applications to run, and will help expose any architectural problems that Servo's radical design may cause. &amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Requirement Analysis &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
In order to introduce the support for sessionstorage and localstorage in the Servo Broswer, we have to create the Storage structure and allow web pages to store data in the Servo memory space.&lt;br /&gt;
&lt;br /&gt;
Below is a high level overview of the various steps that need to be carried out to achieve this:&lt;br /&gt;
&lt;br /&gt;
* Create the Storage interface and its stub implementation.&lt;br /&gt;
* Create the WindowSessionStorage interface making it return a Storage instance.&lt;br /&gt;
* Create a Storage Task which will be used to contain all stored data.&lt;br /&gt;
* Define a message-passing interface for reading and writing stored data for a particular browser tab.&lt;br /&gt;
* Use the Storage task in the implementation of Storage.&lt;br /&gt;
* When the value of a stored data is changed, notify its respective browser tab.&lt;br /&gt;
* Pass as many tests as possible.&lt;br /&gt;
* Implement the WindowLocalStorage interface which behaves slightly different from the WindowSessionStorage interface.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
[[File:task.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Architecture Explained ===&lt;br /&gt;
*Each box represents a Rust task.&lt;br /&gt;
*Blue boxes represent the primary tasks in the browser pipeline.&lt;br /&gt;
*Gray boxes represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
*White boxes represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
*Dashed lines indicate supervisor relationships.&lt;br /&gt;
*Solid lines indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
The Architecture comprises of a Storage Task which will be responsible to hold all the data that the web page requests to save. This happens via Channels in Rust, which implements a Sender Receiver protocol, the task is runnning in the background and waits to receive the data sent from the web page.&lt;br /&gt;
&lt;br /&gt;
== Data Design ==&lt;br /&gt;
&lt;br /&gt;
===  Data Description ===&lt;br /&gt;
&lt;br /&gt;
''The following are the data structures that will be used.''&lt;br /&gt;
&lt;br /&gt;
'''Storage''' | TreeMap&amp;lt;String,String&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''UrlMap''' | TreeMap&amp;lt;String,TreeMap&amp;lt;String,String&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Component Design ==&lt;br /&gt;
[[File:servo.jpg]]&lt;br /&gt;
=== Task ===&lt;br /&gt;
Rust provides safe concurrent abstractions through a number of core library primitives. This guide will describe the concurrency model in Rust, how it relates to the Rust type system, and introduce the fundamental library abstractions for constructing concurrent programs.&lt;br /&gt;
&lt;br /&gt;
Tasks provide failure isolation and recovery. When a fatal error occurs in Rust code as a result of an explicit call to panic!(), an assertion failure, or another invalid operation, the runtime system destroys the entire task. Unlike in languages such as Java and C++, there is no way to catch an exception. Instead, tasks may monitor each other to see if they panic.&lt;br /&gt;
&lt;br /&gt;
Tasks use Rust's type system to provide strong memory safety guarantees. In particular, the type system guarantees that tasks cannot induce a data race from shared mutable state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Generate some state locally&lt;br /&gt;
let child_task_number = generate_task_number();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    // Capture it in the remote task&lt;br /&gt;
    println!(&amp;quot;I am child number {}&amp;quot;, child_task_number);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Channel ===&lt;br /&gt;
Now that we have spawned a new task, it would be nice if we could communicate with it. For this, we use channels. A channel is simply a pair of endpoints: one for sending messages and another for receiving messages.&lt;br /&gt;
&lt;br /&gt;
The simplest way to create a channel is to use the channel function to create a (Sender, Receiver) pair. In Rust parlance, a sender is a sending endpoint of a channel, and a receiver is the receiving endpoint. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
let (tx, rx): (Sender&amp;lt;int&amp;gt;, Receiver&amp;lt;int&amp;gt;) = channel();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    let result = some_expensive_computation();&lt;br /&gt;
    tx.send(result);&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
some_other_expensive_computation();&lt;br /&gt;
let result = rx.recv();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
We will be using &amp;quot;Delegation Pattern&amp;quot; in our project. The Storage interface is used by web applications to access the Web Storage provided by the browser. However, the actual data is stored somewhere else(Database/FileSystem/Memory). So, it makes sense to create another class which will maintain the actual stored data. The Storage class can then delegate the task of storing/retrieving data to this class. We will create a class &amp;quot;WebStorageTask&amp;quot; for this purpose.&lt;br /&gt;
&lt;br /&gt;
== UML diagrams (Eg use case diagram, class diagrams) ==&lt;br /&gt;
&lt;br /&gt;
[[File:Flow_Chart_Storage.png]][[File:Use_Case_Storage.jpg|right]]&lt;br /&gt;
&lt;br /&gt;
== Proposed Test Cases ==&lt;br /&gt;
&lt;br /&gt;
To test the session storage in servo, we will be implementing the storage tasks. Some of the test cases for reference are: &lt;br /&gt;
* Clear session storage&lt;br /&gt;
* Set items in sessions storage&lt;br /&gt;
* Get stored items from session storage&lt;br /&gt;
* Check the number of items storage in session storage&lt;br /&gt;
* On removing the item from storage, it should be inaccessible&lt;br /&gt;
* Check if out of range indexes give error&lt;br /&gt;
* Access for out of range arguments as keys should return null&lt;br /&gt;
* Get an error on exceeding the limit of session storage&lt;br /&gt;
&lt;br /&gt;
You can find the detailed list of test cases at [https://github.com/servo/web-platform-tests/tree/servo/webstorage Webstorage Tests]&lt;br /&gt;
&lt;br /&gt;
== Further Readings ==&lt;br /&gt;
&lt;br /&gt;
Learning Rust by Examples: http://rustbyexample.com/ &amp;lt;br/&amp;gt;&lt;br /&gt;
Javascript as Servo's Garbage Collector: http://blog.mozilla.org/research/2014/08/26/javascript-servos-only-garbage-collector/  &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92025</id>
		<title>CSC/ECE 517 Fall 2014/final design doc M1450 navr</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92025"/>
		<updated>2014-11-12T04:31:06Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implement Window.sessionStorage ==&lt;br /&gt;
&lt;br /&gt;
This is the design document for the task &amp;lt;code&amp;gt;[http://github.com/servo/servo/wiki/Storage-student-project Implement Window.sessionStorage]&amp;lt;/code&amp;gt; for the [http://www.mozilla.org/ Mozilla] research project [http://github.com/servo/servo/wiki/Design Servo].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== [http://www.rust-lang.org/ Rust]===&lt;br /&gt;
&lt;br /&gt;
Rust is a modern systems programming language focusing on safety and speed to build reliable and efficient systems &amp;lt;ref&amp;gt; http://doc.rust-lang.org/nightly/intro.html &amp;lt;/ref&amp;gt;. It accomplishes the goals of memory safe without using garbage collection and it supports concurrency and parallelism in building platforms. &lt;br /&gt;
&lt;br /&gt;
Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://github.com/servo/servo/wiki/Design Servo] ===&lt;br /&gt;
&lt;br /&gt;
Mozilla Research team is currently working on an experimental project to develop a new Web browser engine &amp;quot;Servo&amp;quot;, that is capable of supporting a variety of current and next generation of hardware like mobile devices, multi-core processors and high-performance GPUs. Servo builds on top of Rust to provide a secure and reliable foundation. It is currently developed on 64 bit devices.&amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main objectives of this experimentation project is improving the layout to graphics rendering - to optimize for power efficiency and maximize parallelism. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
The [http://html.spec.whatwg.org/multipage/webstorage.html#webstorage Web Storage] specification defines the means by which a web application can store string key/value pairs in a browser and later retrieve them for use.&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage&amp;lt;/ref&amp;gt; It supports persistent data storage, similar to [http://en.wikipedia.org/wiki/HTTP_cookie cookies] but with a greatly enhanced capacity and no information stored in the [http://en.wikipedia.org/wiki/List_of_HTTP_headers HTTP request header].&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Web_storage&amp;lt;/ref&amp;gt; There are two types of web storage: [http://html.spec.whatwg.org/multipage/webstorage.html#dom-localstorage local storage] and [http://html.spec.whatwg.org/multipage/webstorage.html#dom-sessionstorage session storage].&lt;br /&gt;
&lt;br /&gt;
Browsers that support web storage have the global variables 'sessionStorage' and 'localStorage' declared at the [http://developer.mozilla.org/en-US/docs/Web/API/Window?redirectlocale=en-US&amp;amp;redirectslug=DOM%2Fwindow window] level. The following JavaScript code gives an example of how to use web storage:&lt;br /&gt;
&lt;br /&gt;
'''sessionStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on browser for duration of the session&lt;br /&gt;
sessionStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (gets deleted when browser is closed and re-opened)&lt;br /&gt;
alert(sessionStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''localStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on the browser beyond the duration of the session&lt;br /&gt;
localStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (persists even after closing and re-opening the browser)&lt;br /&gt;
alert(localStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
&lt;br /&gt;
As part of our [http://github.com/servo/servo/wiki/Storage-student-project project], we have to implement this specification in the Servo browser. Implementing this important specification in Servo will allow stateful web applications to run, and will help expose any architectural problems that Servo's radical design may cause. &amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Requirement Analysis &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
In order to introduce the support for sessionstorage and localstorage in the Servo Broswer, we have to create the Storage structure and allow web pages to store data in the Servo memory space.&lt;br /&gt;
&lt;br /&gt;
Below is a high level overview of the various steps that need to be carried out to achieve this:&lt;br /&gt;
&lt;br /&gt;
* Create the Storage interface and its stub implementation.&lt;br /&gt;
* Create the WindowSessionStorage interface making it return a Storage instance.&lt;br /&gt;
* Create a Storage Task which will be used to contain all stored data.&lt;br /&gt;
* Define a message-passing interface for reading and writing stored data for a particular browser tab.&lt;br /&gt;
* Use the Storage task in the implementation of Storage.&lt;br /&gt;
* When the value of a stored data is changed, notify its respective browser tab.&lt;br /&gt;
* Pass as many tests as possible.&lt;br /&gt;
* Implement the WindowLocalStorage interface which behaves slightly different from the WindowSessionStorage interface.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
[[File:task.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Architecture Explained ===&lt;br /&gt;
*Each box represents a Rust task.&lt;br /&gt;
*Blue boxes represent the primary tasks in the browser pipeline.&lt;br /&gt;
*Gray boxes represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
*White boxes represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
*Dashed lines indicate supervisor relationships.&lt;br /&gt;
*Solid lines indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
The Architecture comprises of a Storage Task which will be responsible to hold all the data that the web page requests to save. This happens via Channels in Rust, which implements a Sender Receiver protocol, the task is runnning in the background and waits to receive the data sent from the web page.&lt;br /&gt;
&lt;br /&gt;
== Data Design ==&lt;br /&gt;
&lt;br /&gt;
===  Data Description ===&lt;br /&gt;
&lt;br /&gt;
''The following are the data structures that will be used.''&lt;br /&gt;
&lt;br /&gt;
'''Storage''' | TreeMap&amp;lt;String,String&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''UrlMap''' | TreeMap&amp;lt;String,TreeMap&amp;lt;String,String&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Component Design ==&lt;br /&gt;
[[File:servo.jpg]]&lt;br /&gt;
=== Task ===&lt;br /&gt;
Rust provides safe concurrent abstractions through a number of core library primitives. This guide will describe the concurrency model in Rust, how it relates to the Rust type system, and introduce the fundamental library abstractions for constructing concurrent programs.&lt;br /&gt;
&lt;br /&gt;
Tasks provide failure isolation and recovery. When a fatal error occurs in Rust code as a result of an explicit call to panic!(), an assertion failure, or another invalid operation, the runtime system destroys the entire task. Unlike in languages such as Java and C++, there is no way to catch an exception. Instead, tasks may monitor each other to see if they panic.&lt;br /&gt;
&lt;br /&gt;
Tasks use Rust's type system to provide strong memory safety guarantees. In particular, the type system guarantees that tasks cannot induce a data race from shared mutable state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Generate some state locally&lt;br /&gt;
let child_task_number = generate_task_number();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    // Capture it in the remote task&lt;br /&gt;
    println!(&amp;quot;I am child number {}&amp;quot;, child_task_number);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Channel ===&lt;br /&gt;
Now that we have spawned a new task, it would be nice if we could communicate with it. For this, we use channels. A channel is simply a pair of endpoints: one for sending messages and another for receiving messages.&lt;br /&gt;
&lt;br /&gt;
The simplest way to create a channel is to use the channel function to create a (Sender, Receiver) pair. In Rust parlance, a sender is a sending endpoint of a channel, and a receiver is the receiving endpoint. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
let (tx, rx): (Sender&amp;lt;int&amp;gt;, Receiver&amp;lt;int&amp;gt;) = channel();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    let result = some_expensive_computation();&lt;br /&gt;
    tx.send(result);&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
some_other_expensive_computation();&lt;br /&gt;
let result = rx.recv();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
We will be using &amp;quot;Delegation Pattern&amp;quot; in our project. The Storage interface is used by web applications to access the Web Storage provided by the browser. However, the actual data is stored somewhere else(Database/FileSystem/Memory). So, it makes sense to create another class which will maintain the actual stored data. The Storage class can then delegate the task of storing/retrieving data to this class. We will create a class &amp;quot;WebStorageTask&amp;quot; for this purpose.&lt;br /&gt;
&lt;br /&gt;
== UML diagrams (Eg use case diagram, class diagrams) ==&lt;br /&gt;
&lt;br /&gt;
[[File:Flow_Chart_Storage.png]][[File:Use_Case_Storage.jpg|right]]&lt;br /&gt;
&lt;br /&gt;
== Proposed Test Cases ==&lt;br /&gt;
&lt;br /&gt;
To test the session storage in servo, we will be implementing the storage tasks. Some of the test cases for reference are: &lt;br /&gt;
* Clear session storage&lt;br /&gt;
* Set items in sessions storage&lt;br /&gt;
* Get stored items from session storage&lt;br /&gt;
* Check the number of items storage in session storage&lt;br /&gt;
* On removing the item from storage, it should be inaccessible&lt;br /&gt;
* Check if out of range indexes give error&lt;br /&gt;
* Access for out of range arguments as keys should return null&lt;br /&gt;
* Get an error on exceeding the limit of session storage&lt;br /&gt;
&lt;br /&gt;
You can find the detailed list of test cases at [https://github.com/servo/web-platform-tests/tree/servo/webstorage Webstorage Tests]&lt;br /&gt;
&lt;br /&gt;
== Further Readings ==&lt;br /&gt;
&lt;br /&gt;
Learning Rust by Examples: http://rustbyexample.com/ &amp;lt;br/&amp;gt;&lt;br /&gt;
Javascript as Servo's Garbage Collector: http://blog.mozilla.org/research/2014/08/26/javascript-servos-only-garbage-collector/  &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92024</id>
		<title>CSC/ECE 517 Fall 2014/final design doc M1450 navr</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92024"/>
		<updated>2014-11-12T04:29:03Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implement Window.sessionStorage ==&lt;br /&gt;
&lt;br /&gt;
This is the design document for the task &amp;lt;code&amp;gt;[http://github.com/servo/servo/wiki/Storage-student-project Implement Window.sessionStorage]&amp;lt;/code&amp;gt; for the [http://www.mozilla.org/ Mozilla] research project [http://github.com/servo/servo/wiki/Design Servo].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== [http://www.rust-lang.org/ Rust]===&lt;br /&gt;
&lt;br /&gt;
Rust is a modern systems programming language focusing on safety and speed to build reliable and efficient systems &amp;lt;ref&amp;gt; http://doc.rust-lang.org/nightly/intro.html &amp;lt;/ref&amp;gt;. It accomplishes the goals of memory safe without using garbage collection and it supports concurrency and parallelism in building platforms. &lt;br /&gt;
&lt;br /&gt;
Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://github.com/servo/servo/wiki/Design Servo] ===&lt;br /&gt;
&lt;br /&gt;
Mozilla Research team is currently working on an experimental project to develop a new Web browser engine &amp;quot;Servo&amp;quot;, that is capable of supporting a variety of current and next generation of hardware like mobile devices, multi-core processors and high-performance GPUs. Servo builds on top of Rust to provide a secure and reliable foundation. It is currently developed on 64 bit devices.&amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main objectives of this experimentation project is improving the layout to graphics rendering - to optimize for power efficiency and maximize parallelism. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
[[File:task.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Architecture Explained ===&lt;br /&gt;
*Each box represents a Rust task.&lt;br /&gt;
*Blue boxes represent the primary tasks in the browser pipeline.&lt;br /&gt;
*Gray boxes represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
*White boxes represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
*Dashed lines indicate supervisor relationships.&lt;br /&gt;
*Solid lines indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
The [http://html.spec.whatwg.org/multipage/webstorage.html#webstorage Web Storage] specification defines the means by which a web application can store string key/value pairs in a browser and later retrieve them for use.&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage&amp;lt;/ref&amp;gt; It supports persistent data storage, similar to [http://en.wikipedia.org/wiki/HTTP_cookie cookies] but with a greatly enhanced capacity and no information stored in the [http://en.wikipedia.org/wiki/List_of_HTTP_headers HTTP request header].&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Web_storage&amp;lt;/ref&amp;gt; There are two types of web storage: [http://html.spec.whatwg.org/multipage/webstorage.html#dom-localstorage local storage] and [http://html.spec.whatwg.org/multipage/webstorage.html#dom-sessionstorage session storage].&lt;br /&gt;
&lt;br /&gt;
Browsers that support web storage have the global variables 'sessionStorage' and 'localStorage' declared at the [http://developer.mozilla.org/en-US/docs/Web/API/Window?redirectlocale=en-US&amp;amp;redirectslug=DOM%2Fwindow window] level. The following JavaScript code gives an example of how to use web storage:&lt;br /&gt;
&lt;br /&gt;
'''sessionStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on browser for duration of the session&lt;br /&gt;
sessionStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (gets deleted when browser is closed and re-opened)&lt;br /&gt;
alert(sessionStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''localStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on the browser beyond the duration of the session&lt;br /&gt;
localStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (persists even after closing and re-opening the browser)&lt;br /&gt;
alert(localStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
&lt;br /&gt;
As part of our [http://github.com/servo/servo/wiki/Storage-student-project project], we have to implement this specification in the Servo browser. Implementing this important specification in Servo will allow stateful web applications to run, and will help expose any architectural problems that Servo's radical design may cause. &amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Architecture comprises of a Storage Task which will be responsible to hold all the data that the web page requests to save. This happens via Channels in Rust, which implements a Sender Receiver protocol, the task is runnning in the background and waits to receive the data sent from the web page.&lt;br /&gt;
&lt;br /&gt;
== Requirement Analysis &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
In order to introduce the support for sessionstorage and localstorage in the Servo Broswer, we have to create the Storage structure and allow web pages to store data in the Servo memory space.&lt;br /&gt;
&lt;br /&gt;
Below is a high level overview of the various steps that need to be carried out to achieve this:&lt;br /&gt;
&lt;br /&gt;
* Create the Storage interface and its stub implementation.&lt;br /&gt;
* Create the WindowSessionStorage interface making it return a Storage instance.&lt;br /&gt;
* Create a Storage Task which will be used to contain all stored data.&lt;br /&gt;
* Define a message-passing interface for reading and writing stored data for a particular browser tab.&lt;br /&gt;
* Use the Storage task in the implementation of Storage.&lt;br /&gt;
* When the value of a stored data is changed, notify its respective browser tab.&lt;br /&gt;
* Pass as many tests as possible.&lt;br /&gt;
* Implement the WindowLocalStorage interface which behaves slightly different from the WindowSessionStorage interface.&lt;br /&gt;
&lt;br /&gt;
== Data Design ==&lt;br /&gt;
&lt;br /&gt;
===  Data Description ===&lt;br /&gt;
&lt;br /&gt;
''The following are the data structures that will be used.''&lt;br /&gt;
&lt;br /&gt;
'''Storage''' | TreeMap&amp;lt;String,String&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''UrlMap''' | TreeMap&amp;lt;String,TreeMap&amp;lt;String,String&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Component Design ==&lt;br /&gt;
[[File:servo.jpg]]&lt;br /&gt;
=== Task ===&lt;br /&gt;
Rust provides safe concurrent abstractions through a number of core library primitives. This guide will describe the concurrency model in Rust, how it relates to the Rust type system, and introduce the fundamental library abstractions for constructing concurrent programs.&lt;br /&gt;
&lt;br /&gt;
Tasks provide failure isolation and recovery. When a fatal error occurs in Rust code as a result of an explicit call to panic!(), an assertion failure, or another invalid operation, the runtime system destroys the entire task. Unlike in languages such as Java and C++, there is no way to catch an exception. Instead, tasks may monitor each other to see if they panic.&lt;br /&gt;
&lt;br /&gt;
Tasks use Rust's type system to provide strong memory safety guarantees. In particular, the type system guarantees that tasks cannot induce a data race from shared mutable state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Generate some state locally&lt;br /&gt;
let child_task_number = generate_task_number();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    // Capture it in the remote task&lt;br /&gt;
    println!(&amp;quot;I am child number {}&amp;quot;, child_task_number);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Channel ===&lt;br /&gt;
Now that we have spawned a new task, it would be nice if we could communicate with it. For this, we use channels. A channel is simply a pair of endpoints: one for sending messages and another for receiving messages.&lt;br /&gt;
&lt;br /&gt;
The simplest way to create a channel is to use the channel function to create a (Sender, Receiver) pair. In Rust parlance, a sender is a sending endpoint of a channel, and a receiver is the receiving endpoint. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
let (tx, rx): (Sender&amp;lt;int&amp;gt;, Receiver&amp;lt;int&amp;gt;) = channel();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    let result = some_expensive_computation();&lt;br /&gt;
    tx.send(result);&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
some_other_expensive_computation();&lt;br /&gt;
let result = rx.recv();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
We will be using &amp;quot;Delegation Pattern&amp;quot; in our project. The Storage interface is used by web applications to access the Web Storage provided by the browser. However, the actual data is stored somewhere else(Database/FileSystem/Memory). So, it makes sense to create another class which will maintain the actual stored data. The Storage class can then delegate the task of storing/retrieving data to this class. We will create a class &amp;quot;WebStorageTask&amp;quot; for this purpose.&lt;br /&gt;
&lt;br /&gt;
== UML diagrams (Eg use case diagram, class diagrams) ==&lt;br /&gt;
&lt;br /&gt;
[[File:Flow_Chart_Storage.png]][[File:Use_Case_Storage.jpg|right]]&lt;br /&gt;
&lt;br /&gt;
== Proposed Test Cases ==&lt;br /&gt;
&lt;br /&gt;
To test the session storage in servo, we will be implementing the storage tasks. Some of the test cases for reference are: &lt;br /&gt;
* Clear session storage&lt;br /&gt;
* Set items in sessions storage&lt;br /&gt;
* Get stored items from session storage&lt;br /&gt;
* Check the number of items storage in session storage&lt;br /&gt;
* On removing the item from storage, it should be inaccessible&lt;br /&gt;
* Check if out of range indexes give error&lt;br /&gt;
* Access for out of range arguments as keys should return null&lt;br /&gt;
* Get an error on exceeding the limit of session storage&lt;br /&gt;
&lt;br /&gt;
You can find the detailed list of test cases at [https://github.com/servo/web-platform-tests/tree/servo/webstorage Webstorage Tests]&lt;br /&gt;
&lt;br /&gt;
== Further Readings ==&lt;br /&gt;
&lt;br /&gt;
Learning Rust by Examples: http://rustbyexample.com/ &amp;lt;br/&amp;gt;&lt;br /&gt;
Javascript as Servo's Garbage Collector: http://blog.mozilla.org/research/2014/08/26/javascript-servos-only-garbage-collector/  &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92023</id>
		<title>CSC/ECE 517 Fall 2014/final design doc M1450 navr</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=92023"/>
		<updated>2014-11-12T04:08:44Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implement Window.sessionStorage ==&lt;br /&gt;
&lt;br /&gt;
This is the design document for the task &amp;lt;code&amp;gt;[http://github.com/servo/servo/wiki/Storage-student-project Implement Window.sessionStorage]&amp;lt;/code&amp;gt; for the [http://www.mozilla.org/ Mozilla] research project [http://github.com/servo/servo/wiki/Design Servo].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== [http://www.rust-lang.org/ Rust]===&lt;br /&gt;
&lt;br /&gt;
Rust is a modern systems programming language focusing on safety and speed to build reliable and efficient systems &amp;lt;ref&amp;gt; http://doc.rust-lang.org/nightly/intro.html &amp;lt;/ref&amp;gt;. It accomplishes the goals of memory safe without using garbage collection and it supports concurrency and parallelism in building platforms. &lt;br /&gt;
&lt;br /&gt;
Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://github.com/servo/servo/wiki/Design Servo] ===&lt;br /&gt;
&lt;br /&gt;
Mozilla Research team is currently working on an experimental project to develop a new Web browser engine &amp;quot;Servo&amp;quot;, that is capable of supporting a variety of current and next generation of hardware like mobile devices, multi-core processors and high-performance GPUs. Servo builds on top of Rust to provide a secure and reliable foundation. It is currently developed on 64 bit devices.&amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main objectives of this experimentation project is improving the layout to graphics rendering - to optimize for power efficiency and maximize parallelism. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Purpose ===&lt;br /&gt;
&lt;br /&gt;
The purpose of this project is to introduce the support related to sessionstorage and localstorage in Servo Broswer, for this we have to create Storage structure and allow web pages to store data in the Servo memory space.&lt;br /&gt;
&lt;br /&gt;
=== Background ===&lt;br /&gt;
&lt;br /&gt;
Persistent storage on the web is used by many services such as the popular Disqus commenting interface. Implementing this important specification in Servo will allow stateful web applications to run, and will help expose any architectural problems that Servo's radical design may cause.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
[[File:task.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Architecture comprises of a Storage Task which will be responsible to hold all the data that the web page requests to save. This happens via Channels in Rust, which implements a Sender Receiver protocol, the task is runnning in the background and waits to receive the data sent from the web page.&lt;br /&gt;
&lt;br /&gt;
=== Architecture Explained ===&lt;br /&gt;
*Each box represents a Rust task.&lt;br /&gt;
*Blue boxes represent the primary tasks in the browser pipeline.&lt;br /&gt;
*Gray boxes represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
*White boxes represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
*Dashed lines indicate supervisor relationships.&lt;br /&gt;
*Solid lines indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
== Requirement Analysis &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
As part of our [http://github.com/servo/servo/wiki/Storage-student-project project], we have to implement the [http://html.spec.whatwg.org/multipage/webstorage.html#webstorage Web Storage] specification in Servo. Implementing this important specification in Servo will allow stateful web applications to run, and will help expose any architectural problems that Servo's radical design may cause. &amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below is a high level overview of the various steps that need to be carried out to achieve this:&lt;br /&gt;
&lt;br /&gt;
* Create the Storage interface and its stub implementation.&lt;br /&gt;
* Create the WindowSessionStorage interface making it return a Storage instance.&lt;br /&gt;
* Create a Storage Task which will be used to contain all stored data.&lt;br /&gt;
* Define a message-passing interface for reading and writing stored data for a particular browser tab.&lt;br /&gt;
* Use the Storage task in the implementation of Storage.&lt;br /&gt;
* When the value of a stored data is changed, notify its respective browser tab.&lt;br /&gt;
* Pass as many tests as possible.&lt;br /&gt;
* Implement the WindowLocalStorage interface which behaves slightly different from the WindowSessionStorage interface.&lt;br /&gt;
&lt;br /&gt;
== Data Design ==&lt;br /&gt;
&lt;br /&gt;
===  Data Description ===&lt;br /&gt;
&lt;br /&gt;
''The following are the data structures that will be used.''&lt;br /&gt;
&lt;br /&gt;
'''Storage''' | TreeMap&amp;lt;String,String&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''UrlMap''' | TreeMap&amp;lt;String,TreeMap&amp;lt;String,String&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Component Design ==&lt;br /&gt;
[[File:servo.jpg]]&lt;br /&gt;
=== Task ===&lt;br /&gt;
Rust provides safe concurrent abstractions through a number of core library primitives. This guide will describe the concurrency model in Rust, how it relates to the Rust type system, and introduce the fundamental library abstractions for constructing concurrent programs.&lt;br /&gt;
&lt;br /&gt;
Tasks provide failure isolation and recovery. When a fatal error occurs in Rust code as a result of an explicit call to panic!(), an assertion failure, or another invalid operation, the runtime system destroys the entire task. Unlike in languages such as Java and C++, there is no way to catch an exception. Instead, tasks may monitor each other to see if they panic.&lt;br /&gt;
&lt;br /&gt;
Tasks use Rust's type system to provide strong memory safety guarantees. In particular, the type system guarantees that tasks cannot induce a data race from shared mutable state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Generate some state locally&lt;br /&gt;
let child_task_number = generate_task_number();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    // Capture it in the remote task&lt;br /&gt;
    println!(&amp;quot;I am child number {}&amp;quot;, child_task_number);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Channel ===&lt;br /&gt;
Now that we have spawned a new task, it would be nice if we could communicate with it. For this, we use channels. A channel is simply a pair of endpoints: one for sending messages and another for receiving messages.&lt;br /&gt;
&lt;br /&gt;
The simplest way to create a channel is to use the channel function to create a (Sender, Receiver) pair. In Rust parlance, a sender is a sending endpoint of a channel, and a receiver is the receiving endpoint. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
let (tx, rx): (Sender&amp;lt;int&amp;gt;, Receiver&amp;lt;int&amp;gt;) = channel();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    let result = some_expensive_computation();&lt;br /&gt;
    tx.send(result);&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
some_other_expensive_computation();&lt;br /&gt;
let result = rx.recv();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
We will be using &amp;quot;Delegation Pattern&amp;quot; in our project. The Storage interface is used by web applications to access the Web Storage provided by the browser. However, the actual data is stored somewhere else(Database/FileSystem/Memory). So, it makes sense to create another class which will maintain the actual stored data. The Storage class can then delegate the task of storing/retrieving data to this class. We will create a class &amp;quot;WebStorageTask&amp;quot; for this purpose.&lt;br /&gt;
&lt;br /&gt;
== UML diagrams (Eg use case diagram, class diagrams) ==&lt;br /&gt;
&lt;br /&gt;
[[File:Flow_Chart_Storage.png]][[File:Use_Case_Storage.jpg|right]]&lt;br /&gt;
&lt;br /&gt;
== Proposed Test Cases ==&lt;br /&gt;
&lt;br /&gt;
To test the session storage in servo, we will be implementing the storage tasks. Some of the test cases for reference are: &lt;br /&gt;
* Clear session storage&lt;br /&gt;
* Set items in sessions storage&lt;br /&gt;
* Get stored items from session storage&lt;br /&gt;
* Check the number of items storage in session storage&lt;br /&gt;
* On removing the item from storage, it should be inaccessible&lt;br /&gt;
* Check if out of range indexes give error&lt;br /&gt;
* Access for out of range arguments as keys should return null&lt;br /&gt;
* Get an error on exceeding the limit of session storage&lt;br /&gt;
&lt;br /&gt;
You can find the detailed list of test cases at [https://github.com/servo/web-platform-tests/tree/servo/webstorage Webstorage Tests]&lt;br /&gt;
&lt;br /&gt;
== Further Readings ==&lt;br /&gt;
&lt;br /&gt;
Learning Rust by Examples: http://rustbyexample.com/ &amp;lt;br/&amp;gt;&lt;br /&gt;
Javascript as Servo's Garbage Collector: http://blog.mozilla.org/research/2014/08/26/javascript-servos-only-garbage-collector/  &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=91758</id>
		<title>CSC/ECE 517 Fall 2014/final design doc M1450 navr</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=91758"/>
		<updated>2014-11-11T22:23:32Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: /* Design patterns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== [http://www.rust-lang.org/ Rust]===&lt;br /&gt;
&lt;br /&gt;
Rust is a modern systems programming language focusing on safety and speed to build reliable and efficient systems &amp;lt;ref&amp;gt; http://doc.rust-lang.org/nightly/intro.html &amp;lt;/ref&amp;gt;. It accomplishes the goals of memory safe without using garbage collection and it supports concurrency and parallelism in building platforms. &lt;br /&gt;
&lt;br /&gt;
Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://github.com/servo/servo/wiki/Design Servo] ===&lt;br /&gt;
&lt;br /&gt;
Mozilla Research team is currently working on an experimental project to develop a new Web browser engine &amp;quot;Servo&amp;quot;, that is capable of supporting a variety of current and next generation of hardware like mobile devices, multi-core processors and high-performance GPUs. Servo builds on top of Rust to provide a secure and reliable foundation. It is currently developed on 64 bit devices.&amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main objectives of this experimentation project is improving the layout to graphics rendering - to optimize for power efficiency and maximize parallelism. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Purpose ===&lt;br /&gt;
&lt;br /&gt;
The purpose of this project is to introduce the support related to sessionstorage and localstorage in Servo Broswer, for this we have to create Storage structure and allow web pages to store data in the Servo memory space.&lt;br /&gt;
&lt;br /&gt;
=== Background ===&lt;br /&gt;
&lt;br /&gt;
Persistent storage on the web is used by many services such as the popular Disqus commenting interface. Implementing this important specification in Servo will allow stateful web applications to run, and will help expose any architectural problems that Servo's radical design may cause.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
[[File:task.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Architecture comprises of a Storage Task which will be responsible to hold all the data that the web page requests to save. This happens via Channels in Rust, which implements a Sender Receiver protocol, the task is runnning in the background and waits to receive the data sent from the web page.&lt;br /&gt;
&lt;br /&gt;
=== Architecture Explained ===&lt;br /&gt;
*Each box represents a Rust task.&lt;br /&gt;
*Blue boxes represent the primary tasks in the browser pipeline.&lt;br /&gt;
*Gray boxes represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
*White boxes represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
*Dashed lines indicate supervisor relationships.&lt;br /&gt;
*Solid lines indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
== Requirement Analysis &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
As part of our [http://github.com/servo/servo/wiki/Storage-student-project project], we have to implement the [http://html.spec.whatwg.org/multipage/webstorage.html#webstorage Web Storage] specification in Servo. Implementing this important specification in Servo will allow stateful web applications to run, and will help expose any architectural problems that Servo's radical design may cause. &amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below is a high level overview of the various steps that need to be carried out to achieve this:&lt;br /&gt;
&lt;br /&gt;
* Create the Storage interface and its stub implementation.&lt;br /&gt;
* Create the WindowSessionStorage interface making it return a Storage instance.&lt;br /&gt;
* Create a Storage Task which will be used to contain all stored data.&lt;br /&gt;
* Define a message-passing interface for reading and writing stored data for a particular browser tab.&lt;br /&gt;
* Use the Storage task in the implementation of Storage.&lt;br /&gt;
* When the value of a stored data is changed, notify its respective browser tab.&lt;br /&gt;
* Pass as many tests as possible.&lt;br /&gt;
* Implement the WindowLocalStorage interface which behaves slightly different from the WindowSessionStorage interface.&lt;br /&gt;
&lt;br /&gt;
== Data Design ==&lt;br /&gt;
&lt;br /&gt;
===  Data Description ===&lt;br /&gt;
&lt;br /&gt;
''The following are the data structures that will be used.''&lt;br /&gt;
&lt;br /&gt;
'''Storage''' | TreeMap&amp;lt;String,String&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''UrlMap''' | TreeMap&amp;lt;String,TreeMap&amp;lt;String,String&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Component Design ==&lt;br /&gt;
[[File:servo.jpg]]&lt;br /&gt;
=== Task ===&lt;br /&gt;
Rust provides safe concurrent abstractions through a number of core library primitives. This guide will describe the concurrency model in Rust, how it relates to the Rust type system, and introduce the fundamental library abstractions for constructing concurrent programs.&lt;br /&gt;
&lt;br /&gt;
Tasks provide failure isolation and recovery. When a fatal error occurs in Rust code as a result of an explicit call to panic!(), an assertion failure, or another invalid operation, the runtime system destroys the entire task. Unlike in languages such as Java and C++, there is no way to catch an exception. Instead, tasks may monitor each other to see if they panic.&lt;br /&gt;
&lt;br /&gt;
Tasks use Rust's type system to provide strong memory safety guarantees. In particular, the type system guarantees that tasks cannot induce a data race from shared mutable state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Generate some state locally&lt;br /&gt;
let child_task_number = generate_task_number();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    // Capture it in the remote task&lt;br /&gt;
    println!(&amp;quot;I am child number {}&amp;quot;, child_task_number);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Channel ===&lt;br /&gt;
Now that we have spawned a new task, it would be nice if we could communicate with it. For this, we use channels. A channel is simply a pair of endpoints: one for sending messages and another for receiving messages.&lt;br /&gt;
&lt;br /&gt;
The simplest way to create a channel is to use the channel function to create a (Sender, Receiver) pair. In Rust parlance, a sender is a sending endpoint of a channel, and a receiver is the receiving endpoint. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
let (tx, rx): (Sender&amp;lt;int&amp;gt;, Receiver&amp;lt;int&amp;gt;) = channel();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    let result = some_expensive_computation();&lt;br /&gt;
    tx.send(result);&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
some_other_expensive_computation();&lt;br /&gt;
let result = rx.recv();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
We will be using &amp;quot;Delegation Pattern&amp;quot; in our project. The Storage interface is used by web applications to access the Web Storage provided by the browser. However, the actual data is stored somewhere else(Database/FileSystem/Memory). So, it makes sense to create another class which will maintain the actual stored data. The Storage class can then delegate the task of storing/retrieving data to this class. We will create a class &amp;quot;WebStorageTask&amp;quot; for this purpose.&lt;br /&gt;
&lt;br /&gt;
== UML diagrams (Eg use case diagram, class diagrams) ==&lt;br /&gt;
&lt;br /&gt;
== Proposed Test Cases ==&lt;br /&gt;
&lt;br /&gt;
== Further Readings ==&lt;br /&gt;
&lt;br /&gt;
Learning Rust by Examples: http://rustbyexample.com/ &amp;lt;br/&amp;gt;&lt;br /&gt;
Javascript as Servo's Garbage Collector: http://blog.mozilla.org/research/2014/08/26/javascript-servos-only-garbage-collector/  &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=91740</id>
		<title>CSC/ECE 517 Fall 2014/final design doc M1450 navr</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=91740"/>
		<updated>2014-11-11T21:28:09Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: /* Proposed Test Cases */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== [http://www.rust-lang.org/ Rust]===&lt;br /&gt;
&lt;br /&gt;
Rust is a modern systems programming language focusing on safety and speed to build reliable and efficient systems &amp;lt;ref&amp;gt; http://doc.rust-lang.org/nightly/intro.html &amp;lt;/ref&amp;gt;. It accomplishes the goals of memory safe without using garbage collection and it supports concurrency and parallelism in building platforms. &lt;br /&gt;
&lt;br /&gt;
Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://github.com/servo/servo/wiki/Design Servo] ===&lt;br /&gt;
&lt;br /&gt;
Mozilla Research team is currently working on an experimental project to develop a new Web browser engine &amp;quot;Servo&amp;quot;, that is capable of supporting a variety of current and next generation of hardware like mobile devices, multi-core processors and high-performance GPUs. Servo builds on top of Rust to provide a secure and reliable foundation. It is currently developed on 64 bit devices.&amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main objectives of this experimentation project is improving the layout to graphics rendering - to optimize for power efficiency and maximize parallelism. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Purpose ===&lt;br /&gt;
&lt;br /&gt;
The purpose of this project is to introduce the support related to sessionstorage and localstorage in Servo Broswer, for this we have to create Storage structure and allow web pages to store data in the Servo memory space.&lt;br /&gt;
&lt;br /&gt;
=== Background ===&lt;br /&gt;
&lt;br /&gt;
Persistent storage on the web is used by many services such as the popular Disqus commenting interface. Implementing this important specification in Servo will allow stateful web applications to run, and will help expose any architectural problems that Servo's radical design may cause.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
[[File:task.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Architecture comprises of a Storage Task which will be responsible to hold all the data that the web page requests to save. This happens via Channels in Rust, which implements a Sender Receiver protocol, the task is runnning in the background and waits to receive the data sent from the web page.&lt;br /&gt;
&lt;br /&gt;
=== Architecture Explained ===&lt;br /&gt;
*Each box represents a Rust task.&lt;br /&gt;
*Blue boxes represent the primary tasks in the browser pipeline.&lt;br /&gt;
*Gray boxes represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
*White boxes represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
*Dashed lines indicate supervisor relationships.&lt;br /&gt;
*Solid lines indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
== Requirement Analysis &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
As part of our [http://github.com/servo/servo/wiki/Storage-student-project project], we have to implement the [http://html.spec.whatwg.org/multipage/webstorage.html#webstorage Web Storage] specification in Servo. Implementing this important specification in Servo will allow stateful web applications to run, and will help expose any architectural problems that Servo's radical design may cause. &amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below is a high level overview of the various steps that need to be carried out to achieve this:&lt;br /&gt;
&lt;br /&gt;
* Create the Storage interface and its stub implementation.&lt;br /&gt;
* Create the WindowSessionStorage interface making it return a Storage instance.&lt;br /&gt;
* Create a Storage Task which will be used to contain all stored data.&lt;br /&gt;
* Define a message-passing interface for reading and writing stored data for a particular browser tab.&lt;br /&gt;
* Use the Storage task in the implementation of Storage.&lt;br /&gt;
* When the value of a stored data is changed, notify its respective browser tab.&lt;br /&gt;
* Pass as many tests as possible.&lt;br /&gt;
* Implement the WindowLocalStorage interface which behaves slightly different from the WindowSessionStorage interface.&lt;br /&gt;
&lt;br /&gt;
== Data Design ==&lt;br /&gt;
&lt;br /&gt;
===  Data Description ===&lt;br /&gt;
&lt;br /&gt;
''The following are the data structures that will be used.''&lt;br /&gt;
&lt;br /&gt;
'''Storage''' | TreeMap&amp;lt;String,String&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''UrlMap''' | TreeMap&amp;lt;String,TreeMap&amp;lt;String,String&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Component Design ==&lt;br /&gt;
[[File:servo.jpg]]&lt;br /&gt;
=== Task ===&lt;br /&gt;
Rust provides safe concurrent abstractions through a number of core library primitives. This guide will describe the concurrency model in Rust, how it relates to the Rust type system, and introduce the fundamental library abstractions for constructing concurrent programs.&lt;br /&gt;
&lt;br /&gt;
Tasks provide failure isolation and recovery. When a fatal error occurs in Rust code as a result of an explicit call to panic!(), an assertion failure, or another invalid operation, the runtime system destroys the entire task. Unlike in languages such as Java and C++, there is no way to catch an exception. Instead, tasks may monitor each other to see if they panic.&lt;br /&gt;
&lt;br /&gt;
Tasks use Rust's type system to provide strong memory safety guarantees. In particular, the type system guarantees that tasks cannot induce a data race from shared mutable state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Generate some state locally&lt;br /&gt;
let child_task_number = generate_task_number();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    // Capture it in the remote task&lt;br /&gt;
    println!(&amp;quot;I am child number {}&amp;quot;, child_task_number);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Channel ===&lt;br /&gt;
Now that we have spawned a new task, it would be nice if we could communicate with it. For this, we use channels. A channel is simply a pair of endpoints: one for sending messages and another for receiving messages.&lt;br /&gt;
&lt;br /&gt;
The simplest way to create a channel is to use the channel function to create a (Sender, Receiver) pair. In Rust parlance, a sender is a sending endpoint of a channel, and a receiver is the receiving endpoint. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
let (tx, rx): (Sender&amp;lt;int&amp;gt;, Receiver&amp;lt;int&amp;gt;) = channel();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    let result = some_expensive_computation();&lt;br /&gt;
    tx.send(result);&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
some_other_expensive_computation();&lt;br /&gt;
let result = rx.recv();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
== UML diagrams (Eg use case diagram, class diagrams) ==&lt;br /&gt;
&lt;br /&gt;
== Proposed Test Cases ==&lt;br /&gt;
&lt;br /&gt;
== Further Readings ==&lt;br /&gt;
&lt;br /&gt;
Learning Rust by Examples: http://rustbyexample.com/ &amp;lt;br/&amp;gt;&lt;br /&gt;
Javascript as Servo's Garbage Collector: http://blog.mozilla.org/research/2014/08/26/javascript-servos-only-garbage-collector/  &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1451_hsss&amp;diff=91739</id>
		<title>CSC/ECE 517 Fall 2014/final design doc M1451 hsss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1451_hsss&amp;diff=91739"/>
		<updated>2014-11-11T21:26:40Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: Undo revision 91737 by Nkdalmia (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page contains details on the planned course of actions for the project on [https://github.com/servo/servo/wiki/WebSocket-student-project Implement WebSocket API] for the Mozilla research project [http://github.com/servo/servo/wiki/Design Servo].&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This project is about implementing a protocol to define rules regarding the nature of data being sent/receive between the web page and the server built on a Mozilla Framework. We started by creating a WebSocket interface and its corresponding Rust implementation. The constructor of this interface returns a WebSocket object which will help us in establishing a basic HTTP connection to the server. Thereafter we plan to implement methods like close, open on the API along with the onopen and onclose events. &lt;br /&gt;
&lt;br /&gt;
This WebSocket interface runs on a Servo engine. It is basically a prototype web browser engine written in the Rust language. It is currently developed on 64bit OS X and 64bit Linux. Servo is explicitly not aiming to create a full Web browser (except for demonstration and experimentation purposes). Rather it is focused on creating a&lt;br /&gt;
solid, embedded engine.&lt;br /&gt;
&lt;br /&gt;
== Architecture of system &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Design#task-supervision-diagram&amp;lt;/ref&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
=== Task Supervision Diagram ===&lt;br /&gt;
&lt;br /&gt;
[[File:TaskSupervision.png]]&lt;br /&gt;
&lt;br /&gt;
=== Task Communication Diagram ===&lt;br /&gt;
&lt;br /&gt;
[[File:TaskCommunication.png]]&lt;br /&gt;
&lt;br /&gt;
The above diagrams gives us an overview of the Servo's architecture.&lt;br /&gt;
*Each box represents a Rust task.&lt;br /&gt;
*Primary tasks are the ones which are represented by blue boxes.&lt;br /&gt;
*Gray boxes are for auxiliary tasks.&lt;br /&gt;
*White boxes are for worker tasks. Each such box represents several tasks, the precise number of which are decided by the workload.&lt;br /&gt;
*Supervisor relationships are shown by dashed lines.&lt;br /&gt;
*Communication channels are shown by solid lines.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
== Requirement analysis&amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/WebSocket-student-project&amp;lt;/ref&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
1. The initial step required downloading and building the Rust compiler. To install Rust on the machine, clone the Rust source code from Mozilla's repository on GitHub.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Then we had to build the rust compiler.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. To build the servo, we cloned the source code into the local repository.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Then we created a WebSocket.webidl file in the /servo/components/script/dom/webidls/ directory. This file was added in order to create a new interface for the web socket.This interface is inherited from the EventTarget interface in servo.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. We added several attributes and methods to the WebSocket.webidl file which we plan to execute during the course of the project&amp;lt;ref&amp;gt;https://html.spec.whatwg.org/multipage/comms.html&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
6. We created a corresponding websocket.rs file in the /servo/components/script/dom/ directory. In this file we have currently created a constructor that takes a url as an argument. We have a stub function to return the url that is used for initializing the web socket object through the constructor.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
7. We added The WebSocketTypeId to the struct in the eventtarget.rs file.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
8. We added the websocket module that we created to the lib.rs file.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
9. After making all the changes we build are changes into servo. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10. This was Part One of our project, which was a part of our OSS project.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
11. Part Two is our final project and is an extension of our OSS project.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
12. Now we will create a constructor which will return an WebSocket object and initiate a basic connection with the server. There are couple of sub parts we will need here:&lt;br /&gt;
*A ws scheme protocol handler (just as we have an http scheme protocol handler) that will implement the WS-specific parts of the connection process.&lt;br /&gt;
&lt;br /&gt;
*The ws protocol load method should transparently delegate the initial HTTP connection to http_loader::factory(); this way we do not need to duplicate the HTTP protocol code.&lt;br /&gt;
&lt;br /&gt;
*Using the same technique as the MIME sniffing project, the WS load method should intercept the response from the HTTP load. This will allow us to look at the HTTP response and verify the presence of the required Upgrade header as described in the spec before sending the connection results to the WebSocket implementation&lt;br /&gt;
&lt;br /&gt;
13. In order to allow writing more data to the existing socket connection, we plan to make the stream member in the BufferedResponse in rust-http public. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
14. We have to implement closing of connection along with on open and inclose events. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
15. Furthermore, we have to implement sending simple short strings that fit within a single frame, receiving simple data and sending fragmented payloads across multiple frames.&lt;br /&gt;
&lt;br /&gt;
== Data and component design ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UML diagrams (Eg use case diagram, class diagrams) ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Proposed Test Cases ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1451_hsss&amp;diff=91737</id>
		<title>CSC/ECE 517 Fall 2014/final design doc M1451 hsss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1451_hsss&amp;diff=91737"/>
		<updated>2014-11-11T21:26:04Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page contains details on the planned course of actions for the project on [https://github.com/servo/servo/wiki/WebSocket-student-project Implement WebSocket API] for the Mozilla research project [http://github.com/servo/servo/wiki/Design Servo].&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This project is about implementing a protocol to define rules regarding the nature of data being sent/receive between the web page and the server built on a Mozilla Framework. We started by creating a WebSocket interface and its corresponding Rust implementation. The constructor of this interface returns a WebSocket object which will help us in establishing a basic HTTP connection to the server. Thereafter we plan to implement methods like close, open on the API along with the onopen and onclose events. &lt;br /&gt;
&lt;br /&gt;
This WebSocket interface runs on a Servo engine. It is basically a prototype web browser engine written in the Rust language. It is currently developed on 64bit OS X and 64bit Linux. Servo is explicitly not aiming to create a full Web browser (except for demonstration and experimentation purposes). Rather it is focused on creating a&lt;br /&gt;
solid, embedded engine.&lt;br /&gt;
&lt;br /&gt;
== Architecture of system &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Design#task-supervision-diagram&amp;lt;/ref&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
=== Task Supervision Diagram ===&lt;br /&gt;
&lt;br /&gt;
[[File:TaskSupervision.png]]&lt;br /&gt;
&lt;br /&gt;
=== Task Communication Diagram ===&lt;br /&gt;
&lt;br /&gt;
[[File:TaskCommunication.png]]&lt;br /&gt;
&lt;br /&gt;
The above diagrams gives us an overview of the Servo's architecture.&lt;br /&gt;
*Each box represents a Rust task.&lt;br /&gt;
*Primary tasks are the ones which are represented by blue boxes.&lt;br /&gt;
*Gray boxes are for auxiliary tasks.&lt;br /&gt;
*White boxes are for worker tasks. Each such box represents several tasks, the precise number of which are decided by the workload.&lt;br /&gt;
*Supervisor relationships are shown by dashed lines.&lt;br /&gt;
*Communication channels are shown by solid lines.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
== Requirement analysis&amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/WebSocket-student-project&amp;lt;/ref&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
1. The initial step required downloading and building the Rust compiler. To install Rust on the machine, clone the Rust source code from Mozilla's repository on GitHub.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Then we had to build the rust compiler.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. To build the servo, we cloned the source code into the local repository.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Then we created a WebSocket.webidl file in the /servo/components/script/dom/webidls/ directory. This file was added in order to create a new interface for the web socket.This interface is inherited from the EventTarget interface in servo.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. We added several attributes and methods to the WebSocket.webidl file which we plan to execute during the course of the project&amp;lt;ref&amp;gt;https://html.spec.whatwg.org/multipage/comms.html&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
6. We created a corresponding websocket.rs file in the /servo/components/script/dom/ directory. In this file we have currently created a constructor that takes a url as an argument. We have a stub function to return the url that is used for initializing the web socket object through the constructor.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
7. We added The WebSocketTypeId to the struct in the eventtarget.rs file.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
8. We added the websocket module that we created to the lib.rs file.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
9. After making all the changes we build are changes into servo. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10. This was Part One of our project, which was a part of our OSS project.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
11. Part Two is our final project and is an extension of our OSS project.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
12. Now we will create a constructor which will return an WebSocket object and initiate a basic connection with the server. There are couple of sub parts we will need here:&lt;br /&gt;
*A ws scheme protocol handler (just as we have an http scheme protocol handler) that will implement the WS-specific parts of the connection process.&lt;br /&gt;
&lt;br /&gt;
*The ws protocol load method should transparently delegate the initial HTTP connection to http_loader::factory(); this way we do not need to duplicate the HTTP protocol code.&lt;br /&gt;
&lt;br /&gt;
*Using the same technique as the MIME sniffing project, the WS load method should intercept the response from the HTTP load. This will allow us to look at the HTTP response and verify the presence of the required Upgrade header as described in the spec before sending the connection results to the WebSocket implementation&lt;br /&gt;
&lt;br /&gt;
13. In order to allow writing more data to the existing socket connection, we plan to make the stream member in the BufferedResponse in rust-http public. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
14. We have to implement closing of connection along with on open and inclose events. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
15. Furthermore, we have to implement sending simple short strings that fit within a single frame, receiving simple data and sending fragmented payloads across multiple frames.&lt;br /&gt;
&lt;br /&gt;
== Data and component design ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UML diagrams (Eg use case diagram, class diagrams) ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Proposed Test Cases ==&lt;br /&gt;
&lt;br /&gt;
== Further Readings ==&lt;br /&gt;
&lt;br /&gt;
Learning Rust by Examples: http://rustbyexample.com/ &amp;lt;br/&amp;gt;&lt;br /&gt;
JavaScript as Servo's Garbage Collector: http://blog.mozilla.org/research/2014/08/26/javascript-servos-only-garbage-collector/  &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=91736</id>
		<title>CSC/ECE 517 Fall 2014/final design doc M1450 navr</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=91736"/>
		<updated>2014-11-11T21:23:49Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: /* Requirement analysis https://github.com/servo/servo/wiki/Storage-student-project */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== [http://www.rust-lang.org/ Rust]===&lt;br /&gt;
&lt;br /&gt;
Rust is a modern systems programming language focusing on safety and speed to build reliable and efficient systems &amp;lt;ref&amp;gt; http://doc.rust-lang.org/nightly/intro.html &amp;lt;/ref&amp;gt;. It accomplishes the goals of memory safe without using garbage collection and it supports concurrency and parallelism in building platforms. &lt;br /&gt;
&lt;br /&gt;
Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://github.com/servo/servo/wiki/Design Servo] ===&lt;br /&gt;
&lt;br /&gt;
Mozilla Research team is currently working on an experimental project to develop a new Web browser engine &amp;quot;Servo&amp;quot;, that is capable of supporting a variety of current and next generation of hardware like mobile devices, multi-core processors and high-performance GPUs. Servo builds on top of Rust to provide a secure and reliable foundation. It is currently developed on 64 bit devices.&amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main objectives of this experimentation project is improving the layout to graphics rendering - to optimize for power efficiency and maximize parallelism. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Purpose ===&lt;br /&gt;
&lt;br /&gt;
The purpose of this project is to introduce the support related to sessionstorage and localstorage in Servo Broswer, for this we have to create Storage structure and allow web pages to store data in the Servo memory space.&lt;br /&gt;
&lt;br /&gt;
=== Background ===&lt;br /&gt;
&lt;br /&gt;
Persistent storage on the web is used by many services such as the popular Disqus commenting interface. Implementing this important specification in Servo will allow stateful web applications to run, and will help expose any architectural problems that Servo's radical design may cause.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
[[File:task.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Architecture comprises of a Storage Task which will be responsible to hold all the data that the web page requests to save. This happens via Channels in Rust, which implements a Sender Receiver protocol, the task is runnning in the background and waits to receive the data sent from the web page.&lt;br /&gt;
&lt;br /&gt;
=== Architecture Explained ===&lt;br /&gt;
*Each box represents a Rust task.&lt;br /&gt;
*Blue boxes represent the primary tasks in the browser pipeline.&lt;br /&gt;
*Gray boxes represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
*White boxes represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
*Dashed lines indicate supervisor relationships.&lt;br /&gt;
*Solid lines indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
== Requirement Analysis &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
As part of our [http://github.com/servo/servo/wiki/Storage-student-project project], we have to implement the [http://html.spec.whatwg.org/multipage/webstorage.html#webstorage Web Storage] specification in Servo. Implementing this important specification in Servo will allow stateful web applications to run, and will help expose any architectural problems that Servo's radical design may cause. &amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below is a high level overview of the various steps that need to be carried out to achieve this:&lt;br /&gt;
&lt;br /&gt;
* Create the Storage interface and its stub implementation.&lt;br /&gt;
* Create the WindowSessionStorage interface making it return a Storage instance.&lt;br /&gt;
* Create a Storage Task which will be used to contain all stored data.&lt;br /&gt;
* Define a message-passing interface for reading and writing stored data for a particular browser tab.&lt;br /&gt;
* Use the Storage task in the implementation of Storage.&lt;br /&gt;
* When the value of a stored data is changed, notify its respective browser tab.&lt;br /&gt;
* Pass as many tests as possible.&lt;br /&gt;
* Implement the WindowLocalStorage interface which behaves slightly different from the WindowSessionStorage interface.&lt;br /&gt;
&lt;br /&gt;
== Data Design ==&lt;br /&gt;
&lt;br /&gt;
===  Data Description ===&lt;br /&gt;
&lt;br /&gt;
''The following are the data structures that will be used.''&lt;br /&gt;
&lt;br /&gt;
'''Storage''' | TreeMap&amp;lt;String,String&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''UrlMap''' | TreeMap&amp;lt;String,TreeMap&amp;lt;String,String&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Component Design ==&lt;br /&gt;
[[File:servo.jpg]]&lt;br /&gt;
=== Task ===&lt;br /&gt;
Rust provides safe concurrent abstractions through a number of core library primitives. This guide will describe the concurrency model in Rust, how it relates to the Rust type system, and introduce the fundamental library abstractions for constructing concurrent programs.&lt;br /&gt;
&lt;br /&gt;
Tasks provide failure isolation and recovery. When a fatal error occurs in Rust code as a result of an explicit call to panic!(), an assertion failure, or another invalid operation, the runtime system destroys the entire task. Unlike in languages such as Java and C++, there is no way to catch an exception. Instead, tasks may monitor each other to see if they panic.&lt;br /&gt;
&lt;br /&gt;
Tasks use Rust's type system to provide strong memory safety guarantees. In particular, the type system guarantees that tasks cannot induce a data race from shared mutable state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Generate some state locally&lt;br /&gt;
let child_task_number = generate_task_number();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    // Capture it in the remote task&lt;br /&gt;
    println!(&amp;quot;I am child number {}&amp;quot;, child_task_number);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Channel ===&lt;br /&gt;
Now that we have spawned a new task, it would be nice if we could communicate with it. For this, we use channels. A channel is simply a pair of endpoints: one for sending messages and another for receiving messages.&lt;br /&gt;
&lt;br /&gt;
The simplest way to create a channel is to use the channel function to create a (Sender, Receiver) pair. In Rust parlance, a sender is a sending endpoint of a channel, and a receiver is the receiving endpoint. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
let (tx, rx): (Sender&amp;lt;int&amp;gt;, Receiver&amp;lt;int&amp;gt;) = channel();&lt;br /&gt;
&lt;br /&gt;
spawn(proc() {&lt;br /&gt;
    let result = some_expensive_computation();&lt;br /&gt;
    tx.send(result);&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
some_other_expensive_computation();&lt;br /&gt;
let result = rx.recv();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
== UML diagrams (Eg use case diagram, class diagrams) ==&lt;br /&gt;
&lt;br /&gt;
== Proposed Test Cases ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=91695</id>
		<title>CSC/ECE 517 Fall 2014/final design doc M1450 navr</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr&amp;diff=91695"/>
		<updated>2014-11-11T16:46:31Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: Created page with &amp;quot;== Introduction and architecture of system ==  == Requirement analysis &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt; ==  == Data and component design == ...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction and architecture of system ==&lt;br /&gt;
&lt;br /&gt;
== Requirement analysis &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
== Data and component design ==&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
== UML diagrams (Eg use case diagram, class diagrams) ==&lt;br /&gt;
&lt;br /&gt;
== Proposed Test Cases ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014&amp;diff=91694</id>
		<title>CSC/ECE 517 Fall 2014</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014&amp;diff=91694"/>
		<updated>2014-11-11T16:41:39Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[CSC/ECE_517_Fall_2014/sample_page]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/ch1a 22 as]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 19 mx]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 3 zq]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 4 lf]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 4 wl]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a a7 ch]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 25 rs]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 25 jf]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 8 os]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 8 sn]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 15 gs]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 10 hu]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 20 kv]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 21 as]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 24 sa]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 26 sn]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 6 rl]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 2 ss]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 16 av]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 1 rm]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 1 sj]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 23 ss]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 20 rn]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 22 sp]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/oss M1454 rss]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 26 gn]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 13 va]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 9 aa]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 9 kn]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 11 ap]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 25 ks]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 7 kz]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/ch1a_6_bn]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/ch1a 10 zz]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/ch1a 16 va]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/ch1a F1415 rv]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/ch1a_3_cp]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1b 26 sa]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/ch1b_28_cg]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/ch1b 29 ry]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/ch1b 30 cs]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/ch1b_33_jy]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/ch1b_27_js]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/oss E1453 syy]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/oss E1463 vpd]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/oss E1465 oak]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/oss_M1456_kdv]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/oss_M1453_sst]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/oss_E1456_akk]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/oss_M1455_asa]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/oss_E1458_sst]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/oss_E1457_ags]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/OSS_E1466_gjf]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/oss_M1452_jns]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/oss_E1462_nms]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/OSS_S1455_ajp]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/OSS_S1454_ccc]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/OSS_E1450_cxm]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/OSS_E1455_skn]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/OSS_M1450_vda]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/OSS_E1467_rsv]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/OSS_E1464_vnn]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/OSS_M1451_ahs]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/OSS_E1451_las]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/OSS_E1461_knn]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/oss_E1460_aua]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/oss_E1459_jjr]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/final_E1474_akkn]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/final_E1472_gjfz]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/final_design_doc_M1451_hsss]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/final_E1471_asuv]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/final_E1475_nrnn]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/final_design_doc_M1450_navr]]&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_M1450_vda&amp;diff=91523</id>
		<title>CSC/ECE 517 Fall 2014/OSS M1450 vda</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_M1450_vda&amp;diff=91523"/>
		<updated>2014-11-06T05:10:57Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: /* Design Pattern Used */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implement Window.sessionStorage ==&lt;br /&gt;
&lt;br /&gt;
This wiki page contains details on the work done for the initial step of the task &amp;lt;code&amp;gt; [http://github.com/servo/servo/wiki/Storage-student-project Implement Window.sessionStorage] &amp;lt;/code&amp;gt; for the [http://www.mozilla.org/ Mozilla] research project [http://github.com/servo/servo/wiki/Design Servo].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== [http://www.rust-lang.org/ Rust]===&lt;br /&gt;
&lt;br /&gt;
Rust is a modern systems programming language focusing on safety and speed to build reliable and efficient systems &amp;lt;ref&amp;gt; http://doc.rust-lang.org/nightly/intro.html &amp;lt;/ref&amp;gt;. It accomplishes the goals of memory safe without using garbage collection and it supports concurrency and parallelism in building platforms. &lt;br /&gt;
&lt;br /&gt;
Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://github.com/servo/servo/wiki/Design Servo] ===&lt;br /&gt;
&lt;br /&gt;
Mozilla Research team is currently working on an experimental project to develop a new Web browser engine &amp;quot;Servo&amp;quot;, that is capable of supporting a variety of current and next generation of hardware like mobile devices, multi-core processors and high-performance GPUs. Servo builds on top of Rust to provide a secure and reliable foundation. It is currently developed on 64 bit devices.&amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main objectives of this experimentation project is improving the layout to graphics rendering - to optimize for power efficiency and maximize parallelism. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Developer Environment Setup &amp;lt;ref&amp;gt;https://github.com/servo/servo/blob/master/README.md&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
=== Installing Required Packages for Servo ===&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
pip install virtualenv&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
    freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
    fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
    rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
pushd .&lt;br /&gt;
cd /tmp&lt;br /&gt;
wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
popd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Building Servo ===&lt;br /&gt;
&lt;br /&gt;
Clone the Servo repository hosted at https://github.com/servo/servo and switch to the working directory.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git clone https://github.com/servo/servo&lt;br /&gt;
cd servo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Normal Build'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Building for Android target'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
cd ports/android&lt;br /&gt;
ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;I&amp;gt;Note: Building Servo will take a considerable amount of time. &amp;lt;/I&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Launch Servo ===&lt;br /&gt;
&lt;br /&gt;
Once the build is successful, launch Servo using this command.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach run tests/html/about-mozilla.html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:servo.png]]&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
&lt;br /&gt;
The [http://html.spec.whatwg.org/multipage/webstorage.html#webstorage Web Storage] specification defines the means by which a web application can store string key/value pairs in a browser and later retrieve them for use.&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage&amp;lt;/ref&amp;gt; It supports persistent data storage, similar to [http://en.wikipedia.org/wiki/HTTP_cookie cookies] but with a greatly enhanced capacity and no information stored in the [http://en.wikipedia.org/wiki/List_of_HTTP_headers HTTP request header].&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Web_storage&amp;lt;/ref&amp;gt; There are two types of web storage: [http://html.spec.whatwg.org/multipage/webstorage.html#dom-localstorage local storage] and [http://html.spec.whatwg.org/multipage/webstorage.html#dom-sessionstorage session storage].&lt;br /&gt;
&lt;br /&gt;
Browsers that support web storage have the global variables 'sessionStorage' and 'localStorage' declared at the [http://developer.mozilla.org/en-US/docs/Web/API/Window?redirectlocale=en-US&amp;amp;redirectslug=DOM%2Fwindow window] level. The following JavaScript code gives an example of how to use web storage:&lt;br /&gt;
&lt;br /&gt;
'''sessionStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on browser for duration of the session&lt;br /&gt;
sessionStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (gets deleted when browser is closed and re-opened)&lt;br /&gt;
alert(sessionStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''localStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on the browser beyond the duration of the session&lt;br /&gt;
localStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (persists even after closing and re-opening the browser)&lt;br /&gt;
alert(localStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As part of our [http://github.com/servo/servo/wiki/Storage-student-project project], we have to implement this specification in Servo. Implementing this important specification in Servo will allow stateful web applications to run, and will help expose any architectural problems that Servo's radical design may cause. &amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
For the OSS project, we had to complete the initial step of the project i.e. create the Storage interface and its stub implementation.&lt;br /&gt;
&lt;br /&gt;
We made the following changes:&lt;br /&gt;
&lt;br /&gt;
* Created a new file called [http://github.com/nkdalmia/servo/tree/master/components/script/dom/webidls Storage.webidl] under the folder '''''components/script/dom/webidls.'''''&lt;br /&gt;
&lt;br /&gt;
* Added the method definitions in the above interface file.&lt;br /&gt;
&lt;br /&gt;
* Created another file called [http://github.com/nkdalmia/servo/tree/master/components/script/dom storage.rs] under the specified folder '''''components/script/dom.''''' &lt;br /&gt;
&lt;br /&gt;
* Added constructor for Storage object and stub implementations of the methods defined in the above mentioned interface file.&lt;br /&gt;
&lt;br /&gt;
* Added our module entry in the file ''''' components/script/lib.rs ''''' so that our files are compiled as part of the Servo build.&lt;br /&gt;
&lt;br /&gt;
* Built the Servo once again and verified that the Servo browser was launching correctly.&lt;br /&gt;
&lt;br /&gt;
== Design Pattern ==&lt;br /&gt;
&lt;br /&gt;
We will be using &amp;quot;Delegation Pattern&amp;quot; for our final project implementation. Our implementation will store the Web Storage data in memory. But, this will change in future once “Servo” has the mechanism to persist data on the client side (for example: in filesystem or database). So, we need to use a design pattern which will help in incorporating this future change without making a lot of changes to our actual implementation.&lt;br /&gt;
&lt;br /&gt;
We can ensure this using &amp;quot;Delegation Pattern&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:Delegation.jpg]]&lt;br /&gt;
&lt;br /&gt;
* We will define a new class 'MemoryStorage' (file memory_storage.rs) which implements the interface 'Storage' (file Storage.webidl).&lt;br /&gt;
* The class 'Storage' (file storage.rs) will have a private attribute 'realStorage'&lt;br /&gt;
** Object referred by 'realStorage' also implements the interface 'Storage'&lt;br /&gt;
** When a new object for 'Storage' class is created, a new 'MemoryStorage' object will be created and assigned to the attribute 'realStorage'&lt;br /&gt;
* The APIs in 'Storage' class will delegate the calls to the respective APIs in the object referenced by the 'realStorage' attribute&lt;br /&gt;
* Once the mechanism to persist data on client side is available, we can create a new class 'FileStorage' (or 'DBStorage') and assign its object to 'realStorage' during initialization of 'Storage' class. Rest of the code in 'Storage' class will remain unchanged.&lt;br /&gt;
&lt;br /&gt;
== Future Work &amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Storage-student-project &amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
* Create the WindowSessionStorage interface making it return a Storage instance.&lt;br /&gt;
* Create a Storage task which will be used to contain all stored data.&lt;br /&gt;
* Define a message-passing interface for reading and writing stored data for a particular browser tab.&lt;br /&gt;
* Use the Storage task in the implementation of Storage.&lt;br /&gt;
* When the value of a stored data is changed, notify its respective browser tab.&lt;br /&gt;
* Pass as many tests as possible.&lt;br /&gt;
* Implement the WindowLocalStorage interface which behaves slightly different from the WindowSessionStorage interface.&lt;br /&gt;
&lt;br /&gt;
== Further Readings ==&lt;br /&gt;
&lt;br /&gt;
Design and Architecture of Servo: http://github.com/servo/servo/wiki/Design/ &amp;lt;br/&amp;gt;&lt;br /&gt;
Learning Rust by Examples: http://rustbyexample.com/ &amp;lt;br/&amp;gt;&lt;br /&gt;
Javascript as Servo's Garbage Collector: http://blog.mozilla.org/research/2014/08/26/javascript-servos-only-garbage-collector/  &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Delegation.jpg&amp;diff=91493</id>
		<title>File:Delegation.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Delegation.jpg&amp;diff=91493"/>
		<updated>2014-11-06T04:05:49Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: uploaded a new version of &amp;amp;quot;File:Delegation.jpg&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_M1450_vda&amp;diff=91322</id>
		<title>CSC/ECE 517 Fall 2014/OSS M1450 vda</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_M1450_vda&amp;diff=91322"/>
		<updated>2014-10-30T04:14:18Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: /* Project Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implement Window.sessionStorage ==&lt;br /&gt;
&lt;br /&gt;
This wiki page contains details on the work done for the initial step of the task &amp;lt;code&amp;gt; [http://github.com/servo/servo/wiki/Storage-student-project Implement Window.sessionStorage] &amp;lt;/code&amp;gt; for the [http://www.mozilla.org/ Mozilla] research project [http://github.com/servo/servo/wiki/Design Servo].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== [http://www.rust-lang.org/ Rust]===&lt;br /&gt;
&lt;br /&gt;
Rust is a modern systems programming language focusing on safety and speed to build reliable and efficient systems &amp;lt;ref&amp;gt; http://doc.rust-lang.org/nightly/intro.html &amp;lt;/ref&amp;gt;. It accomplishes the goals of memory safe without using garbage collection and it supports concurrency and parallelism in building platforms. &lt;br /&gt;
&lt;br /&gt;
Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://github.com/servo/servo/wiki/Design Servo] ===&lt;br /&gt;
&lt;br /&gt;
Mozilla Research team is currently working on an experimental project to develop a new Web browser engine &amp;quot;Servo&amp;quot;, that is capable of supporting a variety of current and next generation of hardware like mobile devices, multi-core processors and high-performance GPUs. Servo builds on top of Rust to provide a secure and reliable foundation. It is currently developed on 64 bit devices.&amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main objectives of this experimentation project is improving the layout to graphics rendering - to optimize for power efficiency and maximize parallelism. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Developer Environment Setup &amp;lt;ref&amp;gt;https://github.com/servo/servo/blob/master/README.md&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
=== Installing Required Packages for Servo ===&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
pip install virtualenv&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
    freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
    fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
    rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
pushd .&lt;br /&gt;
cd /tmp&lt;br /&gt;
wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
popd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Building Servo ===&lt;br /&gt;
&lt;br /&gt;
Clone the Servo repository hosted at https://github.com/servo/servo and switch to the working directory.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git clone https://github.com/servo/servo&lt;br /&gt;
cd servo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Normal Build'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Building for Android target'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
cd ports/android&lt;br /&gt;
ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;I&amp;gt;Note: Building Servo will take a considerable amount of time. &amp;lt;/I&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Launch Servo ===&lt;br /&gt;
&lt;br /&gt;
Once the build is successful, launch Servo using this command.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach run tests/html/about-mozilla.html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:servo.png]]&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
&lt;br /&gt;
The [http://html.spec.whatwg.org/multipage/webstorage.html#webstorage Web Storage] specification defines the means by which a web application can store string key/value pairs in a browser and later retrieve them for use.&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage&amp;lt;/ref&amp;gt; It supports persistent data storage, similar to [http://en.wikipedia.org/wiki/HTTP_cookie cookies] but with a greatly enhanced capacity and no information stored in the [http://en.wikipedia.org/wiki/List_of_HTTP_headers HTTP request header].&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Web_storage&amp;lt;/ref&amp;gt; There are two types of web storage: [http://html.spec.whatwg.org/multipage/webstorage.html#dom-localstorage local storage] and [http://html.spec.whatwg.org/multipage/webstorage.html#dom-sessionstorage session storage].&lt;br /&gt;
&lt;br /&gt;
Browsers that support web storage have the global variables 'sessionStorage' and 'localStorage' declared at the [http://developer.mozilla.org/en-US/docs/Web/API/Window?redirectlocale=en-US&amp;amp;redirectslug=DOM%2Fwindow window] level. The following JavaScript code gives an example of how to use web storage:&lt;br /&gt;
&lt;br /&gt;
'''sessionStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on browser for duration of the session&lt;br /&gt;
sessionStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (gets deleted when browser is closed and re-opened)&lt;br /&gt;
alert(sessionStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''localStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on the browser beyond the duration of the session&lt;br /&gt;
localStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (persists even after closing and re-opening the browser)&lt;br /&gt;
alert(localStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As part of our [http://github.com/servo/servo/wiki/Storage-student-project project], we have to implement this specification in Servo. Implementing this important specification in Servo will allow stateful web applications to run, and will help expose any architectural problems that Servo's radical design may cause. &amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
For the OSS project, we had to complete the initial step of the project i.e. create the Storage interface and its stub implementation.&lt;br /&gt;
&lt;br /&gt;
We made the following changes:&lt;br /&gt;
&lt;br /&gt;
* Created a new file called [http://github.com/nkdalmia/servo/tree/master/components/script/dom/webidls Storage.webidl] under the folder '''''components/script/dom/webidls.'''''&lt;br /&gt;
&lt;br /&gt;
* Added the method definitions in the above interface file.&lt;br /&gt;
&lt;br /&gt;
* Created another file called [http://github.com/nkdalmia/servo/tree/master/components/script/dom storage.rs] under the specified folder '''''components/script/dom.''''' &lt;br /&gt;
&lt;br /&gt;
* Added constructor for Storage object and stub implementations of the methods defined in the above mentioned interface file.&lt;br /&gt;
&lt;br /&gt;
* Added our module entry in the file ''''' components/script/lib.rs ''''' so that our files are compiled as part of the Servo build.&lt;br /&gt;
&lt;br /&gt;
* Built the Servo once again and verified that the Servo browser was launching correctly.&lt;br /&gt;
&lt;br /&gt;
== Future Work &amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Storage-student-project &amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
* Create the WindowSessionStorage interface making it return a Storage instance.&lt;br /&gt;
* Create a Storage task which will be used to contain all stored data.&lt;br /&gt;
* Define a message-passing interface for reading and writing stored data for a particular browser tab.&lt;br /&gt;
* Use the Storage task in the implementation of Storage.&lt;br /&gt;
* When the value of a stored data is changed, notify its respective browser tab.&lt;br /&gt;
* Pass as many tests as possible.&lt;br /&gt;
* Implement the WindowLocalStorage interface which behaves slightly different from the WindowSessionStorage interface.&lt;br /&gt;
&lt;br /&gt;
== Further Readings ==&lt;br /&gt;
&lt;br /&gt;
Design and Architecture of Servo: http://github.com/servo/servo/wiki/Design/ &amp;lt;br/&amp;gt;&lt;br /&gt;
Learning Rust by Examples: http://rustbyexample.com/ &amp;lt;br/&amp;gt;&lt;br /&gt;
Javascript as Servo's Garbage Collector: http://blog.mozilla.org/research/2014/08/26/javascript-servos-only-garbage-collector/  &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_M1450_vda&amp;diff=91316</id>
		<title>CSC/ECE 517 Fall 2014/OSS M1450 vda</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_M1450_vda&amp;diff=91316"/>
		<updated>2014-10-30T04:06:59Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: /* Project Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implement Window.sessionStorage ==&lt;br /&gt;
&lt;br /&gt;
This wiki page contains details on the work done for the initial step of the task &amp;lt;code&amp;gt; [http://github.com/servo/servo/wiki/Storage-student-project Implement Window.sessionStorage] &amp;lt;/code&amp;gt; for the [http://www.mozilla.org/ Mozilla] research project [http://github.com/servo/servo/wiki/Design Servo].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== [http://www.rust-lang.org/ Rust]===&lt;br /&gt;
&lt;br /&gt;
Rust is a modern systems programming language focusing on safety and speed to build reliable and efficient systems &amp;lt;ref&amp;gt; http://doc.rust-lang.org/nightly/intro.html &amp;lt;/ref&amp;gt;. It accomplishes the goals of memory safe without using garbage collection and it supports concurrency and parallelism in building platforms. &lt;br /&gt;
&lt;br /&gt;
Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://github.com/servo/servo/wiki/Design Servo] ===&lt;br /&gt;
&lt;br /&gt;
Mozilla Research team is currently working on an experimental project to develop a new Web browser engine &amp;quot;Servo&amp;quot;, that is capable of supporting a variety of current and next generation of hardware like mobile devices, multi-core processors and high-performance GPUs. Servo builds on top of Rust to provide a secure and reliable foundation. It is currently developed on 64 bit devices.&amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main objectives of this experimentation project is improving the layout to graphics rendering - to optimize for power efficiency and maximize parallelism. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Developer Environment Setup &amp;lt;ref&amp;gt;https://github.com/servo/servo/blob/master/README.md&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
=== Installing Required Packages for Servo ===&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
pip install virtualenv&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
    freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
    fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
    rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
pushd .&lt;br /&gt;
cd /tmp&lt;br /&gt;
wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
popd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Building Servo ===&lt;br /&gt;
&lt;br /&gt;
Clone the Servo repository hosted at https://github.com/servo/servo and switch to the working directory.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git clone https://github.com/servo/servo&lt;br /&gt;
cd servo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Normal Build'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Building for Android target'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
cd ports/android&lt;br /&gt;
ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;I&amp;gt;Note: Building Servo will take a considerable amount of time. &amp;lt;/I&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Launch Servo ===&lt;br /&gt;
&lt;br /&gt;
Once the build is successful, launch Servo using this command.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach run tests/html/about-mozilla.html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:servo.png]]&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
&lt;br /&gt;
The [http://html.spec.whatwg.org/multipage/webstorage.html#webstorage Web Storage] specification defines the means by which a web application can store string key/value pairs in a browser and later retrieve them for use.&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage&amp;lt;/ref&amp;gt; It supports persistent data storage, similar to cookies but with a greatly enhanced capacity and no information stored in the HTTP request header&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Web_storage&amp;lt;/ref&amp;gt;. There are two types of web storage: [http://html.spec.whatwg.org/multipage/webstorage.html#dom-localstorage local storage] and [http://html.spec.whatwg.org/multipage/webstorage.html#dom-sessionstorage session storage].&lt;br /&gt;
&lt;br /&gt;
Browsers that support web storage have the global variables 'sessionStorage' and 'localStorage' declared at the window level. The following JavaScript code can be used on browsers to trigger web storage behaviour:&lt;br /&gt;
&lt;br /&gt;
'''sessionStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on browser for duration of the session&lt;br /&gt;
sessionStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (gets deleted when browser is closed and re-opened)&lt;br /&gt;
alert(sessionStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''localStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on the browser beyond the duration of the session&lt;br /&gt;
localStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (persists even after closing and re-opening the browser)&lt;br /&gt;
alert(localStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As part of our [http://github.com/servo/servo/wiki/Storage-student-project project], we have to implement this specification in Servo. Implementing this important specification in Servo will allow stateful web applications to run, and will help expose any architectural problems that Servo's radical design may cause. &amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
For the OSS project, we had to complete the initial step of the project i.e. create the Storage interface and its stub implementation.&lt;br /&gt;
&lt;br /&gt;
We made the following changes:&lt;br /&gt;
&lt;br /&gt;
* Created a new file called [http://github.com/nkdalmia/servo/tree/master/components/script/dom/webidls Storage.webidl] under the folder '''''components/script/dom/webidls.'''''&lt;br /&gt;
&lt;br /&gt;
* Added the method definitions in the above interface file.&lt;br /&gt;
&lt;br /&gt;
* Created another file called [http://github.com/nkdalmia/servo/tree/master/components/script/dom storage.rs] under the specified folder '''''components/script/dom.''''' &lt;br /&gt;
&lt;br /&gt;
* Added constructor for Storage object and stub implementations of the methods defined in the above mentioned interface file.&lt;br /&gt;
&lt;br /&gt;
* Added our module entry in the file ''''' components/script/lib.rs ''''' so that our files are compiled as part of the Servo build.&lt;br /&gt;
&lt;br /&gt;
* Built the Servo once again and verified that the Servo browser was launching correctly.&lt;br /&gt;
&lt;br /&gt;
== Future Work &amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Storage-student-project &amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
* Create the WindowSessionStorage interface making it return a Storage instance.&lt;br /&gt;
* Create a Storage task which will be used to contain all stored data.&lt;br /&gt;
* Define a message-passing interface for reading and writing stored data for a particular browser tab.&lt;br /&gt;
* Use the Storage task in the implementation of Storage.&lt;br /&gt;
* When the value of a stored data is changed, notify its respective browser tab.&lt;br /&gt;
* Pass as many tests as possible.&lt;br /&gt;
* Implement the WindowLocalStorage interface which behaves slightly different from the WindowSessionStorage interface.&lt;br /&gt;
&lt;br /&gt;
== Further Readings ==&lt;br /&gt;
&lt;br /&gt;
Design and Architecture of Servo: http://github.com/servo/servo/wiki/Design/ &amp;lt;br/&amp;gt;&lt;br /&gt;
Learning Rust by Examples: http://rustbyexample.com/ &amp;lt;br/&amp;gt;&lt;br /&gt;
Javascript as Servo's Garbage Collector: http://blog.mozilla.org/research/2014/08/26/javascript-servos-only-garbage-collector/  &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_M1450_vda&amp;diff=91315</id>
		<title>CSC/ECE 517 Fall 2014/OSS M1450 vda</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_M1450_vda&amp;diff=91315"/>
		<updated>2014-10-30T04:05:15Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: /* Project Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implement Window.sessionStorage ==&lt;br /&gt;
&lt;br /&gt;
This wiki page contains details on the work done for the initial step of the task &amp;lt;code&amp;gt; [http://github.com/servo/servo/wiki/Storage-student-project Implement Window.sessionStorage] &amp;lt;/code&amp;gt; for the [http://www.mozilla.org/ Mozilla] research project [http://github.com/servo/servo/wiki/Design Servo].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== [http://www.rust-lang.org/ Rust]===&lt;br /&gt;
&lt;br /&gt;
Rust is a modern systems programming language focusing on safety and speed to build reliable and efficient systems &amp;lt;ref&amp;gt; http://doc.rust-lang.org/nightly/intro.html &amp;lt;/ref&amp;gt;. It accomplishes the goals of memory safe without using garbage collection and it supports concurrency and parallelism in building platforms. &lt;br /&gt;
&lt;br /&gt;
Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://github.com/servo/servo/wiki/Design Servo] ===&lt;br /&gt;
&lt;br /&gt;
Mozilla Research team is currently working on an experimental project to develop a new Web browser engine &amp;quot;Servo&amp;quot;, that is capable of supporting a variety of current and next generation of hardware like mobile devices, multi-core processors and high-performance GPUs. Servo builds on top of Rust to provide a secure and reliable foundation. It is currently developed on 64 bit devices.&amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main objectives of this experimentation project is improving the layout to graphics rendering - to optimize for power efficiency and maximize parallelism. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Developer Environment Setup &amp;lt;ref&amp;gt;https://github.com/servo/servo/blob/master/README.md&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
=== Installing Required Packages for Servo ===&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
pip install virtualenv&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
    freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
    fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
    rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
pushd .&lt;br /&gt;
cd /tmp&lt;br /&gt;
wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
popd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Building Servo ===&lt;br /&gt;
&lt;br /&gt;
Clone the Servo repository hosted at https://github.com/servo/servo and switch to the working directory.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git clone https://github.com/servo/servo&lt;br /&gt;
cd servo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Normal Build'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Building for Android target'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
cd ports/android&lt;br /&gt;
ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;I&amp;gt;Note: Building Servo will take a considerable amount of time. &amp;lt;/I&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Launch Servo ===&lt;br /&gt;
&lt;br /&gt;
Once the build is successful, launch Servo using this command.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach run tests/html/about-mozilla.html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:servo.png]]&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
&lt;br /&gt;
The [http://html.spec.whatwg.org/multipage/webstorage.html#webstorage Web Storage] specification defines the means by which a web application can store string key/value pairs in a browser and later retrieve them for use. It supports persistent data storage, similar to cookies but with a greatly enhanced capacity and no information stored in the HTTP request header&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Web_storage&amp;lt;/ref&amp;gt;. There are two types of web storage: [http://html.spec.whatwg.org/multipage/webstorage.html#dom-localstorage local storage] and [http://html.spec.whatwg.org/multipage/webstorage.html#dom-sessionstorage session storage].&lt;br /&gt;
&lt;br /&gt;
Browsers that support web storage have the global variables 'sessionStorage' and 'localStorage' declared at the window level. The following JavaScript code can be used on browsers to trigger web storage behaviour:&lt;br /&gt;
&lt;br /&gt;
'''sessionStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on browser for duration of the session&lt;br /&gt;
sessionStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (gets deleted when browser is closed and re-opened)&lt;br /&gt;
alert(sessionStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''localStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on the browser beyond the duration of the session&lt;br /&gt;
localStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (persists even after closing and re-opening the browser)&lt;br /&gt;
alert(localStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As part of our [http://github.com/servo/servo/wiki/Storage-student-project project], we have to implement this specification in Servo. Implementing this important specification in Servo will allow stateful web applications to run, and will help expose any architectural problems that Servo's radical design may cause. &amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
For the OSS project, we had to complete the initial step of the project i.e. create the Storage interface and its stub implementation.&lt;br /&gt;
&lt;br /&gt;
We made the following changes:&lt;br /&gt;
&lt;br /&gt;
* Created a new file called [http://github.com/nkdalmia/servo/tree/master/components/script/dom/webidls Storage.webidl] under the folder '''''components/script/dom/webidls.'''''&lt;br /&gt;
&lt;br /&gt;
* Added the method definitions in the above interface file.&lt;br /&gt;
&lt;br /&gt;
* Created another file called [http://github.com/nkdalmia/servo/tree/master/components/script/dom storage.rs] under the specified folder '''''components/script/dom.''''' &lt;br /&gt;
&lt;br /&gt;
* Added constructor for Storage object and stub implementations of the methods defined in the above mentioned interface file.&lt;br /&gt;
&lt;br /&gt;
* Added our module entry in the file ''''' components/script/lib.rs ''''' so that our files are compiled as part of the Servo build.&lt;br /&gt;
&lt;br /&gt;
* Built the Servo once again and verified that the Servo browser was launching correctly.&lt;br /&gt;
&lt;br /&gt;
== Future Work &amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Storage-student-project &amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
* Create the WindowSessionStorage interface making it return a Storage instance.&lt;br /&gt;
* Create a Storage task which will be used to contain all stored data.&lt;br /&gt;
* Define a message-passing interface for reading and writing stored data for a particular browser tab.&lt;br /&gt;
* Use the Storage task in the implementation of Storage.&lt;br /&gt;
* When the value of a stored data is changed, notify its respective browser tab.&lt;br /&gt;
* Pass as many tests as possible.&lt;br /&gt;
* Implement the WindowLocalStorage interface which behaves slightly different from the WindowSessionStorage interface.&lt;br /&gt;
&lt;br /&gt;
== Further Readings ==&lt;br /&gt;
&lt;br /&gt;
Design and Architecture of Servo: http://github.com/servo/servo/wiki/Design/ &amp;lt;br/&amp;gt;&lt;br /&gt;
Learning Rust by Examples: http://rustbyexample.com/ &amp;lt;br/&amp;gt;&lt;br /&gt;
Javascript as Servo's Garbage Collector: http://blog.mozilla.org/research/2014/08/26/javascript-servos-only-garbage-collector/  &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_M1450_vda&amp;diff=91314</id>
		<title>CSC/ECE 517 Fall 2014/OSS M1450 vda</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/OSS_M1450_vda&amp;diff=91314"/>
		<updated>2014-10-30T04:05:00Z</updated>

		<summary type="html">&lt;p&gt;Nkdalmia: /* Project Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implement Window.sessionStorage ==&lt;br /&gt;
&lt;br /&gt;
This wiki page contains details on the work done for the initial step of the task &amp;lt;code&amp;gt; [http://github.com/servo/servo/wiki/Storage-student-project Implement Window.sessionStorage] &amp;lt;/code&amp;gt; for the [http://www.mozilla.org/ Mozilla] research project [http://github.com/servo/servo/wiki/Design Servo].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== [http://www.rust-lang.org/ Rust]===&lt;br /&gt;
&lt;br /&gt;
Rust is a modern systems programming language focusing on safety and speed to build reliable and efficient systems &amp;lt;ref&amp;gt; http://doc.rust-lang.org/nightly/intro.html &amp;lt;/ref&amp;gt;. It accomplishes the goals of memory safe without using garbage collection and it supports concurrency and parallelism in building platforms. &lt;br /&gt;
&lt;br /&gt;
Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://github.com/servo/servo/wiki/Design Servo] ===&lt;br /&gt;
&lt;br /&gt;
Mozilla Research team is currently working on an experimental project to develop a new Web browser engine &amp;quot;Servo&amp;quot;, that is capable of supporting a variety of current and next generation of hardware like mobile devices, multi-core processors and high-performance GPUs. Servo builds on top of Rust to provide a secure and reliable foundation. It is currently developed on 64 bit devices.&amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main objectives of this experimentation project is improving the layout to graphics rendering - to optimize for power efficiency and maximize parallelism. &amp;lt;ref&amp;gt; https://www.mozilla.org/en-US/research/projects/ &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Developer Environment Setup &amp;lt;ref&amp;gt;https://github.com/servo/servo/blob/master/README.md&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
=== Installing Required Packages for Servo ===&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
pip install virtualenv&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
    freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
    fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
    rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
pushd .&lt;br /&gt;
cd /tmp&lt;br /&gt;
wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
popd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Building Servo ===&lt;br /&gt;
&lt;br /&gt;
Clone the Servo repository hosted at https://github.com/servo/servo and switch to the working directory.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git clone https://github.com/servo/servo&lt;br /&gt;
cd servo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Normal Build'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Building for Android target'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
cd ports/android&lt;br /&gt;
ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;I&amp;gt;Note: Building Servo will take a considerable amount of time. &amp;lt;/I&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Launch Servo ===&lt;br /&gt;
&lt;br /&gt;
Once the build is successful, launch Servo using this command.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach run tests/html/about-mozilla.html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:servo.png]]&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
&lt;br /&gt;
The [http://html.spec.whatwg.org/multipage/webstorage.html#webstorage Web Storage] specification defines the means by which a web application can store string key/value pairs in a browser and later retrieve them for use. It supports persistent data storage, similar to cookies but with a greatly enhanced capacity and no information stored in the HTTP request header&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Web_storage&amp;lt;/ref&amp;gt;. There are two types of web storage: [http://html.spec.whatwg.org/multipage/webstorage.html#dom-localstorage local storage] and [http://html.spec.whatwg.org/multipage/webstorage.html#dom-sessionstorage session storage].&lt;br /&gt;
&lt;br /&gt;
Browsers that support web storage have the global variables 'sessionStorage' and 'localStorage' declared at the window level. The following JavaScript code can be used on browsers to trigger web storage behaviour:&lt;br /&gt;
&lt;br /&gt;
'''sessionStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on browser for duration of the session&lt;br /&gt;
sessionStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (gets deleted when browser is closed and re-opened)&lt;br /&gt;
alert(sessionStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''localStorage'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Store value on the browser beyond the duration of the session&lt;br /&gt;
localStorage.setItem('key', 'value');&lt;br /&gt;
 &lt;br /&gt;
// Retrieve value (persists even after closing and re-opening the browser)&lt;br /&gt;
alert(localStorage.getItem('key'));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As part of our [https://github.com/servo/servo/wiki/Storage-student-project project], we have to implement this specification in Servo. Implementing this important specification in Servo will allow stateful web applications to run, and will help expose any architectural problems that Servo's radical design may cause. &amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Storage-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
For the OSS project, we had to complete the initial step of the project i.e. create the Storage interface and its stub implementation.&lt;br /&gt;
&lt;br /&gt;
We made the following changes:&lt;br /&gt;
&lt;br /&gt;
* Created a new file called [http://github.com/nkdalmia/servo/tree/master/components/script/dom/webidls Storage.webidl] under the folder '''''components/script/dom/webidls.'''''&lt;br /&gt;
&lt;br /&gt;
* Added the method definitions in the above interface file.&lt;br /&gt;
&lt;br /&gt;
* Created another file called [http://github.com/nkdalmia/servo/tree/master/components/script/dom storage.rs] under the specified folder '''''components/script/dom.''''' &lt;br /&gt;
&lt;br /&gt;
* Added constructor for Storage object and stub implementations of the methods defined in the above mentioned interface file.&lt;br /&gt;
&lt;br /&gt;
* Added our module entry in the file ''''' components/script/lib.rs ''''' so that our files are compiled as part of the Servo build.&lt;br /&gt;
&lt;br /&gt;
* Built the Servo once again and verified that the Servo browser was launching correctly.&lt;br /&gt;
&lt;br /&gt;
== Future Work &amp;lt;ref&amp;gt; https://github.com/servo/servo/wiki/Storage-student-project &amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
* Create the WindowSessionStorage interface making it return a Storage instance.&lt;br /&gt;
* Create a Storage task which will be used to contain all stored data.&lt;br /&gt;
* Define a message-passing interface for reading and writing stored data for a particular browser tab.&lt;br /&gt;
* Use the Storage task in the implementation of Storage.&lt;br /&gt;
* When the value of a stored data is changed, notify its respective browser tab.&lt;br /&gt;
* Pass as many tests as possible.&lt;br /&gt;
* Implement the WindowLocalStorage interface which behaves slightly different from the WindowSessionStorage interface.&lt;br /&gt;
&lt;br /&gt;
== Further Readings ==&lt;br /&gt;
&lt;br /&gt;
Design and Architecture of Servo: http://github.com/servo/servo/wiki/Design/ &amp;lt;br/&amp;gt;&lt;br /&gt;
Learning Rust by Examples: http://rustbyexample.com/ &amp;lt;br/&amp;gt;&lt;br /&gt;
Javascript as Servo's Garbage Collector: http://blog.mozilla.org/research/2014/08/26/javascript-servos-only-garbage-collector/  &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nkdalmia</name></author>
	</entry>
</feed>