예제 #1
0
SocketStreamHandle::SocketStreamHandle(const String& groupName, const KURL& url, SocketStreamHandleClient* client)
    : SocketStreamHandleBase(url, client)
{
    LOG(Network, "SocketStreamHandle %p new client %p", this, m_client);

    // Find a playerId to pass to the platform client. It can be from any page
    // in the PageGroup, since they all share the same network profile and
    // resources.
    PageGroup* pageGroup = PageGroup::pageGroup(groupName);
    ASSERT(pageGroup && !pageGroup->pages().isEmpty());
    Page* page = *(pageGroup->pages().begin());
    ASSERT(page && page->mainFrame());
    int playerId = static_cast<FrameLoaderClientBlackBerry*>(page->mainFrame()->loader()->client())->playerId();

    // Create a platform socket stream
    BlackBerry::Platform::NetworkStreamFactory* factory = page->chrome()->platformPageClient()->networkStreamFactory();
    ASSERT(factory);
    m_socketStream = adoptPtr(factory->createSocketStream(playerId));
    ASSERT(m_socketStream);
    m_socketStream->setListener(this);

    // Open the socket
    BlackBerry::Platform::NetworkRequest request;
    request.setRequestUrl(url.string().latin1().data(), "CONNECT");

    m_socketStream->setRequest(request);

    m_socketStream->streamOpen();
}
예제 #2
0
void PageScriptDebugServer::setJavaScriptPaused(const PageGroup& pageGroup, bool paused)
{
    setMainThreadCallbacksPaused(paused);

    for (auto& page : pageGroup.pages())
        setJavaScriptPaused(page, paused);
}
예제 #3
0
void JavaScriptDebugServer::setJavaScriptPaused(const PageGroup& pageGroup, bool paused)
{
    setMainThreadCallbacksPaused(paused);

    const HashSet<Page*>& pages = pageGroup.pages();

    HashSet<Page*>::const_iterator end = pages.end();
    for (HashSet<Page*>::const_iterator it = pages.begin(); it != end; ++it)
        setJavaScriptPaused(*it, paused);
}
void StorageEventDispatcher::dispatchLocalStorageEventsToFrames(PageGroup& pageGroup, const Vector<RefPtr<Frame>>& frames, const String& key, const String& oldValue, const String& newValue, const String& url, SecurityOrigin* securityOrigin)
{
    const HashSet<Page*>& pages = pageGroup.pages();
    for (HashSet<Page*>::const_iterator it = pages.begin(), end = pages.end(); it != end; ++it)
        InspectorInstrumentation::didDispatchDOMStorageEvent(key, oldValue, newValue, LocalStorage, securityOrigin, *it);

    for (unsigned i = 0; i < frames.size(); ++i) {
        ExceptionCode ec = 0;
        Storage* storage = frames[i]->document()->domWindow()->localStorage(ec);
        if (!ec)
            frames[i]->document()->enqueueWindowEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, url, storage));
    }
}