{"action":"created","comment":{"url":"https://api.github.com/repos/domokit/sky_engine/pulls/comments/38267849","id":38267849,"diff_hunk":"@@ -42,37 +42,59 @@ class GestureArenaEntry {\n   }\n }\n \n+class _GestureArenaState {\n+  final List<GestureArenaMember> members = new List<GestureArenaMember>();\n+  bool isOpen = true;\n+\n+  void add(GestureArenaMember member) {\n+    assert(isOpen);\n+    members.add(member);\n+  }\n+}\n+\n /// The first member to accept or the last member to not to reject wins.\n class GestureArena {\n-  final Map<Object, List<GestureArenaMember>> _arenas = new Map<Object, List<GestureArenaMember>>();\n+  final Map<Object, _GestureArenaState> _arenas = new Map<Object, _GestureArenaState>();\n \n   static final GestureArena instance = new GestureArena();\n \n   GestureArenaEntry add(Object key, GestureArenaMember member) {\n-    List<GestureArenaMember> members = _arenas.putIfAbsent(key, () => new List<GestureArenaMember>());\n-    members.add(member);\n+    _GestureArenaState state = _arenas.putIfAbsent(key, () => new _GestureArenaState());\n+    state.add(member);\n     return new GestureArenaEntry._(this, key, member);\n   }\n \n+  void close(Object key) {\n+    _GestureArenaState state = _arenas[key];\n+    if (state == null)\n+      return;  // This arena either never existed or has been resolved.\n+    state.isOpen = false;\n+    _tryToResolveArena(key, state);\n+  }\n+\n+  void _tryToResolveArena(Object key, _GestureArenaState state) {\n+    assert(_arenas[key] == state);","path":"sky/packages/sky/lib/gestures/arena.dart","position":38,"original_position":38,"commit_id":"8de1036f8830a0606f309a827dbb435408757636","original_commit_id":"8de1036f8830a0606f309a827dbb435408757636","user":{"login":"Hixie","id":551196,"avatar_url":"https://avatars.githubusercontent.com/u/551196?v=3","gravatar_id":"","url":"https://api.github.com/users/Hixie","html_url":"https://github.com/Hixie","followers_url":"https://api.github.com/users/Hixie/followers","following_url":"https://api.github.com/users/Hixie/following{/other_user}","gists_url":"https://api.github.com/users/Hixie/gists{/gist_id}","starred_url":"https://api.github.com/users/Hixie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hixie/subscriptions","organizations_url":"https://api.github.com/users/Hixie/orgs","repos_url":"https://api.github.com/users/Hixie/repos","events_url":"https://api.github.com/users/Hixie/events{/privacy}","received_events_url":"https://api.github.com/users/Hixie/received_events","type":"User","site_admin":false},"body":"should assert that it's closed here","created_at":"2015-08-30T02:26:04Z","updated_at":"2015-08-30T02:26:04Z","html_url":"https://github.com/domokit/sky_engine/pull/947#discussion_r38267849","pull_request_url":"https://api.github.com/repos/domokit/sky_engine/pulls/947","_links":{"self":{"href":"https://api.github.com/repos/domokit/sky_engine/pulls/comments/38267849"},"html":{"href":"https://github.com/domokit/sky_engine/pull/947#discussion_r38267849"},"pull_request":{"href":"https://api.github.com/repos/domokit/sky_engine/pulls/947"}}},"pull_request":{"url":"https://api.github.com/repos/domokit/sky_engine/pulls/947","id":43689479,"html_url":"https://github.com/domokit/sky_engine/pull/947","diff_url":"https://github.com/domokit/sky_engine/pull/947.diff","patch_url":"https://github.com/domokit/sky_engine/pull/947.patch","issue_url":"https://api.github.com/repos/domokit/sky_engine/issues/947","number":947,"state":"open","locked":false,"title":"Scrolls should start immediately when possible","user":{"login":"abarth","id":112007,"avatar_url":"https://avatars.githubusercontent.com/u/112007?v=3","gravatar_id":"","url":"https://api.github.com/users/abarth","html_url":"https://github.com/abarth","followers_url":"https://api.github.com/users/abarth/followers","following_url":"https://api.github.com/users/abarth/following{/other_user}","gists_url":"https://api.github.com/users/abarth/gists{/gist_id}","starred_url":"https://api.github.com/users/abarth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abarth/subscriptions","organizations_url":"https://api.github.com/users/abarth/orgs","repos_url":"https://api.github.com/users/abarth/repos","events_url":"https://api.github.com/users/abarth/events{/privacy}","received_events_url":"https://api.github.com/users/abarth/received_events","type":"User","site_admin":false},"body":"If there are no other gestures in the arena, we should kick off the scroll\r\ngesture right away. This change pulled a refactoring of how we dispatch events\r\nto Widgets. Now we dispatch events to Widgets interleaved with their associated\r\nRenderObjects. (Previously we dispatched to all of the RenderObjects first.)","created_at":"2015-08-29T05:55:35Z","updated_at":"2015-08-30T02:26:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1bd58bb5baba14fdabd9f8accc10d4e22f9d0c59","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/domokit/sky_engine/pulls/947/commits","review_comments_url":"https://api.github.com/repos/domokit/sky_engine/pulls/947/comments","review_comment_url":"https://api.github.com/repos/domokit/sky_engine/pulls/comments{/number}","comments_url":"https://api.github.com/repos/domokit/sky_engine/issues/947/comments","statuses_url":"https://api.github.com/repos/domokit/sky_engine/statuses/8de1036f8830a0606f309a827dbb435408757636","head":{"label":"abarth:scroll_immediately","ref":"scroll_immediately","sha":"8de1036f8830a0606f309a827dbb435408757636","user":{"login":"abarth","id":112007,"avatar_url":"https://avatars.githubusercontent.com/u/112007?v=3","gravatar_id":"","url":"https://api.github.com/users/abarth","html_url":"https://github.com/abarth","followers_url":"https://api.github.com/users/abarth/followers","following_url":"https://api.github.com/users/abarth/following{/other_user}","gists_url":"https://api.github.com/users/abarth/gists{/gist_id}","starred_url":"https://api.github.com/users/abarth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abarth/subscriptions","organizations_url":"https://api.github.com/users/abarth/orgs","repos_url":"https://api.github.com/users/abarth/repos","events_url":"https://api.github.com/users/abarth/events{/privacy}","received_events_url":"https://api.github.com/users/abarth/received_events","type":"User","site_admin":false},"repo":{"id":39215675,"name":"sky_engine","full_name":"abarth/sky_engine","owner":{"login":"abarth","id":112007,"avatar_url":"https://avatars.githubusercontent.com/u/112007?v=3","gravatar_id":"","url":"https://api.github.com/users/abarth","html_url":"https://github.com/abarth","followers_url":"https://api.github.com/users/abarth/followers","following_url":"https://api.github.com/users/abarth/following{/other_user}","gists_url":"https://api.github.com/users/abarth/gists{/gist_id}","starred_url":"https://api.github.com/users/abarth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abarth/subscriptions","organizations_url":"https://api.github.com/users/abarth/orgs","repos_url":"https://api.github.com/users/abarth/repos","events_url":"https://api.github.com/users/abarth/events{/privacy}","received_events_url":"https://api.github.com/users/abarth/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/abarth/sky_engine","description":"The Sky engine","fork":true,"url":"https://api.github.com/repos/abarth/sky_engine","forks_url":"https://api.github.com/repos/abarth/sky_engine/forks","keys_url":"https://api.github.com/repos/abarth/sky_engine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/abarth/sky_engine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/abarth/sky_engine/teams","hooks_url":"https://api.github.com/repos/abarth/sky_engine/hooks","issue_events_url":"https://api.github.com/repos/abarth/sky_engine/issues/events{/number}","events_url":"https://api.github.com/repos/abarth/sky_engine/events","assignees_url":"https://api.github.com/repos/abarth/sky_engine/assignees{/user}","branches_url":"https://api.github.com/repos/abarth/sky_engine/branches{/branch}","tags_url":"https://api.github.com/repos/abarth/sky_engine/tags","blobs_url":"https://api.github.com/repos/abarth/sky_engine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/abarth/sky_engine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/abarth/sky_engine/git/refs{/sha}","trees_url":"https://api.github.com/repos/abarth/sky_engine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/abarth/sky_engine/statuses/{sha}","languages_url":"https://api.github.com/repos/abarth/sky_engine/languages","stargazers_url":"https://api.github.com/repos/abarth/sky_engine/stargazers","contributors_url":"https://api.github.com/repos/abarth/sky_engine/contributors","subscribers_url":"https://api.github.com/repos/abarth/sky_engine/subscribers","subscription_url":"https://api.github.com/repos/abarth/sky_engine/subscription","commits_url":"https://api.github.com/repos/abarth/sky_engine/commits{/sha}","git_commits_url":"https://api.github.com/repos/abarth/sky_engine/git/commits{/sha}","comments_url":"https://api.github.com/repos/abarth/sky_engine/comments{/number}","issue_comment_url":"https://api.github.com/repos/abarth/sky_engine/issues/comments{/number}","contents_url":"https://api.github.com/repos/abarth/sky_engine/contents/{+path}","compare_url":"https://api.github.com/repos/abarth/sky_engine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/abarth/sky_engine/merges","archive_url":"https://api.github.com/repos/abarth/sky_engine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/abarth/sky_engine/downloads","issues_url":"https://api.github.com/repos/abarth/sky_engine/issues{/number}","pulls_url":"https://api.github.com/repos/abarth/sky_engine/pulls{/number}","milestones_url":"https://api.github.com/repos/abarth/sky_engine/milestones{/number}","notifications_url":"https://api.github.com/repos/abarth/sky_engine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/abarth/sky_engine/labels{/name}","releases_url":"https://api.github.com/repos/abarth/sky_engine/releases{/id}","created_at":"2015-07-16T19:18:24Z","updated_at":"2015-07-16T19:18:43Z","pushed_at":"2015-08-29T22:50:17Z","git_url":"git://github.com/abarth/sky_engine.git","ssh_url":"git@github.com:abarth/sky_engine.git","clone_url":"https://github.com/abarth/sky_engine.git","svn_url":"https://github.com/abarth/sky_engine","homepage":null,"size":73574,"stargazers_count":0,"watchers_count":0,"language":"C++","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":"master"}},"base":{"label":"domokit:master","ref":"master","sha":"34468e3c65a427faac915e0bba651dc2ef27cfee","user":{"login":"domokit","id":8664152,"avatar_url":"https://avatars.githubusercontent.com/u/8664152?v=3","gravatar_id":"","url":"https://api.github.com/users/domokit","html_url":"https://github.com/domokit","followers_url":"https://api.github.com/users/domokit/followers","following_url":"https://api.github.com/users/domokit/following{/other_user}","gists_url":"https://api.github.com/users/domokit/gists{/gist_id}","starred_url":"https://api.github.com/users/domokit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/domokit/subscriptions","organizations_url":"https://api.github.com/users/domokit/orgs","repos_url":"https://api.github.com/users/domokit/repos","events_url":"https://api.github.com/users/domokit/events{/privacy}","received_events_url":"https://api.github.com/users/domokit/received_events","type":"Organization","site_admin":false},"repo":{"id":39211337,"name":"sky_engine","full_name":"domokit/sky_engine","owner":{"login":"domokit","id":8664152,"avatar_url":"https://avatars.githubusercontent.com/u/8664152?v=3","gravatar_id":"","url":"https://api.github.com/users/domokit","html_url":"https://github.com/domokit","followers_url":"https://api.github.com/users/domokit/followers","following_url":"https://api.github.com/users/domokit/following{/other_user}","gists_url":"https://api.github.com/users/domokit/gists{/gist_id}","starred_url":"https://api.github.com/users/domokit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/domokit/subscriptions","organizations_url":"https://api.github.com/users/domokit/orgs","repos_url":"https://api.github.com/users/domokit/repos","events_url":"https://api.github.com/users/domokit/events{/privacy}","received_events_url":"https://api.github.com/users/domokit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/domokit/sky_engine","description":"The Sky engine","fork":false,"url":"https://api.github.com/repos/domokit/sky_engine","forks_url":"https://api.github.com/repos/domokit/sky_engine/forks","keys_url":"https://api.github.com/repos/domokit/sky_engine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/domokit/sky_engine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/domokit/sky_engine/teams","hooks_url":"https://api.github.com/repos/domokit/sky_engine/hooks","issue_events_url":"https://api.github.com/repos/domokit/sky_engine/issues/events{/number}","events_url":"https://api.github.com/repos/domokit/sky_engine/events","assignees_url":"https://api.github.com/repos/domokit/sky_engine/assignees{/user}","branches_url":"https://api.github.com/repos/domokit/sky_engine/branches{/branch}","tags_url":"https://api.github.com/repos/domokit/sky_engine/tags","blobs_url":"https://api.github.com/repos/domokit/sky_engine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/domokit/sky_engine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/domokit/sky_engine/git/refs{/sha}","trees_url":"https://api.github.com/repos/domokit/sky_engine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/domokit/sky_engine/statuses/{sha}","languages_url":"https://api.github.com/repos/domokit/sky_engine/languages","stargazers_url":"https://api.github.com/repos/domokit/sky_engine/stargazers","contributors_url":"https://api.github.com/repos/domokit/sky_engine/contributors","subscribers_url":"https://api.github.com/repos/domokit/sky_engine/subscribers","subscription_url":"https://api.github.com/repos/domokit/sky_engine/subscription","commits_url":"https://api.github.com/repos/domokit/sky_engine/commits{/sha}","git_commits_url":"https://api.github.com/repos/domokit/sky_engine/git/commits{/sha}","comments_url":"https://api.github.com/repos/domokit/sky_engine/comments{/number}","issue_comment_url":"https://api.github.com/repos/domokit/sky_engine/issues/comments{/number}","contents_url":"https://api.github.com/repos/domokit/sky_engine/contents/{+path}","compare_url":"https://api.github.com/repos/domokit/sky_engine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/domokit/sky_engine/merges","archive_url":"https://api.github.com/repos/domokit/sky_engine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/domokit/sky_engine/downloads","issues_url":"https://api.github.com/repos/domokit/sky_engine/issues{/number}","pulls_url":"https://api.github.com/repos/domokit/sky_engine/pulls{/number}","milestones_url":"https://api.github.com/repos/domokit/sky_engine/milestones{/number}","notifications_url":"https://api.github.com/repos/domokit/sky_engine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/domokit/sky_engine/labels{/name}","releases_url":"https://api.github.com/repos/domokit/sky_engine/releases{/id}","created_at":"2015-07-16T17:39:56Z","updated_at":"2015-08-28T22:01:13Z","pushed_at":"2015-08-29T22:55:13Z","git_url":"git://github.com/domokit/sky_engine.git","ssh_url":"git@github.com:domokit/sky_engine.git","clone_url":"https://github.com/domokit/sky_engine.git","svn_url":"https://github.com/domokit/sky_engine","homepage":null,"size":82578,"stargazers_count":154,"watchers_count":154,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":52,"mirror_url":null,"open_issues_count":196,"forks":52,"open_issues":196,"watchers":154,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/domokit/sky_engine/pulls/947"},"html":{"href":"https://github.com/domokit/sky_engine/pull/947"},"issue":{"href":"https://api.github.com/repos/domokit/sky_engine/issues/947"},"comments":{"href":"https://api.github.com/repos/domokit/sky_engine/issues/947/comments"},"review_comments":{"href":"https://api.github.com/repos/domokit/sky_engine/pulls/947/comments"},"review_comment":{"href":"https://api.github.com/repos/domokit/sky_engine/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/domokit/sky_engine/pulls/947/commits"},"statuses":{"href":"https://api.github.com/repos/domokit/sky_engine/statuses/8de1036f8830a0606f309a827dbb435408757636"}}}}