read cookie_jar, hsts_list, auth_cache, and local_data from file if profile_dir option is present

This commit is contained in:
Daniel 2016-04-21 14:00:44 -04:00
parent ec9e1fe7e6
commit d9c32b273a
8 changed files with 60 additions and 81 deletions

View file

@ -37,10 +37,14 @@ struct StorageManager {
impl StorageManager {
fn new(port: IpcReceiver<StorageThreadMsg>) -> StorageManager {
let mut local_data = HashMap::new();
if let Some(ref profile_dir) = opts::get().profile_dir {
resource_thread::read_json_from_file(&mut local_data, profile_dir, "local_data.json");
}
StorageManager {
port: port,
session_data: HashMap::new(),
local_data: HashMap::new(),
local_data: local_data,
}
}
}