Guest User

Untitled

a guest
Feb 19th, 2014
17
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.78 KB | None | 0 0
  1. src/chrome/renderer/extensions/user_script_slave.cc:79
  2.   UserScriptSlave::GetIsolatedWorldIdForExtension(..)
  3.     // Calls InitializeIsolatedWorld(new_id, extension);
  4. // Called on two locations:
  5. // Dynamic executeScript ?
  6. src/chrome/renderer/extensions/user_script_scheduler.cc
  7.   void UserScriptScheduler::ExecuteCodeImpl(
  8.     int isolated_world_id =
  9.       dispatcher_->user_script_slave()->GetIsolatedWorldIdForExtension(
  10.         extension, child_frame);
  11.     // few lines ahead
  12.     executeScriptInIsolatedWorld( ... )
  13.     // in src/third_party/WebKit/Source/web/WebFrameImpl.cpp
  14.     // WebFrameImpl::executeScriptInIsolatedWorld
  15.     // calls
  16.     // src/third_party/WebKit/Source/bindings/v8/ScriptController.cpp
  17.     ScriptController::executeScriptInIsolatedWorld
  18.     // Initializes:
  19.     V8WindowShell* isolatedWorldShell = windowShell(world.get())
  20.     // V8WindowShell* ScriptController::windowShell(DOMWrapperWorld* world)
  21.     // calls:
  22.     if (!shell->isContextInitialized() && shell->initializeIfNeeded())
  23.     // bool V8WindowShell::initializeIfNeeded()
  24.     // calls
  25.     bool V8WindowShell::initialize()
  26.     // calls
  27.     m_frame->loader().client()->didCreateScriptContext(context, m_world->extensionGroup(), m_world->worldId());
  28.     // ^ ultimately calls  Dispatcher::DidCreateScriptContext.
  29. // From manifest
  30. src/chrome/renderer/extensions/user_script_slave.cc
  31.   void UserScriptSlave::InjectScripts(WebFrame* frame,
  32.                                       UserScript::RunLocation location) {
  33.       int isolated_world_id = GetIsolatedWorldIdForExtension(extension, frame);
  34.     // Few lines ahead
  35.     frame->executeScriptInIsolatedWorld(
  36.               isolated_world_id, &sources.front(), sources.size(),
  37.     // Same code path as the other thing
  38. :set invnumber
Advertisement
Add Comment
Please, Sign In to add comment