{"action":"created","comment":{"url":"https://api.github.com/repos/crosswalk-project/crosswalk/pulls/comments/45956893","id":45956893,"diff_hunk":"@@ -197,75 +209,28 @@ public void onBinaryMessage(int extensionInstanceID, byte[] message) {}\n      * @param message the message from JavaScript code.\n      */\n     public String onSyncMessage(int extensionInstanceID, String message) {\n-        Object result = handleMessage(extensionInstanceID, message);\n+        Object result = null;\n+        if (useJsStubGeneration) {\n+            result = getInstanceHelper(extensionInstanceID).handleMessage(message);\n+        }\n         return (result != null) ? ReflectionHelper.objToJSON(result): \"\";\n     }\n \n-    public ReflectionHelper getTargetReflect(String cName) {\n-        ReflectionHelper targetReflect = reflection.getConstructorReflection(cName);\n-        return (targetReflect != null)? targetReflect : reflection;\n-    }\n-    \n-    Object handleMessage(int extensionInstanceID, String message) {\n-        String TAG = \"Extension-\" + mName;\n-        try {\n-            JSONObject m = new JSONObject(message);\n-            String cmd = m.getString(\"cmd\");\n-            int objectId = m.getInt(\"objectId\");\n-\n-            if (cmd.equals(\"jsObjectCollected\")) {\n-                XWalkExtensionBindingObject obj =\n-                        getInstanceStore(extensionInstanceID).removeBindingObject(objectId);\n-                return null;\n-            } else if (cmd.equals(\"newInstance\")) {\n-                XWalkExtensionBindingObject instance = (XWalkExtensionBindingObject)(reflection.invokeMethod(\n-                        this, extensionInstanceID, this, m.getString(\"name\"), m.getJSONArray(\"args\")));\n-                if (instance == null) return false;\n-\n-                int newObjectId = m.getInt(\"bindingObjectId\");\n-                return getInstanceStore(extensionInstanceID).addBindingObject(newObjectId, instance);\n-            } else {\n-                /*\n-                 * 1. message to the extension itself,  objectId:0,    cName:\"\"\n-                 * 2. message to constructor,           objectId:0,    cName:[Its exported JS name]\n-                 * 3, message to object,                objectId:[>1], cName:[Its constructor's JS name]\n-                 */\n-                String cName = m.getString(\"constructorJsName\");\n-                Object targetObj = null;\n-                if (objectId == 0) {\n-                    targetObj = (cName.length() == 0) ? this : null;\n-                } else {\n-                    targetObj = getInstanceStore(extensionInstanceID).getBindingObject(objectId);\n-                }\n-                return getTargetReflect(cName).handleMessage(this, extensionInstanceID, targetObj, m);\n-            }\n-        } catch (Exception e) {\n-            if (e instanceof JSONException) {\n-                Log.w(TAG, \"Invalid message, error msg:\\n\" + e.toString());\n-            } else if (e instanceof IllegalArgumentException) {\n-                logJs(extensionInstanceID, e.toString(), \"warn\");\n-            } else {\n-                Log.w(TAG, \"Failed to access member, error msg:\\n\" + e.toString());\n-            }\n-            e.printStackTrace();\n-        }\n-        return null;\n+    public ReflectionHelper getReflection() {\n+        return mReflection;\n     }\n \n-    protected Object getBindingStore(int instanceId) {\n-       return instanceStores.get(instanceId);\n+    public MessageHandler getMessageHandler() {\n+        return mHandler;\n+    }\n+    \n+    public ReflectionHelper getTargetReflect(String cName) {\n+        ReflectionHelper targetReflect = mReflection.getConstructorReflection(cName);\n+        return (targetReflect != null)? targetReflect : mReflection;","path":"app/android/runtime_client/src/org/xwalk/app/runtime/extension/XWalkExtensionClient.java","position":168,"original_position":168,"commit_id":"748137b83ee2e145236b915b0da92e2dea93950d","original_commit_id":"748137b83ee2e145236b915b0da92e2dea93950d","user":{"login":"halton","id":433218,"avatar_url":"https://avatars.githubusercontent.com/u/433218?v=3","gravatar_id":"","url":"https://api.github.com/users/halton","html_url":"https://github.com/halton","followers_url":"https://api.github.com/users/halton/followers","following_url":"https://api.github.com/users/halton/following{/other_user}","gists_url":"https://api.github.com/users/halton/gists{/gist_id}","starred_url":"https://api.github.com/users/halton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/halton/subscriptions","organizations_url":"https://api.github.com/users/halton/orgs","repos_url":"https://api.github.com/users/halton/repos","events_url":"https://api.github.com/users/halton/events{/privacy}","received_events_url":"https://api.github.com/users/halton/received_events","type":"User","site_admin":false},"body":"space before `?`","created_at":"2015-11-26T09:17:37Z","updated_at":"2015-11-26T09:17:37Z","html_url":"https://github.com/crosswalk-project/crosswalk/pull/3420#discussion_r45956893","pull_request_url":"https://api.github.com/repos/crosswalk-project/crosswalk/pulls/3420","_links":{"self":{"href":"https://api.github.com/repos/crosswalk-project/crosswalk/pulls/comments/45956893"},"html":{"href":"https://github.com/crosswalk-project/crosswalk/pull/3420#discussion_r45956893"},"pull_request":{"href":"https://api.github.com/repos/crosswalk-project/crosswalk/pulls/3420"}}},"pull_request":{"url":"https://api.github.com/repos/crosswalk-project/crosswalk/pulls/3420","id":51611824,"html_url":"https://github.com/crosswalk-project/crosswalk/pull/3420","diff_url":"https://github.com/crosswalk-project/crosswalk/pull/3420.diff","patch_url":"https://github.com/crosswalk-project/crosswalk/pull/3420.patch","issue_url":"https://api.github.com/repos/crosswalk-project/crosswalk/issues/3420","number":3420,"state":"open","locked":false,"title":"[Android] BMI support on Java external extension infrastructure.","user":{"login":"DonnaWuDongxia","id":1028905,"avatar_url":"https://avatars.githubusercontent.com/u/1028905?v=3","gravatar_id":"","url":"https://api.github.com/users/DonnaWuDongxia","html_url":"https://github.com/DonnaWuDongxia","followers_url":"https://api.github.com/users/DonnaWuDongxia/followers","following_url":"https://api.github.com/users/DonnaWuDongxia/following{/other_user}","gists_url":"https://api.github.com/users/DonnaWuDongxia/gists{/gist_id}","starred_url":"https://api.github.com/users/DonnaWuDongxia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DonnaWuDongxia/subscriptions","organizations_url":"https://api.github.com/users/DonnaWuDongxia/orgs","repos_url":"https://api.github.com/users/DonnaWuDongxia/repos","events_url":"https://api.github.com/users/DonnaWuDongxia/events{/privacy}","received_events_url":"https://api.github.com/users/DonnaWuDongxia/received_events","type":"User","site_admin":false},"body":"This commit aimed to add BMI support to the external Java extension\r\ninfrastructure, including underline modules refining.\r\nDetails listed as follows:\r\n1. Refine the BindingObject and EventTarget implmentation.\r\n2. Add MessageHandler and MessageInfo to keep the compatibility\r\n   with customized extension JS code based on 'jsStub' module.\r\n   It means, registering the exposed API to MessageHandler instead\r\n   of annotating them.\r\n3. BMI support on both the 'jsStub' module and the Java side.\r\n4. A invert color sample to test the BMI support feature.\r\n\r\nBUG=XWALK-5602","created_at":"2015-11-24T03:05:00Z","updated_at":"2015-11-26T09:17:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d3ea413777a6e5074dec00df82f09b79095abdb2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/crosswalk-project/crosswalk/pulls/3420/commits","review_comments_url":"https://api.github.com/repos/crosswalk-project/crosswalk/pulls/3420/comments","review_comment_url":"https://api.github.com/repos/crosswalk-project/crosswalk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/crosswalk-project/crosswalk/issues/3420/comments","statuses_url":"https://api.github.com/repos/crosswalk-project/crosswalk/statuses/748137b83ee2e145236b915b0da92e2dea93950d","head":{"label":"DonnaWuDongxia:bmi","ref":"bmi","sha":"748137b83ee2e145236b915b0da92e2dea93950d","user":{"login":"DonnaWuDongxia","id":1028905,"avatar_url":"https://avatars.githubusercontent.com/u/1028905?v=3","gravatar_id":"","url":"https://api.github.com/users/DonnaWuDongxia","html_url":"https://github.com/DonnaWuDongxia","followers_url":"https://api.github.com/users/DonnaWuDongxia/followers","following_url":"https://api.github.com/users/DonnaWuDongxia/following{/other_user}","gists_url":"https://api.github.com/users/DonnaWuDongxia/gists{/gist_id}","starred_url":"https://api.github.com/users/DonnaWuDongxia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DonnaWuDongxia/subscriptions","organizations_url":"https://api.github.com/users/DonnaWuDongxia/orgs","repos_url":"https://api.github.com/users/DonnaWuDongxia/repos","events_url":"https://api.github.com/users/DonnaWuDongxia/events{/privacy}","received_events_url":"https://api.github.com/users/DonnaWuDongxia/received_events","type":"User","site_admin":false},"repo":{"id":12153023,"name":"crosswalk","full_name":"DonnaWuDongxia/crosswalk","owner":{"login":"DonnaWuDongxia","id":1028905,"avatar_url":"https://avatars.githubusercontent.com/u/1028905?v=3","gravatar_id":"","url":"https://api.github.com/users/DonnaWuDongxia","html_url":"https://github.com/DonnaWuDongxia","followers_url":"https://api.github.com/users/DonnaWuDongxia/followers","following_url":"https://api.github.com/users/DonnaWuDongxia/following{/other_user}","gists_url":"https://api.github.com/users/DonnaWuDongxia/gists{/gist_id}","starred_url":"https://api.github.com/users/DonnaWuDongxia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DonnaWuDongxia/subscriptions","organizations_url":"https://api.github.com/users/DonnaWuDongxia/orgs","repos_url":"https://api.github.com/users/DonnaWuDongxia/repos","events_url":"https://api.github.com/users/DonnaWuDongxia/events{/privacy}","received_events_url":"https://api.github.com/users/DonnaWuDongxia/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/DonnaWuDongxia/crosswalk","description":"potential Tizen web runtime","fork":true,"url":"https://api.github.com/repos/DonnaWuDongxia/crosswalk","forks_url":"https://api.github.com/repos/DonnaWuDongxia/crosswalk/forks","keys_url":"https://api.github.com/repos/DonnaWuDongxia/crosswalk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DonnaWuDongxia/crosswalk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DonnaWuDongxia/crosswalk/teams","hooks_url":"https://api.github.com/repos/DonnaWuDongxia/crosswalk/hooks","issue_events_url":"https://api.github.com/repos/DonnaWuDongxia/crosswalk/issues/events{/number}","events_url":"https://api.github.com/repos/DonnaWuDongxia/crosswalk/events","assignees_url":"https://api.github.com/repos/DonnaWuDongxia/crosswalk/assignees{/user}","branches_url":"https://api.github.com/repos/DonnaWuDongxia/crosswalk/branches{/branch}","tags_url":"https://api.github.com/repos/DonnaWuDongxia/crosswalk/tags","blobs_url":"https://api.github.com/repos/DonnaWuDongxia/crosswalk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DonnaWuDongxia/crosswalk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DonnaWuDongxia/crosswalk/git/refs{/sha}","trees_url":"https://api.github.com/repos/DonnaWuDongxia/crosswalk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DonnaWuDongxia/crosswalk/statuses/{sha}","languages_url":"https://api.github.com/repos/DonnaWuDongxia/crosswalk/languages","stargazers_url":"https://api.github.com/repos/DonnaWuDongxia/crosswalk/stargazers","contributors_url":"https://api.github.com/repos/DonnaWuDongxia/crosswalk/contributors","subscribers_url":"https://api.github.com/repos/DonnaWuDongxia/crosswalk/subscribers","subscription_url":"https://api.github.com/repos/DonnaWuDongxia/crosswalk/subscription","commits_url":"https://api.github.com/repos/DonnaWuDongxia/crosswalk/commits{/sha}","git_commits_url":"https://api.github.com/repos/DonnaWuDongxia/crosswalk/git/commits{/sha}","comments_url":"https://api.github.com/repos/DonnaWuDongxia/crosswalk/comments{/number}","issue_comment_url":"https://api.github.com/repos/DonnaWuDongxia/crosswalk/issues/comments{/number}","contents_url":"https://api.github.com/repos/DonnaWuDongxia/crosswalk/contents/{+path}","compare_url":"https://api.github.com/repos/DonnaWuDongxia/crosswalk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DonnaWuDongxia/crosswalk/merges","archive_url":"https://api.github.com/repos/DonnaWuDongxia/crosswalk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DonnaWuDongxia/crosswalk/downloads","issues_url":"https://api.github.com/repos/DonnaWuDongxia/crosswalk/issues{/number}","pulls_url":"https://api.github.com/repos/DonnaWuDongxia/crosswalk/pulls{/number}","milestones_url":"https://api.github.com/repos/DonnaWuDongxia/crosswalk/milestones{/number}","notifications_url":"https://api.github.com/repos/DonnaWuDongxia/crosswalk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DonnaWuDongxia/crosswalk/labels{/name}","releases_url":"https://api.github.com/repos/DonnaWuDongxia/crosswalk/releases{/id}","created_at":"2013-08-16T07:14:01Z","updated_at":"2015-05-05T10:30:54Z","pushed_at":"2015-11-25T07:39:45Z","git_url":"git://github.com/DonnaWuDongxia/crosswalk.git","ssh_url":"git@github.com:DonnaWuDongxia/crosswalk.git","clone_url":"https://github.com/DonnaWuDongxia/crosswalk.git","svn_url":"https://github.com/DonnaWuDongxia/crosswalk","homepage":"","size":14074,"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":"crosswalk-project:master","ref":"master","sha":"fcfdac08767bf84ac8c70dec3b1388ee282ed576","user":{"login":"crosswalk-project","id":4867377,"avatar_url":"https://avatars.githubusercontent.com/u/4867377?v=3","gravatar_id":"","url":"https://api.github.com/users/crosswalk-project","html_url":"https://github.com/crosswalk-project","followers_url":"https://api.github.com/users/crosswalk-project/followers","following_url":"https://api.github.com/users/crosswalk-project/following{/other_user}","gists_url":"https://api.github.com/users/crosswalk-project/gists{/gist_id}","starred_url":"https://api.github.com/users/crosswalk-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crosswalk-project/subscriptions","organizations_url":"https://api.github.com/users/crosswalk-project/orgs","repos_url":"https://api.github.com/users/crosswalk-project/repos","events_url":"https://api.github.com/users/crosswalk-project/events{/privacy}","received_events_url":"https://api.github.com/users/crosswalk-project/received_events","type":"Organization","site_admin":false},"repo":{"id":9207280,"name":"crosswalk","full_name":"crosswalk-project/crosswalk","owner":{"login":"crosswalk-project","id":4867377,"avatar_url":"https://avatars.githubusercontent.com/u/4867377?v=3","gravatar_id":"","url":"https://api.github.com/users/crosswalk-project","html_url":"https://github.com/crosswalk-project","followers_url":"https://api.github.com/users/crosswalk-project/followers","following_url":"https://api.github.com/users/crosswalk-project/following{/other_user}","gists_url":"https://api.github.com/users/crosswalk-project/gists{/gist_id}","starred_url":"https://api.github.com/users/crosswalk-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crosswalk-project/subscriptions","organizations_url":"https://api.github.com/users/crosswalk-project/orgs","repos_url":"https://api.github.com/users/crosswalk-project/repos","events_url":"https://api.github.com/users/crosswalk-project/events{/privacy}","received_events_url":"https://api.github.com/users/crosswalk-project/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/crosswalk-project/crosswalk","description":"","fork":false,"url":"https://api.github.com/repos/crosswalk-project/crosswalk","forks_url":"https://api.github.com/repos/crosswalk-project/crosswalk/forks","keys_url":"https://api.github.com/repos/crosswalk-project/crosswalk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crosswalk-project/crosswalk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crosswalk-project/crosswalk/teams","hooks_url":"https://api.github.com/repos/crosswalk-project/crosswalk/hooks","issue_events_url":"https://api.github.com/repos/crosswalk-project/crosswalk/issues/events{/number}","events_url":"https://api.github.com/repos/crosswalk-project/crosswalk/events","assignees_url":"https://api.github.com/repos/crosswalk-project/crosswalk/assignees{/user}","branches_url":"https://api.github.com/repos/crosswalk-project/crosswalk/branches{/branch}","tags_url":"https://api.github.com/repos/crosswalk-project/crosswalk/tags","blobs_url":"https://api.github.com/repos/crosswalk-project/crosswalk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crosswalk-project/crosswalk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crosswalk-project/crosswalk/git/refs{/sha}","trees_url":"https://api.github.com/repos/crosswalk-project/crosswalk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crosswalk-project/crosswalk/statuses/{sha}","languages_url":"https://api.github.com/repos/crosswalk-project/crosswalk/languages","stargazers_url":"https://api.github.com/repos/crosswalk-project/crosswalk/stargazers","contributors_url":"https://api.github.com/repos/crosswalk-project/crosswalk/contributors","subscribers_url":"https://api.github.com/repos/crosswalk-project/crosswalk/subscribers","subscription_url":"https://api.github.com/repos/crosswalk-project/crosswalk/subscription","commits_url":"https://api.github.com/repos/crosswalk-project/crosswalk/commits{/sha}","git_commits_url":"https://api.github.com/repos/crosswalk-project/crosswalk/git/commits{/sha}","comments_url":"https://api.github.com/repos/crosswalk-project/crosswalk/comments{/number}","issue_comment_url":"https://api.github.com/repos/crosswalk-project/crosswalk/issues/comments{/number}","contents_url":"https://api.github.com/repos/crosswalk-project/crosswalk/contents/{+path}","compare_url":"https://api.github.com/repos/crosswalk-project/crosswalk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crosswalk-project/crosswalk/merges","archive_url":"https://api.github.com/repos/crosswalk-project/crosswalk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crosswalk-project/crosswalk/downloads","issues_url":"https://api.github.com/repos/crosswalk-project/crosswalk/issues{/number}","pulls_url":"https://api.github.com/repos/crosswalk-project/crosswalk/pulls{/number}","milestones_url":"https://api.github.com/repos/crosswalk-project/crosswalk/milestones{/number}","notifications_url":"https://api.github.com/repos/crosswalk-project/crosswalk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crosswalk-project/crosswalk/labels{/name}","releases_url":"https://api.github.com/repos/crosswalk-project/crosswalk/releases{/id}","created_at":"2013-04-03T23:30:12Z","updated_at":"2015-11-26T08:15:09Z","pushed_at":"2015-11-26T09:05:54Z","git_url":"git://github.com/crosswalk-project/crosswalk.git","ssh_url":"git@github.com:crosswalk-project/crosswalk.git","clone_url":"https://github.com/crosswalk-project/crosswalk.git","svn_url":"https://github.com/crosswalk-project/crosswalk","homepage":"https://crosswalk-project.org/","size":116787,"stargazers_count":1140,"watchers_count":1140,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":317,"mirror_url":null,"open_issues_count":108,"forks":317,"open_issues":108,"watchers":1140,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/crosswalk-project/crosswalk/pulls/3420"},"html":{"href":"https://github.com/crosswalk-project/crosswalk/pull/3420"},"issue":{"href":"https://api.github.com/repos/crosswalk-project/crosswalk/issues/3420"},"comments":{"href":"https://api.github.com/repos/crosswalk-project/crosswalk/issues/3420/comments"},"review_comments":{"href":"https://api.github.com/repos/crosswalk-project/crosswalk/pulls/3420/comments"},"review_comment":{"href":"https://api.github.com/repos/crosswalk-project/crosswalk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/crosswalk-project/crosswalk/pulls/3420/commits"},"statuses":{"href":"https://api.github.com/repos/crosswalk-project/crosswalk/statuses/748137b83ee2e145236b915b0da92e2dea93950d"}}}}