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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
174 for (size_t i = 0; i< isolatedContexts.size(); i++) | 174 for (size_t i = 0; i< isolatedContexts.size(); i++) |
175 notifyContextCreated(frameId, isolatedContexts[i].first, isolatedCon texts[i].second, false); | 175 notifyContextCreated(frameId, isolatedContexts[i].first, isolatedCon texts[i].second, false); |
176 isolatedContexts.clear(); | 176 isolatedContexts.clear(); |
177 } | 177 } |
178 } | 178 } |
179 | 179 |
180 void PageRuntimeAgent::notifyContextCreated(const String& frameId, ScriptState* scriptState, SecurityOrigin* securityOrigin, bool isPageContext) | 180 void PageRuntimeAgent::notifyContextCreated(const String& frameId, ScriptState* scriptState, SecurityOrigin* securityOrigin, bool isPageContext) |
181 { | 181 { |
182 ASSERT(securityOrigin || isPageContext); | 182 ASSERT(securityOrigin || isPageContext); |
183 int executionContextId = injectedScriptManager()->injectedScriptIdFor(script State); | 183 int executionContextId = injectedScriptManager()->injectedScriptIdFor(script State); |
184 String name = securityOrigin ? securityOrigin->toRawString() : ""; | 184 v8::HandleScope handleScope; |
yurys
2013/05/24 04:58:44
We try to avoid using v8 API from the agents direc
| |
185 DOMWrapperWorld* world = DOMWrapperWorld::isolatedWorld(scriptState->context ()); | |
186 String name = world ? world->isolatedWorldHumanReadableName() : ""; | |
187 if (name.isEmpty() && securityOrigin) | |
188 name = securityOrigin->toRawString(); | |
189 | |
185 m_frontend->executionContextCreated(ExecutionContextDescription::create() | 190 m_frontend->executionContextCreated(ExecutionContextDescription::create() |
186 .setId(executionContextId) | 191 .setId(executionContextId) |
187 .setIsPageContext(isPageContext) | 192 .setIsPageContext(isPageContext) |
188 .setName(name) | 193 .setName(name) |
189 .setFrameId(frameId) | 194 .setFrameId(frameId) |
190 .release()); | 195 .release()); |
191 } | 196 } |
192 | 197 |
193 } // namespace WebCore | 198 } // namespace WebCore |
194 | 199 |
OLD | NEW |