{"action":"created","comment":{"url":"https://api.github.com/repos/electron/electron/pulls/comments/63131634","id":63131634,"diff_hunk":"@@ -384,4 +385,33 @@ v8::Local<v8::Value> MediaFlagsToV8(v8::Isolate* isolate, int mediaFlags) {\n   return mate::ConvertToV8(isolate, dict);\n }\n \n+v8::Local<v8::Value> Converter<blink::WebCache::ResourceTypeStat>::ToV8(\n+    v8::Isolate* isolate, \n+    const blink::WebCache::ResourceTypeStat& stat) {\n+  mate::Dictionary dict = mate::Dictionary::CreateEmpty(isolate);\n+  \n+  dict.Set(\"count\", (uint32_t)stat.count);\n+  dict.Set(\"size\", (uint32_t)(stat.size >> 10));","path":"atom/common/native_mate_converters/blink_converter.cc","position":18,"original_position":18,"commit_id":"f6105e30ec4a9a8fe470dd9da55c8fdf63260a46","original_commit_id":"f6105e30ec4a9a8fe470dd9da55c8fdf63260a46","user":{"login":"zcbenz","id":639601,"avatar_url":"https://avatars.githubusercontent.com/u/639601?v=3","gravatar_id":"","url":"https://api.github.com/users/zcbenz","html_url":"https://github.com/zcbenz","followers_url":"https://api.github.com/users/zcbenz/followers","following_url":"https://api.github.com/users/zcbenz/following{/other_user}","gists_url":"https://api.github.com/users/zcbenz/gists{/gist_id}","starred_url":"https://api.github.com/users/zcbenz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zcbenz/subscriptions","organizations_url":"https://api.github.com/users/zcbenz/orgs","repos_url":"https://api.github.com/users/zcbenz/repos","events_url":"https://api.github.com/users/zcbenz/events{/privacy}","received_events_url":"https://api.github.com/users/zcbenz/received_events","type":"User","site_admin":true},"body":"We can probably convert it to double, so the worst case is we lose some precision.","created_at":"2016-05-13T04:18:26Z","updated_at":"2016-05-13T04:18:26Z","html_url":"https://github.com/electron/electron/pull/5413#discussion_r63131634","pull_request_url":"https://api.github.com/repos/electron/electron/pulls/5413","_links":{"self":{"href":"https://api.github.com/repos/electron/electron/pulls/comments/63131634"},"html":{"href":"https://github.com/electron/electron/pull/5413#discussion_r63131634"},"pull_request":{"href":"https://api.github.com/repos/electron/electron/pulls/5413"}}},"pull_request":{"url":"https://api.github.com/repos/electron/electron/pulls/5413","id":69109412,"html_url":"https://github.com/electron/electron/pull/5413","diff_url":"https://github.com/electron/electron/pull/5413.diff","patch_url":"https://github.com/electron/electron/pull/5413.patch","issue_url":"https://api.github.com/repos/electron/electron/issues/5413","number":5413,"state":"open","locked":false,"title":"Fetch Process resource usage from WebContents","user":{"login":"paulcbetts","id":1396,"avatar_url":"https://avatars.githubusercontent.com/u/1396?v=3","gravatar_id":"","url":"https://api.github.com/users/paulcbetts","html_url":"https://github.com/paulcbetts","followers_url":"https://api.github.com/users/paulcbetts/followers","following_url":"https://api.github.com/users/paulcbetts/following{/other_user}","gists_url":"https://api.github.com/users/paulcbetts/gists{/gist_id}","starred_url":"https://api.github.com/users/paulcbetts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulcbetts/subscriptions","organizations_url":"https://api.github.com/users/paulcbetts/orgs","repos_url":"https://api.github.com/users/paulcbetts/repos","events_url":"https://api.github.com/users/paulcbetts/events{/privacy}","received_events_url":"https://api.github.com/users/paulcbetts/received_events","type":"User","site_admin":false},"body":"This PR adds a new method to `WebFrame`, `getResourceUsage` - it returns more detailed memory usage information than `performance.memory` for a given renderer process:\r\n\r\n```js\r\nimport {webFrame} from 'electron';\r\nlet usage = webFrame.getResourceUsage();\r\n```\r\n\r\nThis PR also adds a `purgeCaches` method that attempts to free memory that is no longer being used (i.e. images from a previous navigation, etc etc):\r\n\r\n```js\r\nimport {webFrame} from 'electron';\r\nlet usage1 = webFrame.getResourceUsage();\r\n\r\nwebFrame.purgeCaches();\r\n\r\nlet usage2 = webFrame.getResourceUsage();\r\n\r\nconsole.log(`Before: ${JSON.stringify(usage1)}`);\r\nconsole.log(`After: ${JSON.stringify(usage2)}`);\r\n```\r\n\r\nNote that blindly calling this method probably makes Electron slower since it will have to refill these emptied caches, you should only call it if an event in your app has occured that makes you think your page is actually using less memory (i.e. you have navigated from a super heavy page to a mostly empty one, and intend to stay there)","created_at":"2016-05-06T06:15:37Z","updated_at":"2016-05-13T04:18:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"067b26b2d0a3aedd9465df45009e802c39d344f9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/electron/electron/pulls/5413/commits","review_comments_url":"https://api.github.com/repos/electron/electron/pulls/5413/comments","review_comment_url":"https://api.github.com/repos/electron/electron/pulls/comments{/number}","comments_url":"https://api.github.com/repos/electron/electron/issues/5413/comments","statuses_url":"https://api.github.com/repos/electron/electron/statuses/f6105e30ec4a9a8fe470dd9da55c8fdf63260a46","head":{"label":"electron:process-resource-usage","ref":"process-resource-usage","sha":"f6105e30ec4a9a8fe470dd9da55c8fdf63260a46","user":{"login":"electron","id":13409222,"avatar_url":"https://avatars.githubusercontent.com/u/13409222?v=3","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"repo":{"id":9384267,"name":"electron","full_name":"electron/electron","owner":{"login":"electron","id":13409222,"avatar_url":"https://avatars.githubusercontent.com/u/13409222?v=3","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/electron/electron","description":"Build cross platform desktop apps with web technologies","fork":false,"url":"https://api.github.com/repos/electron/electron","forks_url":"https://api.github.com/repos/electron/electron/forks","keys_url":"https://api.github.com/repos/electron/electron/keys{/key_id}","collaborators_url":"https://api.github.com/repos/electron/electron/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/electron/electron/teams","hooks_url":"https://api.github.com/repos/electron/electron/hooks","issue_events_url":"https://api.github.com/repos/electron/electron/issues/events{/number}","events_url":"https://api.github.com/repos/electron/electron/events","assignees_url":"https://api.github.com/repos/electron/electron/assignees{/user}","branches_url":"https://api.github.com/repos/electron/electron/branches{/branch}","tags_url":"https://api.github.com/repos/electron/electron/tags","blobs_url":"https://api.github.com/repos/electron/electron/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/electron/electron/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/electron/electron/git/refs{/sha}","trees_url":"https://api.github.com/repos/electron/electron/git/trees{/sha}","statuses_url":"https://api.github.com/repos/electron/electron/statuses/{sha}","languages_url":"https://api.github.com/repos/electron/electron/languages","stargazers_url":"https://api.github.com/repos/electron/electron/stargazers","contributors_url":"https://api.github.com/repos/electron/electron/contributors","subscribers_url":"https://api.github.com/repos/electron/electron/subscribers","subscription_url":"https://api.github.com/repos/electron/electron/subscription","commits_url":"https://api.github.com/repos/electron/electron/commits{/sha}","git_commits_url":"https://api.github.com/repos/electron/electron/git/commits{/sha}","comments_url":"https://api.github.com/repos/electron/electron/comments{/number}","issue_comment_url":"https://api.github.com/repos/electron/electron/issues/comments{/number}","contents_url":"https://api.github.com/repos/electron/electron/contents/{+path}","compare_url":"https://api.github.com/repos/electron/electron/compare/{base}...{head}","merges_url":"https://api.github.com/repos/electron/electron/merges","archive_url":"https://api.github.com/repos/electron/electron/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/electron/electron/downloads","issues_url":"https://api.github.com/repos/electron/electron/issues{/number}","pulls_url":"https://api.github.com/repos/electron/electron/pulls{/number}","milestones_url":"https://api.github.com/repos/electron/electron/milestones{/number}","notifications_url":"https://api.github.com/repos/electron/electron/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/electron/electron/labels{/name}","releases_url":"https://api.github.com/repos/electron/electron/releases{/id}","deployments_url":"https://api.github.com/repos/electron/electron/deployments","created_at":"2013-04-12T01:47:36Z","updated_at":"2016-05-13T04:10:30Z","pushed_at":"2016-05-13T02:18:51Z","git_url":"git://github.com/electron/electron.git","ssh_url":"git@github.com:electron/electron.git","clone_url":"https://github.com/electron/electron.git","svn_url":"https://github.com/electron/electron","homepage":"http://electron.atom.io","size":22377,"stargazers_count":28643,"watchers_count":28643,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2959,"mirror_url":null,"open_issues_count":260,"forks":2959,"open_issues":260,"watchers":28643,"default_branch":"master"}},"base":{"label":"electron:master","ref":"master","sha":"b32bc8cf3eebc10fae805f4eabdcb341f6436870","user":{"login":"electron","id":13409222,"avatar_url":"https://avatars.githubusercontent.com/u/13409222?v=3","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"repo":{"id":9384267,"name":"electron","full_name":"electron/electron","owner":{"login":"electron","id":13409222,"avatar_url":"https://avatars.githubusercontent.com/u/13409222?v=3","gravatar_id":"","url":"https://api.github.com/users/electron","html_url":"https://github.com/electron","followers_url":"https://api.github.com/users/electron/followers","following_url":"https://api.github.com/users/electron/following{/other_user}","gists_url":"https://api.github.com/users/electron/gists{/gist_id}","starred_url":"https://api.github.com/users/electron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electron/subscriptions","organizations_url":"https://api.github.com/users/electron/orgs","repos_url":"https://api.github.com/users/electron/repos","events_url":"https://api.github.com/users/electron/events{/privacy}","received_events_url":"https://api.github.com/users/electron/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/electron/electron","description":"Build cross platform desktop apps with web technologies","fork":false,"url":"https://api.github.com/repos/electron/electron","forks_url":"https://api.github.com/repos/electron/electron/forks","keys_url":"https://api.github.com/repos/electron/electron/keys{/key_id}","collaborators_url":"https://api.github.com/repos/electron/electron/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/electron/electron/teams","hooks_url":"https://api.github.com/repos/electron/electron/hooks","issue_events_url":"https://api.github.com/repos/electron/electron/issues/events{/number}","events_url":"https://api.github.com/repos/electron/electron/events","assignees_url":"https://api.github.com/repos/electron/electron/assignees{/user}","branches_url":"https://api.github.com/repos/electron/electron/branches{/branch}","tags_url":"https://api.github.com/repos/electron/electron/tags","blobs_url":"https://api.github.com/repos/electron/electron/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/electron/electron/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/electron/electron/git/refs{/sha}","trees_url":"https://api.github.com/repos/electron/electron/git/trees{/sha}","statuses_url":"https://api.github.com/repos/electron/electron/statuses/{sha}","languages_url":"https://api.github.com/repos/electron/electron/languages","stargazers_url":"https://api.github.com/repos/electron/electron/stargazers","contributors_url":"https://api.github.com/repos/electron/electron/contributors","subscribers_url":"https://api.github.com/repos/electron/electron/subscribers","subscription_url":"https://api.github.com/repos/electron/electron/subscription","commits_url":"https://api.github.com/repos/electron/electron/commits{/sha}","git_commits_url":"https://api.github.com/repos/electron/electron/git/commits{/sha}","comments_url":"https://api.github.com/repos/electron/electron/comments{/number}","issue_comment_url":"https://api.github.com/repos/electron/electron/issues/comments{/number}","contents_url":"https://api.github.com/repos/electron/electron/contents/{+path}","compare_url":"https://api.github.com/repos/electron/electron/compare/{base}...{head}","merges_url":"https://api.github.com/repos/electron/electron/merges","archive_url":"https://api.github.com/repos/electron/electron/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/electron/electron/downloads","issues_url":"https://api.github.com/repos/electron/electron/issues{/number}","pulls_url":"https://api.github.com/repos/electron/electron/pulls{/number}","milestones_url":"https://api.github.com/repos/electron/electron/milestones{/number}","notifications_url":"https://api.github.com/repos/electron/electron/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/electron/electron/labels{/name}","releases_url":"https://api.github.com/repos/electron/electron/releases{/id}","deployments_url":"https://api.github.com/repos/electron/electron/deployments","created_at":"2013-04-12T01:47:36Z","updated_at":"2016-05-13T04:10:30Z","pushed_at":"2016-05-13T02:18:51Z","git_url":"git://github.com/electron/electron.git","ssh_url":"git@github.com:electron/electron.git","clone_url":"https://github.com/electron/electron.git","svn_url":"https://github.com/electron/electron","homepage":"http://electron.atom.io","size":22377,"stargazers_count":28643,"watchers_count":28643,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2959,"mirror_url":null,"open_issues_count":260,"forks":2959,"open_issues":260,"watchers":28643,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/electron/electron/pulls/5413"},"html":{"href":"https://github.com/electron/electron/pull/5413"},"issue":{"href":"https://api.github.com/repos/electron/electron/issues/5413"},"comments":{"href":"https://api.github.com/repos/electron/electron/issues/5413/comments"},"review_comments":{"href":"https://api.github.com/repos/electron/electron/pulls/5413/comments"},"review_comment":{"href":"https://api.github.com/repos/electron/electron/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/electron/electron/pulls/5413/commits"},"statuses":{"href":"https://api.github.com/repos/electron/electron/statuses/f6105e30ec4a9a8fe470dd9da55c8fdf63260a46"}}}}