Darin worries that this memcpy might be slow. Patch forthcoming.
Created attachment 31574 [details] patch Notice that the string is kept alive anyway because the ScriptSourceCode holds a JSC::SourceCode which holds a RefPtr<SourceProvider> which holds String m_source (via StringSourceProvider : public JSC::SourceProvider).
Created attachment 31576 [details] patch Oops. Forgot the const.
Comment on attachment 31574 [details] patch > + // This same string is actually buried in m_code, but there isn't a clean > + // want to write an accessor for it, so we cache a refernce to it. > + String m_source; "clean want"? How about "clean way"? But I do think there is a clean way to get at it. Just add a source() member to StringSourceProvider, then call static_cast<StringSourceProvider*>(m_code->provider())->source().
Comment on attachment 31576 [details] patch It's not really buried all that deeply. I seriously think you could just do static_cast<StringSourceProvider*>(m_code->provider())->source(). r=me
> It's not really buried all that deeply. I seriously think you could just do > static_cast<StringSourceProvider*>(m_code->provider())->source(). r=me Ah. I hadn't considered using a static_cast. That should work.
Sending WebCore/ChangeLog Sending WebCore/bindings/js/ScriptSourceCode.h Sending WebCore/bindings/js/StringSourceProvider.h Transmitting file data ... Committed revision 44894.