Skip to content

Storage student project

jdm edited this page Sep 26, 2014 · 5 revisions

Implement Window.sessionStorage and Window.localStorage

Background information: 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.

Initial step: build Servo, add a new WebIDL interface (Storage) along with a Rust implementation of the interface, and make it build successfully again

  • Create and stub the Storage WebIDL interface defined in the spec
  • Create and stub the WindowSessionStorage WebIDL interface defined in the spec, making it return a Storage instance
  • Create a storage task (similar to the resource task) which will contain all stored data
  • Define a message-passing interface for reading and writing stored data for a particular origin
  • 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
  • Cause a message to be broadcast (via the Constellation) when changing a stored value (c.f. sending a storage notification)
  • When the message is received by a window, dispatch a StorageEvent at the window
  • Pass as many tests as possible
  • Implement the WindowLocalStorage interface defined in the spec, behaving the same but separate from WindowSessionStorage
Clone this wiki locally