// Scripts
        private void HandleScriptCreated(string message, Func<string> getNextMessage)
        {
            bool parseHolder = false;
            string[] parts = message.Split(new char[] { ',' }, 8);
            int id = int.Parse(parts[1]);
            string name = parts[2];
            string startInfo = parts[3];
            string endInfo = parts[4];
            int deltaLine = int.Parse(parts[5]);
            int xhrId;
            bool hasXhrId = int.TryParse(parts[6], out xhrId);
            string url = parts[7];

            if (m_ScriptPage.HasScriptWithId(id))
                throw new ApplicationException("Cannot define script more than once.");

            string nextMessage = getNextMessage();
            if (!nextMessage.StartsWith("SCRIPT-SOURCE,"))
                throw new ApplicationException("Script source expected.");
            parts = nextMessage.Split(new char[] { ',' }, 3);
            string desc = parts[1];
            string src = parts[2];

            Script s;
            if (url != "" && url != "<eval>" && m_ScriptPage.HasContentItemWithUrl(url))
            {
                // Small TODO: There might have been duplicate requests for the same url, returning different data.
                // Instead of the url, our firefox plugin should give us something more accurate.
                s = new Script(name, m_ScriptPage.GetContentItemByUrl(url));
            }
            else
            {
                bool isEval = url == "<eval>";
                if (m_ScriptSourceHolder == null)
                {
                    if (hasXhrId)
                    {
                        m_ScriptSourceHolder = m_ScriptPage.GetContentItemById(xhrId);
                        m_ScriptSourceHolder.OverrideMimeType("text/javascript");
                    }
                    else
                    {
                        SimpleUri u = isEval ? new SimpleUri("") : new SimpleUri(url);
                        m_ScriptSourceHolder = new ContentItem(m_ScriptPage, null) { Url = u, MimeType = "text/javascript", IsXhr = false };
                    }
                }

                bool isTopLevelEval = desc == "src" && isEval;
                if (desc == "src")
                {
                    if (hasXhrId)
                    {
                        if (new TextDocument(src).FullText != m_ScriptSourceHolder.Document.FullText)
                            throw new ApplicationException("Hash sanity check failed.");
                    }
                    else
                    {
                        m_ScriptSourceHolder.Document = new TextDocument(src);
                    }
                    parseHolder = true;
                }

                if (isEval && name == "")
                    name = "<toplevel>";

                s = new Script(name, isTopLevelEval, m_ScriptSourceHolder);
            }

            if (startInfo == "UNKNOWN")
            {
                s.SetPosInfoUnknown();
            }
            else if (startInfo == "ALL")
            {
                s.SetPosInfoAll(deltaLine);
            }
            else if (startInfo.StartsWith("POS;"))
            {
                string[] posInfo = startInfo.Split(';');
                int startPos = int.Parse(posInfo[1]);
                int endPos = int.Parse(posInfo[2]);
                s.SetPosInfo(startPos, endPos, deltaLine);
            }
            else
            {
                int startLine = int.Parse(startInfo) - 1;
                int endLine = int.Parse(endInfo) - 1;
                s.SetLineInfo(startLine, endLine, deltaLine);
            }

            m_ScriptPage.AddScript(id, s);
            m_Resolver.QueueForResolve(s);

            if (parseHolder)
            {
                EnqueueParse(m_ScriptSourceHolder);
                m_ScriptSourceHolder = null;
            }
        }