On 2011/03/23 23:58:45, metaweta wrote:

http://codereview.appspot.com/4211045/diff/25001/src/com/google/caja/plugin/caja.js
File src/com/google/caja/plugin/caja.js (right):


http://codereview.appspot.com/4211045/diff/25001/src/com/google/caja/plugin/caja.js#newcode295
src/com/google/caja/plugin/caja.js:295: Builder.prototype = {
On 2011/03/23 18:35:24, ihab.awad wrote:
> So fwiw -- given that we've implemented this, it looks to me like
there is no
> need for a Builder _per se_ since there is no use case for a fluent
interface
> (aBuilder.withFoo().andBar().butBaz().exceptBoo()...). The calls are
always
only
> one deep. So maybe cajoledAtUrl(), cajoled(), and friends should
just be
> functions on the frame. The could return a run()-able, or they could
incorporate
> the parameters of run() in their own interface -- whichever. Does
this make
> sense?

Totally, although I can imagine we might want to do something in the
future like
"don't allow this thing network access even if it tries to dynamically
cajole
stuff that isn't in the cache".  This API seems somewhat friendlier to
future
extension.

I could also do something like

frame.url(myUrl).run(...) // defaults to cajoled = false
frame.url(myUrl).cajoled().run(...)
frame.src(myBaseUrl).html(...).run(...)
frame.src(myBaseUrl).cajoled().content(js, opt_html).run(...)



http://codereview.appspot.com/4211045/

Reply via email to