OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> | 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> |
4 * Copyright (C) 2012 Google Inc. All rights reserved. | 4 * Copyright (C) 2012 Google Inc. All rights reserved. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * | 9 * |
10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 } | 106 } |
107 return InjectedScript(); | 107 return InjectedScript(); |
108 } | 108 } |
109 | 109 |
110 void InjectedScriptManager::discardInjectedScripts() | 110 void InjectedScriptManager::discardInjectedScripts() |
111 { | 111 { |
112 m_idToInjectedScript.clear(); | 112 m_idToInjectedScript.clear(); |
113 m_scriptStateToId.clear(); | 113 m_scriptStateToId.clear(); |
114 } | 114 } |
115 | 115 |
116 void InjectedScriptManager::discardInjectedScriptsFor(DOMWindow* window) | 116 void InjectedScriptManager::discardInjectedScriptsFor(LocalDOMWindow* window) |
117 { | 117 { |
118 if (m_scriptStateToId.isEmpty()) | 118 if (m_scriptStateToId.isEmpty()) |
119 return; | 119 return; |
120 | 120 |
121 Vector<long> idsToRemove; | 121 Vector<long> idsToRemove; |
122 IdToInjectedScriptMap::iterator end = m_idToInjectedScript.end(); | 122 IdToInjectedScriptMap::iterator end = m_idToInjectedScript.end(); |
123 for (IdToInjectedScriptMap::iterator it = m_idToInjectedScript.begin(); it !
= end; ++it) { | 123 for (IdToInjectedScriptMap::iterator it = m_idToInjectedScript.begin(); it !
= end; ++it) { |
124 ScriptState* scriptState = it->value.scriptState(); | 124 ScriptState* scriptState = it->value.scriptState(); |
125 if (window != scriptState->domWindow()) | 125 if (window != scriptState->domWindow()) |
126 continue; | 126 continue; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 | 174 |
175 int id = injectedScriptIdFor(inspectedScriptState); | 175 int id = injectedScriptIdFor(inspectedScriptState); |
176 ScriptValue injectedScriptValue = createInjectedScript(injectedScriptSource(
), inspectedScriptState, id); | 176 ScriptValue injectedScriptValue = createInjectedScript(injectedScriptSource(
), inspectedScriptState, id); |
177 InjectedScript result(injectedScriptValue, m_inspectedStateAccessCheck); | 177 InjectedScript result(injectedScriptValue, m_inspectedStateAccessCheck); |
178 m_idToInjectedScript.set(id, result); | 178 m_idToInjectedScript.set(id, result); |
179 return result; | 179 return result; |
180 } | 180 } |
181 | 181 |
182 } // namespace WebCore | 182 } // namespace WebCore |
183 | 183 |
OLD | NEW |