Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(199)

Side by Side Diff: Source/core/inspector/InspectorPageAgent.cpp

Issue 13575004: Apply script preprocessor to Web page scripts only. (Closed) Base URL: https://chromium.googlesource.com/external/WebKit_trimmed.git@master
Patch Set: Rebase, simplify Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after
793 { 793 {
794 if (world != mainThreadNormalWorld()) 794 if (world != mainThreadNormalWorld())
795 return; 795 return;
796 796
797 if (frame == m_page->mainFrame()) 797 if (frame == m_page->mainFrame())
798 m_injectedScriptManager->discardInjectedScripts(); 798 m_injectedScriptManager->discardInjectedScripts();
799 799
800 if (!m_frontend) 800 if (!m_frontend)
801 return; 801 return;
802 802
803 v8::HandleScope handleScope; // crash unless we declear HandleScope
804 V8PerContextDebugData::SystemScope systemScope(frame->script()->mainWorldCon text());
805
803 RefPtr<InspectorObject> scripts = m_state->getObject(PageAgentState::pageAge ntScriptsToEvaluateOnLoad); 806 RefPtr<InspectorObject> scripts = m_state->getObject(PageAgentState::pageAge ntScriptsToEvaluateOnLoad);
804 if (scripts) { 807 if (scripts) {
805 InspectorObject::const_iterator end = scripts->end(); 808 InspectorObject::const_iterator end = scripts->end();
806 for (InspectorObject::const_iterator it = scripts->begin(); it != end; + +it) { 809 for (InspectorObject::const_iterator it = scripts->begin(); it != end; + +it) {
807 String scriptText; 810 String scriptText;
808 if (it->value->asString(&scriptText)) 811 if (it->value->asString(&scriptText))
809 frame->script()->executeScript(scriptText); 812 frame->script()->executeScript(scriptText);
810 } 813 }
811 } 814 }
812 if (!m_scriptToEvaluateOnLoadOnce.isEmpty()) 815 if (!m_scriptToEvaluateOnLoadOnce.isEmpty())
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
1218 // Handled on the browser level. 1221 // Handled on the browser level.
1219 } 1222 }
1220 1223
1221 void InspectorPageAgent::handleJavaScriptDialog(ErrorString* errorString, bool a ccept, const String* promptText) 1224 void InspectorPageAgent::handleJavaScriptDialog(ErrorString* errorString, bool a ccept, const String* promptText)
1222 { 1225 {
1223 // Handled on the browser level. 1226 // Handled on the browser level.
1224 } 1227 }
1225 1228
1226 } // namespace WebCore 1229 } // namespace WebCore
1227 1230
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698