| 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 // FIXME: Completely broken for OOPI. |
| 109 ScriptState* scriptState = ScriptState::forMainWorld(toLocalFrame(m_insp
ectedPage->mainFrame())); |
| 109 InjectedScript result = injectedScriptManager()->injectedScriptFor(scrip
tState); | 110 InjectedScript result = injectedScriptManager()->injectedScriptFor(scrip
tState); |
| 110 if (result.isEmpty()) | 111 if (result.isEmpty()) |
| 111 *errorString = "Internal error: main world execution context not fou
nd."; | 112 *errorString = "Internal error: main world execution context not fou
nd."; |
| 112 return result; | 113 return result; |
| 113 } | 114 } |
| 114 InjectedScript injectedScript = injectedScriptManager()->injectedScriptForId
(*executionContextId); | 115 InjectedScript injectedScript = injectedScriptManager()->injectedScriptForId
(*executionContextId); |
| 115 if (injectedScript.isEmpty()) | 116 if (injectedScript.isEmpty()) |
| 116 *errorString = "Execution context with given id not found."; | 117 *errorString = "Execution context with given id not found."; |
| 117 return injectedScript; | 118 return injectedScript; |
| 118 } | 119 } |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 if (scriptState->contextIsEmpty() || window == scriptState->domWindow())
{ | 158 if (scriptState->contextIsEmpty() || window == scriptState->domWindow())
{ |
| 158 scriptStatesToRemove.append(scriptState); | 159 scriptStatesToRemove.append(scriptState); |
| 159 m_frontend->executionContextDestroyed(it->value); | 160 m_frontend->executionContextDestroyed(it->value); |
| 160 } | 161 } |
| 161 } | 162 } |
| 162 m_scriptStateToId.removeAll(scriptStatesToRemove); | 163 m_scriptStateToId.removeAll(scriptStatesToRemove); |
| 163 } | 164 } |
| 164 | 165 |
| 165 } // namespace WebCore | 166 } // namespace WebCore |
| 166 | 167 |
| OLD | NEW |