| 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 FrameConsole::mute(); | 145 FrameConsole::mute(); |
| 146 } | 146 } |
| 147 | 147 |
| 148 void PageRuntimeAgent::unmuteConsole() | 148 void PageRuntimeAgent::unmuteConsole() |
| 149 { | 149 { |
| 150 FrameConsole::unmute(); | 150 FrameConsole::unmute(); |
| 151 } | 151 } |
| 152 | 152 |
| 153 void PageRuntimeAgent::reportExecutionContextCreation() | 153 void PageRuntimeAgent::reportExecutionContextCreation() |
| 154 { | 154 { |
| 155 Vector<std::pair<ScriptState*, SecurityOrigin*> > isolatedContexts; | 155 Vector<std::pair<ScriptState*, SecurityOrigin*>> isolatedContexts; |
| 156 for (Frame* frame = m_inspectedPage->mainFrame(); frame; frame = frame->tree
().traverseNext()) { | 156 for (Frame* frame = m_inspectedPage->mainFrame(); frame; frame = frame->tree
().traverseNext()) { |
| 157 if (!frame->isLocalFrame()) | 157 if (!frame->isLocalFrame()) |
| 158 continue; | 158 continue; |
| 159 LocalFrame* localFrame = toLocalFrame(frame); | 159 LocalFrame* localFrame = toLocalFrame(frame); |
| 160 if (!localFrame->script().canExecuteScripts(NotAboutToExecuteScript)) | 160 if (!localFrame->script().canExecuteScripts(NotAboutToExecuteScript)) |
| 161 continue; | 161 continue; |
| 162 String frameId = m_pageAgent->frameId(localFrame); | 162 String frameId = m_pageAgent->frameId(localFrame); |
| 163 | 163 |
| 164 // Ensure execution context is created. | 164 // Ensure execution context is created. |
| 165 // If initializeMainWorld returns true, then is registered by didCreateS
criptContext | 165 // If initializeMainWorld returns true, then is registered by didCreateS
criptContext |
| 166 if (!localFrame->script().initializeMainWorld()) | 166 if (!localFrame->script().initializeMainWorld()) |
| 167 addExecutionContextToFrontend(ScriptState::forMainWorld(localFrame),
true, "", frameId); | 167 addExecutionContextToFrontend(ScriptState::forMainWorld(localFrame),
true, "", frameId); |
| 168 localFrame->script().collectIsolatedContexts(isolatedContexts); | 168 localFrame->script().collectIsolatedContexts(isolatedContexts); |
| 169 if (isolatedContexts.isEmpty()) | 169 if (isolatedContexts.isEmpty()) |
| 170 continue; | 170 continue; |
| 171 for (const auto& pair : isolatedContexts) { | 171 for (const auto& pair : isolatedContexts) { |
| 172 String originString = pair.second ? pair.second->toRawString() : ""; | 172 String originString = pair.second ? pair.second->toRawString() : ""; |
| 173 addExecutionContextToFrontend(pair.first, false, originString, frame
Id); | 173 addExecutionContextToFrontend(pair.first, false, originString, frame
Id); |
| 174 } | 174 } |
| 175 isolatedContexts.clear(); | 175 isolatedContexts.clear(); |
| 176 } | 176 } |
| 177 } | 177 } |
| 178 | 178 |
| 179 } // namespace blink | 179 } // namespace blink |
| 180 | 180 |
| OLD | NEW |