Components.WebView: Convert to using messages for JS method invocation
Use WebKitGTK UserMessage objects for invoking JS methods rather than serialising to JS strings and running those. This is possibly slightly less efficient, but removes the onus on serialising to and parsing from JS and once switched over from message handlers to UserMessage objects will be using a single uniform IPC interface for both.
This commit is contained in:
parent
1ba2bd0f5b
commit
ff565bc6ef
8 changed files with 268 additions and 74 deletions
|
|
@ -87,6 +87,8 @@ PageState.prototype = {
|
|||
window.addEventListener("transitionend", function(e) {
|
||||
queuePreferredHeightUpdate();
|
||||
}, false); // load does not bubble
|
||||
|
||||
this.testResult = null;
|
||||
},
|
||||
getPreferredHeight: function() {
|
||||
// Return the scroll height of the HTML element since the BODY
|
||||
|
|
@ -184,5 +186,13 @@ PageState.prototype = {
|
|||
this.hasSelection = hasSelection;
|
||||
window.webkit.messageHandlers.selectionChanged.postMessage(hasSelection);
|
||||
}
|
||||
},
|
||||
// Methods below are for unit tests.
|
||||
testVoid: function() {
|
||||
this.testResult = "void";
|
||||
},
|
||||
testReturn: function(value) {
|
||||
this.testResult = value;
|
||||
return value;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue