OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |