Advertisement
Guest User

Untitled

a guest
Aug 7th, 2012
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. void Internals::openDummyInspectorFrontend()
  2. {
  3. Page* page = contextDocument()->frame()->page();
  4.  
  5. if (!page)
  6. return false;
  7.  
  8. Page::PageClients pc;
  9. fillWithEmptyClients(pc);
  10.  
  11. m_frontendPage = adoptPtr(new Page(pc));
  12.  
  13. RefPtr<Frame> mainFrame = Frame::create(m_frontendPage.get(), 0, new EmptyFrameLoaderClient());
  14.  
  15. PassRefPtr<FrameView> frameView = FrameView::create(mainFrame.get());
  16. mainFrame->setView(frameView);
  17.  
  18. mainFrame->init();
  19.  
  20. KURL inspectorProtocolVerifierURL( WebCore::ParsedURLString, "http://localhost:8000/inspector-protocol/resources/inspector-protocol.html");
  21.  
  22. m_frontendPage->mainFrame()->loader()->load(ResourceRequest(inspectorProtocolVerifierURL), false);
  23.  
  24. OwnPtr<InspectorFrontendClientDummy> frontendClient = adoptPtr(new InspectorFrontendClientDummy(page->inspectorController(), page, adoptPtr(new InspectorFrontendClientLocal::Settings())));
  25.  
  26. m_frontendPage->inspectorController()->setInspectorFrontendClient(frontendClient.release());
  27.  
  28. InspectorFrontendChannelDummy* channel = new InspectorFrontendChannelDummy(m_frontendPage.get());
  29.  
  30. m_frontendPage->inspectorController()->connectFrontend(channel);
  31. return true;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement