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

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

Issue 686763002: Fix Runtime.executionContextCreated for crafted iframes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 6 years 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 966 matching lines...) Expand 10 before | Expand all | Expand 10 after
977 Settings* settings = mainFrame()->settings(); 977 Settings* settings = mainFrame()->settings();
978 if (settings) { 978 if (settings) {
979 m_ignoreScriptsEnabledNotification = true; 979 m_ignoreScriptsEnabledNotification = true;
980 settings->setScriptEnabled(!value); 980 settings->setScriptEnabled(!value);
981 m_ignoreScriptsEnabledNotification = false; 981 m_ignoreScriptsEnabledNotification = false;
982 } 982 }
983 } 983 }
984 984
985 void InspectorPageAgent::didClearDocumentOfWindowObject(LocalFrame* frame) 985 void InspectorPageAgent::didClearDocumentOfWindowObject(LocalFrame* frame)
986 { 986 {
987 if (frame == m_page->mainFrame())
988 m_injectedScriptManager->discardInjectedScripts();
989
990 if (!m_frontend) 987 if (!m_frontend)
991 return; 988 return;
992 989
993 RefPtr<JSONObject> scripts = m_state->getObject(PageAgentState::pageAgentScr iptsToEvaluateOnLoad); 990 RefPtr<JSONObject> scripts = m_state->getObject(PageAgentState::pageAgentScr iptsToEvaluateOnLoad);
994 if (scripts) { 991 if (scripts) {
995 JSONObject::const_iterator end = scripts->end(); 992 JSONObject::const_iterator end = scripts->end();
996 for (JSONObject::const_iterator it = scripts->begin(); it != end; ++it) { 993 for (JSONObject::const_iterator it = scripts->begin(); it != end; ++it) {
997 String scriptText; 994 String scriptText;
998 if (it->value->asString(&scriptText)) 995 if (it->value->asString(&scriptText))
999 frame->script().executeScriptInMainWorld(scriptText); 996 frame->script().executeScriptInMainWorld(scriptText);
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
1506 void InspectorPageAgent::trace(Visitor* visitor) 1503 void InspectorPageAgent::trace(Visitor* visitor)
1507 { 1504 {
1508 visitor->trace(m_page); 1505 visitor->trace(m_page);
1509 visitor->trace(m_injectedScriptManager); 1506 visitor->trace(m_injectedScriptManager);
1510 visitor->trace(m_inspectorResourceContentLoader); 1507 visitor->trace(m_inspectorResourceContentLoader);
1511 InspectorBaseAgent::trace(visitor); 1508 InspectorBaseAgent::trace(visitor);
1512 } 1509 }
1513 1510
1514 } // namespace blink 1511 } // namespace blink
1515 1512
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorInstrumentation.idl ('k') | Source/core/inspector/PageRuntimeAgent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698