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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 if (!m_enabled) | 98 if (!m_enabled) |
99 return; | 99 return; |
100 ASSERT(m_frontend); | 100 ASSERT(m_frontend); |
101 String frameId = m_pageAgent->frameId(frame); | 101 String frameId = m_pageAgent->frameId(frame); |
102 addExecutionContextToFrontend(scriptState, false, origin->toRawString(), fra
meId); | 102 addExecutionContextToFrontend(scriptState, false, origin->toRawString(), fra
meId); |
103 } | 103 } |
104 | 104 |
105 InjectedScript PageRuntimeAgent::injectedScriptForEval(ErrorString* errorString,
const int* executionContextId) | 105 InjectedScript PageRuntimeAgent::injectedScriptForEval(ErrorString* errorString,
const int* executionContextId) |
106 { | 106 { |
107 if (!executionContextId) { | 107 if (!executionContextId) { |
108 ScriptState* scriptState = ScriptState::forMainWorld(m_inspectedPage->ma
inFrame()); | 108 ScriptState* scriptState = ScriptState::forMainWorld(m_inspectedPage->de
precatedLocalMainFrame()); |
109 InjectedScript result = injectedScriptManager()->injectedScriptFor(scrip
tState); | 109 InjectedScript result = injectedScriptManager()->injectedScriptFor(scrip
tState); |
110 if (result.isEmpty()) | 110 if (result.isEmpty()) |
111 *errorString = "Internal error: main world execution context not fou
nd."; | 111 *errorString = "Internal error: main world execution context not fou
nd."; |
112 return result; | 112 return result; |
113 } | 113 } |
114 InjectedScript injectedScript = injectedScriptManager()->injectedScriptForId
(*executionContextId); | 114 InjectedScript injectedScript = injectedScriptManager()->injectedScriptForId
(*executionContextId); |
115 if (injectedScript.isEmpty()) | 115 if (injectedScript.isEmpty()) |
116 *errorString = "Execution context with given id not found."; | 116 *errorString = "Execution context with given id not found."; |
117 return injectedScript; | 117 return injectedScript; |
118 } | 118 } |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 if (scriptState->contextIsEmpty() || window == scriptState->domWindow())
{ | 157 if (scriptState->contextIsEmpty() || window == scriptState->domWindow())
{ |
158 scriptStatesToRemove.append(scriptState); | 158 scriptStatesToRemove.append(scriptState); |
159 m_frontend->executionContextDestroyed(it->value); | 159 m_frontend->executionContextDestroyed(it->value); |
160 } | 160 } |
161 } | 161 } |
162 m_scriptStateToId.removeAll(scriptStatesToRemove); | 162 m_scriptStateToId.removeAll(scriptStatesToRemove); |
163 } | 163 } |
164 | 164 |
165 } // namespace WebCore | 165 } // namespace WebCore |
166 | 166 |
OLD | NEW |