//SanJose++ void swapPlugin(RenderWidget* renderer, bool isFocused) { //SanJose-- typedef FrameLoaderClientAndroid FLCA; FLCA* client = static_cast<FLCA*>(m_parent->loader()->client()); client->enableOnDemandPlugins(); WTF::PassRefPtr<PluginView> prpWidget = PluginView::create(m_parent.get(), m_size, m_element, m_url, m_paramNames, m_paramValues, m_mimeType, m_loadManually); RefPtr<Widget> myProtector(this); //SanJose++ //When on demand is on and flash is loaded by clicking the PluginToggleWidget, sroll deost work //on flash objects. //ex: aftonbladet.se. This happens because when the flash is selected for download, ALL flash //objects are set to be focused through the following API. None of flash objects is set to be //focused (due to no selection) when "always on" is enabled, in which case scroll has no problem. //FIX: Only set focus for the flash object user explicitly selected when flash is downloaded manually. if (isFocused) { prpWidget->focusPluginElement(); } //SanJose-- renderer->setWidget(prpWidget); }
void Loader::Host::didFinishLoading(SubresourceLoader* loader) { RefPtr<Host> myProtector(this); RequestMap::iterator i = m_requestsLoading.find(loader); if (i == m_requestsLoading.end()) return; Request* request = i->second; m_requestsLoading.remove(i); DocLoader* docLoader = request->docLoader(); // Prevent the document from being destroyed before we are done with // the docLoader that it will delete when the document gets deleted. RefPtr<Document> protector(docLoader->doc()); if (!request->isMultipart()) docLoader->decrementRequestCount(); CachedResource* resource = request->cachedResource(); ASSERT(!resource->resourceToRevalidate()); // If we got a 4xx response, we're pretending to have received a network // error, so we can't send the successful data() and finish() callbacks. if (!resource->errorOccurred()) { docLoader->setLoadInProgress(true); resource->data(loader->resourceData(), true); resource->finish(); } delete request; docLoader->setLoadInProgress(false); docLoader->checkForPendingPreloads(); #if REQUEST_DEBUG KURL u(ParsedURLString, resource->url()); printf("HOST %s COUNT %d RECEIVED %s\n", u.host().latin1().data(), m_requestsLoading.size(), resource->url().latin1().data()); #endif servePendingRequests(); }
void Loader::Host::didFail(SubresourceLoader* loader, bool cancelled) { RefPtr<Host> myProtector(this); loader->clearClient(); RequestMap::iterator i = m_requestsLoading.find(loader); if (i == m_requestsLoading.end()) return; Request* request = i->second; m_requestsLoading.remove(i); DocLoader* docLoader = request->docLoader(); // Prevent the document from being destroyed before we are done with // the docLoader that it will delete when the document gets deleted. RefPtr<Document> protector(docLoader->doc()); if (!request->isMultipart()) docLoader->decrementRequestCount(); CachedResource* resource = request->cachedResource(); if (resource->resourceToRevalidate()) cache()->revalidationFailed(resource); if (!cancelled) { docLoader->setLoadInProgress(true); resource->error(); } docLoader->setLoadInProgress(false); if (cancelled || !resource->isPreloaded()) cache()->remove(resource); delete request; docLoader->checkForPendingPreloads(); servePendingRequests(); }