{"action":"created","comment":{"url":"https://api.github.com/repos/servo/servo/pulls/comments/90763115","pull_request_review_id":11282096,"id":90763115,"diff_hunk":"@@ -65,7 +78,61 @@ impl CookieStorage {\n         }\n \n         // Step 12\n-        self.cookies.push(cookie);\n+        let domain = reg_host(&cookie.cookie.domain.clone().unwrap_or(\"\".to_owned())).unwrap_or(\"\".to_owned());\n+        if !self.cookies_map.contains_key(&domain) {","path":"components/net/cookie_storage.rs","position":73,"original_position":73,"commit_id":"44a451da7c2ce72fbc0b9217ff56d498b83e2207","original_commit_id":"44a451da7c2ce72fbc0b9217ff56d498b83e2207","user":{"login":"jdm","id":27658,"avatar_url":"https://avatars.githubusercontent.com/u/27658?v=3","gravatar_id":"","url":"https://api.github.com/users/jdm","html_url":"https://github.com/jdm","followers_url":"https://api.github.com/users/jdm/followers","following_url":"https://api.github.com/users/jdm/following{/other_user}","gists_url":"https://api.github.com/users/jdm/gists{/gist_id}","starred_url":"https://api.github.com/users/jdm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdm/subscriptions","organizations_url":"https://api.github.com/users/jdm/orgs","repos_url":"https://api.github.com/users/jdm/repos","events_url":"https://api.github.com/users/jdm/events{/privacy}","received_events_url":"https://api.github.com/users/jdm/received_events","type":"User","site_admin":false},"body":"Same as before - we can use:\r\n```rust\r\nlet domain = reg_host(&cookie.cookie.domain.as_ref().unwrap_or(\"\"));\r\nlet cookies = self.cookies_map.entry(&domain).or_insert(vec![]);\r\n```","created_at":"2016-12-03T19:18:43Z","updated_at":"2016-12-03T19:18:43Z","html_url":"https://github.com/servo/servo/pull/14445#discussion_r90763115","pull_request_url":"https://api.github.com/repos/servo/servo/pulls/14445","_links":{"self":{"href":"https://api.github.com/repos/servo/servo/pulls/comments/90763115"},"html":{"href":"https://github.com/servo/servo/pull/14445#discussion_r90763115"},"pull_request":{"href":"https://api.github.com/repos/servo/servo/pulls/14445"}}},"pull_request":{"url":"https://api.github.com/repos/servo/servo/pulls/14445","id":96388311,"html_url":"https://github.com/servo/servo/pull/14445","diff_url":"https://github.com/servo/servo/pull/14445.diff","patch_url":"https://github.com/servo/servo/pull/14445.patch","issue_url":"https://api.github.com/repos/servo/servo/issues/14445","number":14445,"state":"open","locked":false,"title":"Redesign CookieStorage and Implement Leave Secure Cookie Alone","user":{"login":"mrnayak","id":1668438,"avatar_url":"https://avatars.githubusercontent.com/u/1668438?v=3","gravatar_id":"","url":"https://api.github.com/users/mrnayak","html_url":"https://github.com/mrnayak","followers_url":"https://api.github.com/users/mrnayak/followers","following_url":"https://api.github.com/users/mrnayak/following{/other_user}","gists_url":"https://api.github.com/users/mrnayak/gists{/gist_id}","starred_url":"https://api.github.com/users/mrnayak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrnayak/subscriptions","organizations_url":"https://api.github.com/users/mrnayak/orgs","repos_url":"https://api.github.com/users/mrnayak/repos","events_url":"https://api.github.com/users/mrnayak/events{/privacy}","received_events_url":"https://api.github.com/users/mrnayak/received_events","type":"User","site_admin":false},"body":"CookieStorage has been refactored to use HashMap with the base domain as the key. Values of hashmap are vector of cookies.\r\nCookieStorage now has max_per_host which restricts maximum cookies that can be added per base domain.\r\nCookie eviction does not take place if max_per_host is not reached.\r\nCookie eviction logic implemented here does following steps\r\n1) Evict all expired cookies\r\n2) Remove oldest accessed non-secure cookie If any\r\n3) When no non-secure cookie exists, remove oldest accessed secure cookie if new cookie being added is secure. Else ignore new cookie\r\n\r\n\r\n---\r\n<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->\r\n- [X] `./mach build -d` does not report any errors\r\n- [X] `./mach test-tidy` does not report any errors\r\n- [ ] These changes fix #__ (github issue number if applicable).\r\n\r\n<!-- Either: -->\r\n- [X] There are tests for these changes OR\r\n- [ ] These changes do not require tests because _____\r\n\r\n<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/servo/servo/14445)\n<!-- Reviewable:end -->\n","created_at":"2016-12-03T06:08:56Z","updated_at":"2016-12-03T19:44:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0cbbec9db29fd39ca85859dc67e031ffab52776b","assignee":{"login":"pcwalton","id":157897,"avatar_url":"https://avatars.githubusercontent.com/u/157897?v=3","gravatar_id":"","url":"https://api.github.com/users/pcwalton","html_url":"https://github.com/pcwalton","followers_url":"https://api.github.com/users/pcwalton/followers","following_url":"https://api.github.com/users/pcwalton/following{/other_user}","gists_url":"https://api.github.com/users/pcwalton/gists{/gist_id}","starred_url":"https://api.github.com/users/pcwalton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pcwalton/subscriptions","organizations_url":"https://api.github.com/users/pcwalton/orgs","repos_url":"https://api.github.com/users/pcwalton/repos","events_url":"https://api.github.com/users/pcwalton/events{/privacy}","received_events_url":"https://api.github.com/users/pcwalton/received_events","type":"User","site_admin":false},"assignees":[{"login":"pcwalton","id":157897,"avatar_url":"https://avatars.githubusercontent.com/u/157897?v=3","gravatar_id":"","url":"https://api.github.com/users/pcwalton","html_url":"https://github.com/pcwalton","followers_url":"https://api.github.com/users/pcwalton/followers","following_url":"https://api.github.com/users/pcwalton/following{/other_user}","gists_url":"https://api.github.com/users/pcwalton/gists{/gist_id}","starred_url":"https://api.github.com/users/pcwalton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pcwalton/subscriptions","organizations_url":"https://api.github.com/users/pcwalton/orgs","repos_url":"https://api.github.com/users/pcwalton/repos","events_url":"https://api.github.com/users/pcwalton/events{/privacy}","received_events_url":"https://api.github.com/users/pcwalton/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/servo/servo/pulls/14445/commits","review_comments_url":"https://api.github.com/repos/servo/servo/pulls/14445/comments","review_comment_url":"https://api.github.com/repos/servo/servo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/servo/servo/issues/14445/comments","statuses_url":"https://api.github.com/repos/servo/servo/statuses/44a451da7c2ce72fbc0b9217ff56d498b83e2207","head":{"label":"mrnayak:netSecurity","ref":"netSecurity","sha":"44a451da7c2ce72fbc0b9217ff56d498b83e2207","user":{"login":"mrnayak","id":1668438,"avatar_url":"https://avatars.githubusercontent.com/u/1668438?v=3","gravatar_id":"","url":"https://api.github.com/users/mrnayak","html_url":"https://github.com/mrnayak","followers_url":"https://api.github.com/users/mrnayak/followers","following_url":"https://api.github.com/users/mrnayak/following{/other_user}","gists_url":"https://api.github.com/users/mrnayak/gists{/gist_id}","starred_url":"https://api.github.com/users/mrnayak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrnayak/subscriptions","organizations_url":"https://api.github.com/users/mrnayak/orgs","repos_url":"https://api.github.com/users/mrnayak/repos","events_url":"https://api.github.com/users/mrnayak/events{/privacy}","received_events_url":"https://api.github.com/users/mrnayak/received_events","type":"User","site_admin":false},"repo":{"id":72784946,"name":"servo","full_name":"mrnayak/servo","owner":{"login":"mrnayak","id":1668438,"avatar_url":"https://avatars.githubusercontent.com/u/1668438?v=3","gravatar_id":"","url":"https://api.github.com/users/mrnayak","html_url":"https://github.com/mrnayak","followers_url":"https://api.github.com/users/mrnayak/followers","following_url":"https://api.github.com/users/mrnayak/following{/other_user}","gists_url":"https://api.github.com/users/mrnayak/gists{/gist_id}","starred_url":"https://api.github.com/users/mrnayak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrnayak/subscriptions","organizations_url":"https://api.github.com/users/mrnayak/orgs","repos_url":"https://api.github.com/users/mrnayak/repos","events_url":"https://api.github.com/users/mrnayak/events{/privacy}","received_events_url":"https://api.github.com/users/mrnayak/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mrnayak/servo","description":"The Servo Browser Engine","fork":true,"url":"https://api.github.com/repos/mrnayak/servo","forks_url":"https://api.github.com/repos/mrnayak/servo/forks","keys_url":"https://api.github.com/repos/mrnayak/servo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mrnayak/servo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mrnayak/servo/teams","hooks_url":"https://api.github.com/repos/mrnayak/servo/hooks","issue_events_url":"https://api.github.com/repos/mrnayak/servo/issues/events{/number}","events_url":"https://api.github.com/repos/mrnayak/servo/events","assignees_url":"https://api.github.com/repos/mrnayak/servo/assignees{/user}","branches_url":"https://api.github.com/repos/mrnayak/servo/branches{/branch}","tags_url":"https://api.github.com/repos/mrnayak/servo/tags","blobs_url":"https://api.github.com/repos/mrnayak/servo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mrnayak/servo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mrnayak/servo/git/refs{/sha}","trees_url":"https://api.github.com/repos/mrnayak/servo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mrnayak/servo/statuses/{sha}","languages_url":"https://api.github.com/repos/mrnayak/servo/languages","stargazers_url":"https://api.github.com/repos/mrnayak/servo/stargazers","contributors_url":"https://api.github.com/repos/mrnayak/servo/contributors","subscribers_url":"https://api.github.com/repos/mrnayak/servo/subscribers","subscription_url":"https://api.github.com/repos/mrnayak/servo/subscription","commits_url":"https://api.github.com/repos/mrnayak/servo/commits{/sha}","git_commits_url":"https://api.github.com/repos/mrnayak/servo/git/commits{/sha}","comments_url":"https://api.github.com/repos/mrnayak/servo/comments{/number}","issue_comment_url":"https://api.github.com/repos/mrnayak/servo/issues/comments{/number}","contents_url":"https://api.github.com/repos/mrnayak/servo/contents/{+path}","compare_url":"https://api.github.com/repos/mrnayak/servo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mrnayak/servo/merges","archive_url":"https://api.github.com/repos/mrnayak/servo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mrnayak/servo/downloads","issues_url":"https://api.github.com/repos/mrnayak/servo/issues{/number}","pulls_url":"https://api.github.com/repos/mrnayak/servo/pulls{/number}","milestones_url":"https://api.github.com/repos/mrnayak/servo/milestones{/number}","notifications_url":"https://api.github.com/repos/mrnayak/servo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mrnayak/servo/labels{/name}","releases_url":"https://api.github.com/repos/mrnayak/servo/releases{/id}","deployments_url":"https://api.github.com/repos/mrnayak/servo/deployments","created_at":"2016-11-03T20:41:42Z","updated_at":"2016-11-03T18:38:59Z","pushed_at":"2016-12-03T06:06:33Z","git_url":"git://github.com/mrnayak/servo.git","ssh_url":"git@github.com:mrnayak/servo.git","clone_url":"https://github.com/mrnayak/servo.git","svn_url":"https://github.com/mrnayak/servo","homepage":"https://servo.org/","size":221575,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"servo:master","ref":"master","sha":"7c346e0d943fd518031437bcc7d10fee16213ff3","user":{"login":"servo","id":2566135,"avatar_url":"https://avatars.githubusercontent.com/u/2566135?v=3","gravatar_id":"","url":"https://api.github.com/users/servo","html_url":"https://github.com/servo","followers_url":"https://api.github.com/users/servo/followers","following_url":"https://api.github.com/users/servo/following{/other_user}","gists_url":"https://api.github.com/users/servo/gists{/gist_id}","starred_url":"https://api.github.com/users/servo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/servo/subscriptions","organizations_url":"https://api.github.com/users/servo/orgs","repos_url":"https://api.github.com/users/servo/repos","events_url":"https://api.github.com/users/servo/events{/privacy}","received_events_url":"https://api.github.com/users/servo/received_events","type":"Organization","site_admin":false},"repo":{"id":3390243,"name":"servo","full_name":"servo/servo","owner":{"login":"servo","id":2566135,"avatar_url":"https://avatars.githubusercontent.com/u/2566135?v=3","gravatar_id":"","url":"https://api.github.com/users/servo","html_url":"https://github.com/servo","followers_url":"https://api.github.com/users/servo/followers","following_url":"https://api.github.com/users/servo/following{/other_user}","gists_url":"https://api.github.com/users/servo/gists{/gist_id}","starred_url":"https://api.github.com/users/servo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/servo/subscriptions","organizations_url":"https://api.github.com/users/servo/orgs","repos_url":"https://api.github.com/users/servo/repos","events_url":"https://api.github.com/users/servo/events{/privacy}","received_events_url":"https://api.github.com/users/servo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/servo/servo","description":"The Servo Browser Engine","fork":false,"url":"https://api.github.com/repos/servo/servo","forks_url":"https://api.github.com/repos/servo/servo/forks","keys_url":"https://api.github.com/repos/servo/servo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/servo/servo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/servo/servo/teams","hooks_url":"https://api.github.com/repos/servo/servo/hooks","issue_events_url":"https://api.github.com/repos/servo/servo/issues/events{/number}","events_url":"https://api.github.com/repos/servo/servo/events","assignees_url":"https://api.github.com/repos/servo/servo/assignees{/user}","branches_url":"https://api.github.com/repos/servo/servo/branches{/branch}","tags_url":"https://api.github.com/repos/servo/servo/tags","blobs_url":"https://api.github.com/repos/servo/servo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/servo/servo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/servo/servo/git/refs{/sha}","trees_url":"https://api.github.com/repos/servo/servo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/servo/servo/statuses/{sha}","languages_url":"https://api.github.com/repos/servo/servo/languages","stargazers_url":"https://api.github.com/repos/servo/servo/stargazers","contributors_url":"https://api.github.com/repos/servo/servo/contributors","subscribers_url":"https://api.github.com/repos/servo/servo/subscribers","subscription_url":"https://api.github.com/repos/servo/servo/subscription","commits_url":"https://api.github.com/repos/servo/servo/commits{/sha}","git_commits_url":"https://api.github.com/repos/servo/servo/git/commits{/sha}","comments_url":"https://api.github.com/repos/servo/servo/comments{/number}","issue_comment_url":"https://api.github.com/repos/servo/servo/issues/comments{/number}","contents_url":"https://api.github.com/repos/servo/servo/contents/{+path}","compare_url":"https://api.github.com/repos/servo/servo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/servo/servo/merges","archive_url":"https://api.github.com/repos/servo/servo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/servo/servo/downloads","issues_url":"https://api.github.com/repos/servo/servo/issues{/number}","pulls_url":"https://api.github.com/repos/servo/servo/pulls{/number}","milestones_url":"https://api.github.com/repos/servo/servo/milestones{/number}","notifications_url":"https://api.github.com/repos/servo/servo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/servo/servo/labels{/name}","releases_url":"https://api.github.com/repos/servo/servo/releases{/id}","deployments_url":"https://api.github.com/repos/servo/servo/deployments","created_at":"2012-02-08T19:07:25Z","updated_at":"2016-12-03T07:48:29Z","pushed_at":"2016-12-03T18:53:55Z","git_url":"git://github.com/servo/servo.git","ssh_url":"git@github.com:servo/servo.git","clone_url":"https://github.com/servo/servo.git","svn_url":"https://github.com/servo/servo","homepage":"https://servo.org/","size":316617,"stargazers_count":8360,"watchers_count":8360,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1379,"mirror_url":null,"open_issues_count":1924,"forks":1379,"open_issues":1924,"watchers":8360,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/servo/servo/pulls/14445"},"html":{"href":"https://github.com/servo/servo/pull/14445"},"issue":{"href":"https://api.github.com/repos/servo/servo/issues/14445"},"comments":{"href":"https://api.github.com/repos/servo/servo/issues/14445/comments"},"review_comments":{"href":"https://api.github.com/repos/servo/servo/pulls/14445/comments"},"review_comment":{"href":"https://api.github.com/repos/servo/servo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/servo/servo/pulls/14445/commits"},"statuses":{"href":"https://api.github.com/repos/servo/servo/statuses/44a451da7c2ce72fbc0b9217ff56d498b83e2207"}}}}
{"actor":{"display_login":"jdm"}}