Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- src/chrome/renderer/extensions/user_script_slave.cc:79
- UserScriptSlave::GetIsolatedWorldIdForExtension(..)
- // Calls InitializeIsolatedWorld(new_id, extension);
- // Called on two locations:
- // Dynamic executeScript ?
- src/chrome/renderer/extensions/user_script_scheduler.cc
- void UserScriptScheduler::ExecuteCodeImpl(
- int isolated_world_id =
- dispatcher_->user_script_slave()->GetIsolatedWorldIdForExtension(
- extension, child_frame);
- // few lines ahead
- executeScriptInIsolatedWorld( ... )
- // in src/third_party/WebKit/Source/web/WebFrameImpl.cpp
- // WebFrameImpl::executeScriptInIsolatedWorld
- // calls
- // src/third_party/WebKit/Source/bindings/v8/ScriptController.cpp
- ScriptController::executeScriptInIsolatedWorld
- // Initializes:
- V8WindowShell* isolatedWorldShell = windowShell(world.get())
- // V8WindowShell* ScriptController::windowShell(DOMWrapperWorld* world)
- // calls:
- if (!shell->isContextInitialized() && shell->initializeIfNeeded())
- // bool V8WindowShell::initializeIfNeeded()
- // calls
- bool V8WindowShell::initialize()
- // calls
- m_frame->loader().client()->didCreateScriptContext(context, m_world->extensionGroup(), m_world->worldId());
- // ^ ultimately calls Dispatcher::DidCreateScriptContext.
- // From manifest
- src/chrome/renderer/extensions/user_script_slave.cc
- void UserScriptSlave::InjectScripts(WebFrame* frame,
- UserScript::RunLocation location) {
- int isolated_world_id = GetIsolatedWorldIdForExtension(extension, frame);
- // Few lines ahead
- frame->executeScriptInIsolatedWorld(
- isolated_world_id, &sources.front(), sources.size(),
- // Same code path as the other thing
- :set invnumber
Advertisement
Add Comment
Please, Sign In to add comment