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

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

Issue 146693005: Clarify when what notifications are send when a window object is cleared (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: updates Created 6 years, 7 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 | Annotate | Revision Log
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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 70
71 InspectorRuntimeAgent::enable(errorString); 71 InspectorRuntimeAgent::enable(errorString);
72 72
73 // Only report existing contexts if the page did commit load, otherwise we m ay 73 // Only report existing contexts if the page did commit load, otherwise we m ay
74 // unintentionally initialize contexts in the frames which may trigger some listeners 74 // unintentionally initialize contexts in the frames which may trigger some listeners
75 // that are expected to be triggered only after the load is committed, see h ttp://crbug.com/131623 75 // that are expected to be triggered only after the load is committed, see h ttp://crbug.com/131623
76 if (m_mainWorldContextCreated) 76 if (m_mainWorldContextCreated)
77 reportExecutionContextCreation(); 77 reportExecutionContextCreation();
78 } 78 }
79 79
80 void PageRuntimeAgent::didClearWindowObjectInMainWorld(LocalFrame* frame) 80 void PageRuntimeAgent::didClearDocumentOfWindowObject(LocalFrame* frame)
81 { 81 {
82 m_mainWorldContextCreated = true; 82 m_mainWorldContextCreated = true;
83 83
84 if (!m_enabled) 84 if (!m_enabled)
85 return; 85 return;
86 ASSERT(m_frontend); 86 ASSERT(m_frontend);
87 87
88 if (frame == m_inspectedPage->mainFrame()) { 88 if (frame == m_inspectedPage->mainFrame()) {
89 m_scriptStateToId.clear(); 89 m_scriptStateToId.clear();
90 m_frontend->executionContextsCleared(); 90 m_frontend->executionContextsCleared();
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 if (scriptState->contextIsEmpty() || window == scriptState->domWindow()) { 154 if (scriptState->contextIsEmpty() || window == scriptState->domWindow()) {
155 scriptStatesToRemove.append(scriptState); 155 scriptStatesToRemove.append(scriptState);
156 m_frontend->executionContextDestroyed(it->value); 156 m_frontend->executionContextDestroyed(it->value);
157 } 157 }
158 } 158 }
159 m_scriptStateToId.removeAll(scriptStatesToRemove); 159 m_scriptStateToId.removeAll(scriptStatesToRemove);
160 } 160 }
161 161
162 } // namespace WebCore 162 } // namespace WebCore
163 163
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698