{"action":"created","comment":{"url":"https://api.github.com/repos/humphd/brackets/pulls/comments/27060435","id":27060435,"diff_hunk":"@@ -0,0 +1,93 @@\n+/*jslint vars: true, plusplus: true, devel: true, nomen: true, regexp: true, indent: 4, maxerr: 50 */\n+/*global define, URL */\n+\n+define(function (require, exports, module) {\n+    \"use strict\";\n+\n+    var Handlers = require(\"filesystem/impls/lib/handlers\");\n+    var Log = require(\"filesystem/impls/lib/log\");\n+\n+    // BlobUtils provides an opportunistic cache for BLOB Object URLs\n+    // which can be looked-up synchronously.\n+\n+    var Filer = require(\"thirdparty/filer/dist/filer\");\n+    var Path  = Filer.Path;\n+\n+    // 2-way cache for blob URL to path for looking up either way:\n+    // * paths - paths keyed on blobUrls\n+    // * blobs - blobUrls keyed on paths\n+    var paths  = {};\n+    var blobs = {};\n+\n+    // Generate a BLOB URL for the given filename and cache it\n+    function cache(filename, callback) {\n+        filename = Path.normalize(filename);\n+\n+        Handlers.handleFile(filename, function(err, url) {\n+            // If there's an existing entry for this, remove it.","path":"src/filesystem/impls/filer/BlobUtils.js","position":27,"original_position":27,"commit_id":"84a7b5d70567fd712db955279cec0b9949ff56a8","original_commit_id":"84a7b5d70567fd712db955279cec0b9949ff56a8","user":{"login":"gideonthomas","id":5816130,"avatar_url":"https://avatars.githubusercontent.com/u/5816130?v=3","gravatar_id":"","url":"https://api.github.com/users/gideonthomas","html_url":"https://github.com/gideonthomas","followers_url":"https://api.github.com/users/gideonthomas/followers","following_url":"https://api.github.com/users/gideonthomas/following{/other_user}","gists_url":"https://api.github.com/users/gideonthomas/gists{/gist_id}","starred_url":"https://api.github.com/users/gideonthomas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gideonthomas/subscriptions","organizations_url":"https://api.github.com/users/gideonthomas/orgs","repos_url":"https://api.github.com/users/gideonthomas/repos","events_url":"https://api.github.com/users/gideonthomas/events{/privacy}","received_events_url":"https://api.github.com/users/gideonthomas/received_events","type":"User","site_admin":false},"body":"url would be the 404. I think we should still update the cache to store the 404 blob url","created_at":"2015-03-24T18:48:31Z","updated_at":"2015-03-24T18:48:31Z","html_url":"https://github.com/humphd/brackets/pull/137#discussion_r27060435","pull_request_url":"https://api.github.com/repos/humphd/brackets/pulls/137","_links":{"self":{"href":"https://api.github.com/repos/humphd/brackets/pulls/comments/27060435"},"html":{"href":"https://github.com/humphd/brackets/pull/137#discussion_r27060435"},"pull_request":{"href":"https://api.github.com/repos/humphd/brackets/pulls/137"}}},"pull_request":{"url":"https://api.github.com/repos/humphd/brackets/pulls/137","id":31854164,"html_url":"https://github.com/humphd/brackets/pull/137","diff_url":"https://github.com/humphd/brackets/pull/137.diff","patch_url":"https://github.com/humphd/brackets/pull/137.patch","issue_url":"https://api.github.com/repos/humphd/brackets/issues/137","number":137,"state":"open","locked":false,"title":"Fix #121 - Manage blob URLs on file ops","user":{"login":"gideonthomas","id":5816130,"avatar_url":"https://avatars.githubusercontent.com/u/5816130?v=3","gravatar_id":"","url":"https://api.github.com/users/gideonthomas","html_url":"https://github.com/gideonthomas","followers_url":"https://api.github.com/users/gideonthomas/followers","following_url":"https://api.github.com/users/gideonthomas/following{/other_user}","gists_url":"https://api.github.com/users/gideonthomas/gists{/gist_id}","starred_url":"https://api.github.com/users/gideonthomas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gideonthomas/subscriptions","organizations_url":"https://api.github.com/users/gideonthomas/orgs","repos_url":"https://api.github.com/users/gideonthomas/repos","events_url":"https://api.github.com/users/gideonthomas/events{/privacy}","received_events_url":"https://api.github.com/users/gideonthomas/received_events","type":"User","site_admin":false},"body":"Manages cache for blob urls whenever a file operation is done so that it can be used to set the iframe's src in live preview.","created_at":"2015-03-24T18:08:29Z","updated_at":"2015-03-24T18:48:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"da17ed51ec1b8e20dc1f84a0c7b123b28f43f546","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/humphd/brackets/pulls/137/commits","review_comments_url":"https://api.github.com/repos/humphd/brackets/pulls/137/comments","review_comment_url":"https://api.github.com/repos/humphd/brackets/pulls/comments{/number}","comments_url":"https://api.github.com/repos/humphd/brackets/issues/137/comments","statuses_url":"https://api.github.com/repos/humphd/brackets/statuses/84a7b5d70567fd712db955279cec0b9949ff56a8","head":{"label":"gideonthomas:issue121","ref":"issue121","sha":"84a7b5d70567fd712db955279cec0b9949ff56a8","user":{"login":"gideonthomas","id":5816130,"avatar_url":"https://avatars.githubusercontent.com/u/5816130?v=3","gravatar_id":"","url":"https://api.github.com/users/gideonthomas","html_url":"https://github.com/gideonthomas","followers_url":"https://api.github.com/users/gideonthomas/followers","following_url":"https://api.github.com/users/gideonthomas/following{/other_user}","gists_url":"https://api.github.com/users/gideonthomas/gists{/gist_id}","starred_url":"https://api.github.com/users/gideonthomas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gideonthomas/subscriptions","organizations_url":"https://api.github.com/users/gideonthomas/orgs","repos_url":"https://api.github.com/users/gideonthomas/repos","events_url":"https://api.github.com/users/gideonthomas/events{/privacy}","received_events_url":"https://api.github.com/users/gideonthomas/received_events","type":"User","site_admin":false},"repo":{"id":22888327,"name":"nimble","full_name":"gideonthomas/nimble","owner":{"login":"gideonthomas","id":5816130,"avatar_url":"https://avatars.githubusercontent.com/u/5816130?v=3","gravatar_id":"","url":"https://api.github.com/users/gideonthomas","html_url":"https://github.com/gideonthomas","followers_url":"https://api.github.com/users/gideonthomas/followers","following_url":"https://api.github.com/users/gideonthomas/following{/other_user}","gists_url":"https://api.github.com/users/gideonthomas/gists{/gist_id}","starred_url":"https://api.github.com/users/gideonthomas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gideonthomas/subscriptions","organizations_url":"https://api.github.com/users/gideonthomas/orgs","repos_url":"https://api.github.com/users/gideonthomas/repos","events_url":"https://api.github.com/users/gideonthomas/events{/privacy}","received_events_url":"https://api.github.com/users/gideonthomas/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gideonthomas/nimble","description":"An open source code editor for the web, written in JavaScript, HTML and CSS.","fork":true,"url":"https://api.github.com/repos/gideonthomas/nimble","forks_url":"https://api.github.com/repos/gideonthomas/nimble/forks","keys_url":"https://api.github.com/repos/gideonthomas/nimble/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gideonthomas/nimble/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gideonthomas/nimble/teams","hooks_url":"https://api.github.com/repos/gideonthomas/nimble/hooks","issue_events_url":"https://api.github.com/repos/gideonthomas/nimble/issues/events{/number}","events_url":"https://api.github.com/repos/gideonthomas/nimble/events","assignees_url":"https://api.github.com/repos/gideonthomas/nimble/assignees{/user}","branches_url":"https://api.github.com/repos/gideonthomas/nimble/branches{/branch}","tags_url":"https://api.github.com/repos/gideonthomas/nimble/tags","blobs_url":"https://api.github.com/repos/gideonthomas/nimble/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gideonthomas/nimble/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gideonthomas/nimble/git/refs{/sha}","trees_url":"https://api.github.com/repos/gideonthomas/nimble/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gideonthomas/nimble/statuses/{sha}","languages_url":"https://api.github.com/repos/gideonthomas/nimble/languages","stargazers_url":"https://api.github.com/repos/gideonthomas/nimble/stargazers","contributors_url":"https://api.github.com/repos/gideonthomas/nimble/contributors","subscribers_url":"https://api.github.com/repos/gideonthomas/nimble/subscribers","subscription_url":"https://api.github.com/repos/gideonthomas/nimble/subscription","commits_url":"https://api.github.com/repos/gideonthomas/nimble/commits{/sha}","git_commits_url":"https://api.github.com/repos/gideonthomas/nimble/git/commits{/sha}","comments_url":"https://api.github.com/repos/gideonthomas/nimble/comments{/number}","issue_comment_url":"https://api.github.com/repos/gideonthomas/nimble/issues/comments{/number}","contents_url":"https://api.github.com/repos/gideonthomas/nimble/contents/{+path}","compare_url":"https://api.github.com/repos/gideonthomas/nimble/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gideonthomas/nimble/merges","archive_url":"https://api.github.com/repos/gideonthomas/nimble/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gideonthomas/nimble/downloads","issues_url":"https://api.github.com/repos/gideonthomas/nimble/issues{/number}","pulls_url":"https://api.github.com/repos/gideonthomas/nimble/pulls{/number}","milestones_url":"https://api.github.com/repos/gideonthomas/nimble/milestones{/number}","notifications_url":"https://api.github.com/repos/gideonthomas/nimble/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gideonthomas/nimble/labels{/name}","releases_url":"https://api.github.com/repos/gideonthomas/nimble/releases{/id}","created_at":"2014-08-12T18:44:33Z","updated_at":"2014-07-29T15:08:58Z","pushed_at":"2015-03-24T18:40:55Z","git_url":"git://github.com/gideonthomas/nimble.git","ssh_url":"git@github.com:gideonthomas/nimble.git","clone_url":"https://github.com/gideonthomas/nimble.git","svn_url":"https://github.com/gideonthomas/nimble","homepage":"http://brackets.io","size":72073,"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":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"browser-appshell"}},"base":{"label":"humphd:bramble","ref":"bramble","sha":"a5bb02ed5e5eed37a72e49199037b62b7579df36","user":{"login":"humphd","id":427398,"avatar_url":"https://avatars.githubusercontent.com/u/427398?v=3","gravatar_id":"","url":"https://api.github.com/users/humphd","html_url":"https://github.com/humphd","followers_url":"https://api.github.com/users/humphd/followers","following_url":"https://api.github.com/users/humphd/following{/other_user}","gists_url":"https://api.github.com/users/humphd/gists{/gist_id}","starred_url":"https://api.github.com/users/humphd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/humphd/subscriptions","organizations_url":"https://api.github.com/users/humphd/orgs","repos_url":"https://api.github.com/users/humphd/repos","events_url":"https://api.github.com/users/humphd/events{/privacy}","received_events_url":"https://api.github.com/users/humphd/received_events","type":"User","site_admin":false},"repo":{"id":13729434,"name":"brackets","full_name":"humphd/brackets","owner":{"login":"humphd","id":427398,"avatar_url":"https://avatars.githubusercontent.com/u/427398?v=3","gravatar_id":"","url":"https://api.github.com/users/humphd","html_url":"https://github.com/humphd","followers_url":"https://api.github.com/users/humphd/followers","following_url":"https://api.github.com/users/humphd/following{/other_user}","gists_url":"https://api.github.com/users/humphd/gists{/gist_id}","starred_url":"https://api.github.com/users/humphd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/humphd/subscriptions","organizations_url":"https://api.github.com/users/humphd/orgs","repos_url":"https://api.github.com/users/humphd/repos","events_url":"https://api.github.com/users/humphd/events{/privacy}","received_events_url":"https://api.github.com/users/humphd/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/humphd/brackets","description":"An open source code editor for the web, written in JavaScript, HTML and CSS.","fork":true,"url":"https://api.github.com/repos/humphd/brackets","forks_url":"https://api.github.com/repos/humphd/brackets/forks","keys_url":"https://api.github.com/repos/humphd/brackets/keys{/key_id}","collaborators_url":"https://api.github.com/repos/humphd/brackets/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/humphd/brackets/teams","hooks_url":"https://api.github.com/repos/humphd/brackets/hooks","issue_events_url":"https://api.github.com/repos/humphd/brackets/issues/events{/number}","events_url":"https://api.github.com/repos/humphd/brackets/events","assignees_url":"https://api.github.com/repos/humphd/brackets/assignees{/user}","branches_url":"https://api.github.com/repos/humphd/brackets/branches{/branch}","tags_url":"https://api.github.com/repos/humphd/brackets/tags","blobs_url":"https://api.github.com/repos/humphd/brackets/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/humphd/brackets/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/humphd/brackets/git/refs{/sha}","trees_url":"https://api.github.com/repos/humphd/brackets/git/trees{/sha}","statuses_url":"https://api.github.com/repos/humphd/brackets/statuses/{sha}","languages_url":"https://api.github.com/repos/humphd/brackets/languages","stargazers_url":"https://api.github.com/repos/humphd/brackets/stargazers","contributors_url":"https://api.github.com/repos/humphd/brackets/contributors","subscribers_url":"https://api.github.com/repos/humphd/brackets/subscribers","subscription_url":"https://api.github.com/repos/humphd/brackets/subscription","commits_url":"https://api.github.com/repos/humphd/brackets/commits{/sha}","git_commits_url":"https://api.github.com/repos/humphd/brackets/git/commits{/sha}","comments_url":"https://api.github.com/repos/humphd/brackets/comments{/number}","issue_comment_url":"https://api.github.com/repos/humphd/brackets/issues/comments{/number}","contents_url":"https://api.github.com/repos/humphd/brackets/contents/{+path}","compare_url":"https://api.github.com/repos/humphd/brackets/compare/{base}...{head}","merges_url":"https://api.github.com/repos/humphd/brackets/merges","archive_url":"https://api.github.com/repos/humphd/brackets/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/humphd/brackets/downloads","issues_url":"https://api.github.com/repos/humphd/brackets/issues{/number}","pulls_url":"https://api.github.com/repos/humphd/brackets/pulls{/number}","milestones_url":"https://api.github.com/repos/humphd/brackets/milestones{/number}","notifications_url":"https://api.github.com/repos/humphd/brackets/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/humphd/brackets/labels{/name}","releases_url":"https://api.github.com/repos/humphd/brackets/releases{/id}","created_at":"2013-10-21T00:12:49Z","updated_at":"2015-03-24T17:57:58Z","pushed_at":"2015-03-24T18:41:10Z","git_url":"git://github.com/humphd/brackets.git","ssh_url":"git@github.com:humphd/brackets.git","clone_url":"https://github.com/humphd/brackets.git","svn_url":"https://github.com/humphd/brackets","homepage":"http://brackets.io","size":81047,"stargazers_count":6,"watchers_count":6,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":10,"mirror_url":null,"open_issues_count":23,"forks":10,"open_issues":23,"watchers":6,"default_branch":"bramble"}},"_links":{"self":{"href":"https://api.github.com/repos/humphd/brackets/pulls/137"},"html":{"href":"https://github.com/humphd/brackets/pull/137"},"issue":{"href":"https://api.github.com/repos/humphd/brackets/issues/137"},"comments":{"href":"https://api.github.com/repos/humphd/brackets/issues/137/comments"},"review_comments":{"href":"https://api.github.com/repos/humphd/brackets/pulls/137/comments"},"review_comment":{"href":"https://api.github.com/repos/humphd/brackets/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/humphd/brackets/pulls/137/commits"},"statuses":{"href":"https://api.github.com/repos/humphd/brackets/statuses/84a7b5d70567fd712db955279cec0b9949ff56a8"}}}}