308
edits
Line 7: | Line 7: | ||
In this model, security checks are performed only at known entry points from JavaScript into C++. For example, consider the following JavaScript: | In this model, security checks are performed only at known entry points from JavaScript into C++. For example, consider the following JavaScript: | ||
window.status = "Status"; | |||
This code needs to perform a security check to see whether | This code needs to perform a security check to see whether the caller is allowed to change the text in the status bar. In this model, this check could be performed in the following places: | ||
# The code mapping | # The code mapping Window.status to nsGlobalWindow::SetStatus. | ||
# The implementation of | # The implementation of nsGlobalWindow::SetStatus. | ||
The check could NOT be performed in | The check could NOT be performed in nsIWebBrowserChrome::SetStatus, which is called by nsGlobalWindow::SetStatus to do the actual work of setting the status in this case. | ||
In general, in this model there is a concept of "the function currently being called from JS". This function is the only function that does security checks. | In general, in this model there is a concept of "the function currently being called from JS". This function is the only function that does security checks. |
edits