Exemplo n.º 1
0
PRBool
historyUnassert (RDFT hst,  RDF_Resource u, RDF_Resource s, void* v, 
		       RDF_ValueType type)
{
  if ((type == RDF_RESOURCE_TYPE) && (resourceType((RDF_Resource)v) == HISTORY_RT) &&
      (s == gCoreVocab->RDF_parent)) {
    RDF_Resource parents[5];
    int8 n = 0;
    Assertion as = u->rarg1;
	memset(parents, '\0', 5 * sizeof(RDF_Resource));
    while (as) {
      if ((as->type == RDF_RESOURCE_TYPE) && (as->s == gCoreVocab->RDF_parent) && 
	  (resourceType((RDF_Resource)as->value) == HISTORY_RT) && (n < 5)) {
	parents[n++] = (RDF_Resource)as->value;
      }
      as = as->next;
    }
    GH_DeleteHistoryItem ( resourceID(u));
    while (n > 0) {
		n = n - 1;
		if (parents[n]) {
		    Assertion nas = remoteStoreRemove (gRemoteStore, u, gCoreVocab->RDF_parent, 
			     parents[n], RDF_RESOURCE_TYPE);
			freeMem(nas);
		} 
    }
    return 1;
  }
  return 0;
}
 Component* ComAudioReader::createComAudioWithFlatBuffers(const flatbuffers::Table *comAudioOptions)
 {
     auto options = (ComAudioOptions*)comAudioOptions;
     
     Component* component = ComAudio::create();
     ComAudio* audio = static_cast<ComAudio*>(component);
     
     auto fileNameData = options->fileNameData();
     
     int resourceType = fileNameData->resourceType();
     switch (resourceType)
     {
         case 0:
         {
             std::string path = fileNameData->path()->c_str();
             audio->setFile(path.c_str());
             break;
         }
             
         default:
             break;
     }
     
     bool loop = options->loop() != 0;
     audio->setLoop(loop);
     
     audio->setName(options->name()->c_str());
     
     return component;
 }
Exemplo n.º 3
0
void *QWindowsNativeInterface::nativeResourceForWindow(const QByteArray &resource, QWindow *window)
{
    if (!window || !window->handle()) {
        qWarning("%s: '%s' requested for null window or window without handle.", __FUNCTION__, resource.constData());
        return 0;
    }
    QWindowsWindow *bw = static_cast<QWindowsWindow *>(window->handle());
    int type = resourceType(resource);
    if (type == HandleType)
        return bw->handle();
    switch (window->surfaceType()) {
    case QWindow::RasterSurface:
    case QWindow::RasterGLSurface:
        if (type == GetDCType)
            return bw->getDC();
        if (type == ReleaseDCType) {
            bw->releaseDC();
            return 0;
        }
        break;
    case QWindow::OpenGLSurface:
    case QWindow::OpenVGSurface:
        break;
    case QWindow::VulkanSurface:
#if QT_CONFIG(vulkan)
        if (type == VkSurface)
            return bw->surface(nullptr, nullptr); // returns the address of the VkSurfaceKHR, not the value, as expected
#endif
        break;
    }
    qWarning("%s: Invalid key '%s' requested.", __FUNCTION__, resource.constData());
    return 0;
}
void *QWindowsNativeInterface::nativeResourceForWindow(const QByteArray &resource, QWindow *window)
{
    if (!window || !window->handle()) {
        qWarning("%s: '%s' requested for null window or window without handle.", __FUNCTION__, resource.constData());
        return 0;
    }
    QWindowsWindow *bw = static_cast<QWindowsWindow *>(window->handle());
    int type = resourceType(resource);
    if (type == HandleType)
        return bw->handle();
    switch (window->surfaceType()) {
    case QWindow::RasterSurface:
    case QWindow::RasterGLSurface:
        if (type == GetDCType)
            return bw->getDC();
        if (type == ReleaseDCType) {
            bw->releaseDC();
            return 0;
        }
        break;
    case QWindow::OpenGLSurface:
        break;
    }
    qWarning("%s: Invalid key '%s' requested.", __FUNCTION__, resource.constData());
    return 0;
}
Exemplo n.º 5
0
void
PopGetNewMail (RDF_Resource r)
{
  if (containerp(r) && (resourceType(r) == PM_RT)) {
    MF folder = (MF) r->pdata;
    GetPopToRDF(folder->rdf);
  }
}
Exemplo n.º 6
0
PRBool
pmRemove (RDFT rdf, RDF_Resource u, RDF_Resource s, void* v, RDF_ValueType type)
{
  XP_ASSERT( (RDF_STRING_TYPE != type) || ( IsUTF8String((const char* )v)));
  if ((startsWith("mailbox://", rdf->url)) && (resourceType(u) == PM_RT) && (s == gCoreVocab->RDF_parent)
      && (type == RDF_RESOURCE_TYPE)) {
    RDF_Resource mbox = (RDF_Resource) v;
    if (!(containerp(mbox) && (resourceType(mbox) == PM_RT))) {
      return false;
    } else {
      MF folder = (MF)mbox->pdata;
      sendNotifications2(rdf, RDF_DELETE_NOTIFY, u, s, v, type, 1);
      MoveMessage(folder->trash, resourceID(mbox), (MM)u->pdata);
      return 1;
    }
  } else return false;
}
Exemplo n.º 7
0
void
possiblyAccessES(RDFT rdf, RDF_Resource u, RDF_Resource s, PRBool inversep)
{
   if ((ESFTPRT(u)) && 
       (s == gCoreVocab->RDF_parent) && (containerp(u))) {
     char* id =  resourceID(u);
     readRDFFile((resourceType(u) == ES_RT ? &id[4] : id), u, false);
   }
}
Exemplo n.º 8
0
void
es_GetUrlExitFunc (URL_Struct *urls, int status, MWContext *cx)
{
	RDF_Resource		parent = NULL, child = NULL, r;
	_esFEData		*feData;
	char			*newURL, *p;

	feData = (_esFEData *)urls->fe_data;
	if ((status >= 0) && (feData != NULL))
	{
		parent = RDF_GetResource(gNCDB, feData->parent, false);
		child = RDF_GetResource(gNCDB, feData->child, false);
		if ((parent != NULL) && (child != NULL))
		{
			switch(feData->method)
			{
				case	URL_POST_METHOD:
				if (((p = strrchr(resourceID(child), '/')) != NULL) && (*++p != '\0'))
				{
					if ((newURL = append2Strings(resourceID(parent), p)) != NULL)
					{
						if ((r = RDF_GetResource(gNCDB, newURL, 1)) != NULL)
						{
							setContainerp(r, containerp(child));
							setResourceType(r, resourceType(child));
						
							remoteStoreAdd(gRemoteStore, r,
								gCoreVocab->RDF_parent, parent,
								RDF_RESOURCE_TYPE, 1);
						}
						freeMem(newURL);
					}
				}
				break;

				case	URL_DELETE_METHOD:
				remoteStoreRemove(gRemoteStore, child,
					gCoreVocab->RDF_parent, parent,
					RDF_RESOURCE_TYPE);
				break;
			}
		}
	}
	else if (status < 0)
	{
		if ((cx != NULL) && (urls != NULL) && (urls->error_msg != NULL))
		{
			FE_Alert(cx, urls->error_msg);
		}
	}
	if (feData != NULL)
	{
		esFreeFEData(feData);
	}
        NET_FreeURLStruct (urls);
}
Exemplo n.º 9
0
PRBool
historyStoreHasAssertion (RDFT mcf, RDF_Resource u, RDF_Resource s, void* v, RDF_ValueType type, PRBool tv)
{
  if ((s == gCoreVocab->RDF_parent) && (type == RDF_RESOURCE_TYPE) && (resourceType((RDF_Resource)v) == HISTORY_RT))
    {
      remoteStoreHasAssertionInt(mcf, u, s, v, type, tv);
    } else {
      return 0;
    }
}
Exemplo n.º 10
0
RDF_Cursor
historyStoreGetSlotValuesInt (RDFT mcf, RDF_Resource u, RDF_Resource s, RDF_ValueType type,  
					 PRBool inversep, PRBool tv)
{
    if ((type == RDF_RESOURCE_TYPE) && (resourceType(u) == HISTORY_RT) && inversep &&
	(s == gCoreVocab->RDF_parent)) {
      return remoteStoreGetSlotValuesInt(mcf, u, s, type, inversep, tv);
    } else {
      return NULL;
    }
}
Exemplo n.º 11
0
void CResourceListDoc::ShowResourceType(ResourceType iType)
{
    if (iType != _shownResourceType)
    {
        char sz[200];
        StringCchPrintf(sz, ARRAYSIZE(sz), "Setting to type %x\n", iType);
        OutputDebugString(sz);
        _shownResourceType = iType;
        CResourceTypeWrap resourceType(iType);
        UpdateAllViewsAndNonViews(NULL, VIEWUPDATEHINT_SHOWRESOURCETYPE, &resourceType);
    }
}
Exemplo n.º 12
0
void
parseNextESFTPLine (RDFFile f, char* line)
{
  int16 i1, i2;
  char url[100];
  RDF_Resource ru;
  PRBool directoryp;
   
  if (f->fileType == FTP_RT) {
	  if (!startsWith("201", line)) return;
	  line = &line[5];
  }
  i1 = charSearch(' ', line);
  if (i1 == -1) return;
  i2 = charSearch(' ', &line[i1+1]) + i1 + 1;
  line[i1] = '\0';
  directoryp = 0;
  if (strlen(line) > 64) return;
  if (resourceType(f->top) == ES_RT) {
    directoryp = startsWith("Director", &line[i1+1]);
     sprintf(url, "nes:%s%s%s", f->url, line, (directoryp ? "/" : ""));
  } else {
    int i3 = charSearch(' ', &line[i1+i2+1]);
    directoryp = startsWith("Directory", &line[i1+i2+i3+2]);

/* this is bad as files can be of zero-length!
    if ((charSearch('.', line) ==-1) && (startsWith("0", &line[i1+1]))) directoryp = 1;
*/

    sprintf(url, "%s%s%s", f->url, line, (directoryp ? "/" : ""));
   }
  ru = RDF_GetResource(NULL, url, 1);
  setResourceType(ru, resourceType(f->top));
  if (directoryp) setContainerp(ru, 1);
/*
  remoteStoreAdd(gRemoteStore, ru, gCoreVocab->RDF_name, NET_UnEscape(line), RDF_STRING_TYPE, 1);
*/
  remoteStoreAdd(gRemoteStore, ru, gCoreVocab->RDF_parent, f->top, RDF_RESOURCE_TYPE, 1);
}
void *QEGLPlatformIntegration::nativeResourceForIntegration(const QByteArray &resource)
{
    void *result = 0;

    switch (resourceType(resource)) {
    case EglDisplay:
        result = m_screen->display();
        break;
    default:
        break;
    }

    return result;
}
void *QEGLPlatformIntegration::nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context)
{
    void *result = 0;

    switch (resourceType(resource)) {
    case EglContext:
        if (context->handle())
            result = static_cast<QEGLPlatformContext *>(context->handle())->eglContext();
        break;
    default:
        break;
    }

    return result;
}
Exemplo n.º 15
0
void *EglFSIntegration::nativeResourceForScreen(const QByteArray &resource, QScreen *)
{
    void *result = 0;

    switch (resourceType(resource)) {
    case XlibDisplay:
        // Play nice when using the x11 hooks: Be compatible with xcb that allows querying
        // the X Display pointer, which is nothing but our native display.
        result = reinterpret_cast<void*>(nativeDisplay());
        break;
    default:
        break;
    }

    return result;
}
Exemplo n.º 16
0
void *QEGLPlatformIntegration::nativeResourceForIntegration(const QByteArray &resource)
{
    void *result = 0;

    switch (resourceType(resource)) {
    case EglDisplay:
        result = display();
        break;
    case NativeDisplay:
        result = reinterpret_cast<void*>(nativeDisplay());
        break;
    default:
        break;
    }

    return result;
}
Exemplo n.º 17
0
void *
pmGetSlotValue (RDFT rdf, RDF_Resource u, RDF_Resource s, RDF_ValueType type, 
                PRBool inversep,  PRBool tv)
{
  if ((resourceType(u) == PM_RT) && tv && (!inversep) && (type == RDF_STRING_TYPE) && (u->pdata)) {
    MM msg = (MM) u->pdata;
    if (s == gNavCenter->from) {
      XP_ASSERT( (RDF_STRING_TYPE != type) || ( IsUTF8String((const char* )msg->from)));
      return copyString(msg->from);
    } else if (s == gNavCenter->subject) {
      XP_ASSERT( (RDF_STRING_TYPE != type) || ( IsUTF8String((const char* )msg->subject)));
      return copyString(msg->subject);
    } else if (s == gNavCenter->date) {
      return copyString(msg->date);
    } else return NULL;
  } else return NULL;
}
Exemplo n.º 18
0
void SVGResource::addClient(SVGStyledElement* item)
{
    if (m_clients.contains(item))
        return;

    m_clients.add(item);

    ResourceSet* target = clientMap().get(item);
    if (!target) 
        target = new ResourceSet;

    SVGResourceType type = resourceType();
    if (SVGResource* oldResource = target->resources[type])
        oldResource->m_clients.remove(item);

    target->resources[type] = this;
    clientMap().set(item, target);
}
Exemplo n.º 19
0
void *QXcbNativeInterface::nativeResourceForIntegration(const QByteArray &resourceString)
{
    void *result = 0;
    switch (resourceType(resourceString)) {
    case StartupId:
        result = startupId();
        break;
    case X11Screen:
        result = x11Screen();
        break;
    case RootWindow:
        result = rootWindow();
        break;
    default:
        break;
    }

    return result;
}
Exemplo n.º 20
0
void LayoutSVGResourceContainer::registerResource()
{
    SVGDocumentExtensions& extensions = svgExtensionsFromElement(element());
    if (!extensions.hasPendingResource(m_id)) {
        extensions.addResource(m_id, this);
        return;
    }

    SVGDocumentExtensions::SVGPendingElements* clients(extensions.removePendingResource(m_id));

    // Cache us with the new id.
    extensions.addResource(m_id, this);

    // Update cached resources of pending clients.
    for (const auto& pendingClient : *clients) {
        ASSERT(pendingClient->hasPendingResources());
        extensions.clearHasPendingResourcesIfPossible(pendingClient);
        LayoutObject* layoutObject = pendingClient->layoutObject();
        if (!layoutObject)
            continue;

        const ComputedStyle& style = layoutObject->styleRef();

        // If the client has a layer (is a non-SVGElement) we need to signal
        // invalidation in the same way as is done in markAllResourceClientsForInvalidation above.
        if (layoutObject->hasLayer() && resourceType() == FilterResourceType) {
            if (style.hasFilter())
                toLayoutBoxModelObject(layoutObject)->layer()->filterNeedsPaintInvalidation();
            // If this is the SVG root, we could have both 'filter' and
            // '-webkit-filter' applied, so we need to do the invalidation
            // below as well, unless we can optimistically determine that
            // 'filter' does not apply to the element in question.
            if (!layoutObject->isSVGRoot() || !style.svgStyle().hasFilter())
                continue;
        }

        StyleDifference diff;
        diff.setNeedsFullLayout();
        SVGResourcesCache::clientStyleChanged(layoutObject, diff, style);
        layoutObject->setNeedsLayoutAndFullPaintInvalidation(LayoutInvalidationReason::SvgResourceInvalidated);
    }
}
Exemplo n.º 21
0
RDF_Cursor
pmGetSlotValues (RDFT rdf, RDF_Resource u, RDF_Resource s, RDF_ValueType type, 
                 PRBool inversep,  PRBool tv)
{
  if ((resourceType(u) == PM_RT) && tv && (inversep) && (type == RDF_RESOURCE_TYPE)
      && (s == gCoreVocab->RDF_parent)) {
    MF folder = (MF)rdf->pdata;
    if (folder->top == u) {
      RDF_Cursor c = (RDF_Cursor)getMem(sizeof(struct RDF_CursorStruct));
      c->u = u;
      c->s = s;
      c->type = type;
      c->inversep = inversep;
      c->tv = tv;
      c->count = 0;
      c->pdata = folder->msg;
      return c;
    } else return NULL;
  } else return NULL;
}
Exemplo n.º 22
0
void *EglFSIntegration::nativeResourceForIntegration(const QByteArray &resource)
{
    void *result = 0;

    switch (resourceType(resource)) {
    case EglDisplay:
        result = display();
        break;
    case NativeDisplay:
        result = reinterpret_cast<void*>(nativeDisplay());
        break;
    case WaylandDisplay:
        result = egl_device_integration()->wlDisplay();
        break;
    default:
        break;
    }

    return result;
}
Exemplo n.º 23
0
void *EglFSIntegration::nativeResourceForWindow(const QByteArray &resource, QWindow *window)
{
    void *result = 0;

    switch (resourceType(resource)) {
    case EglDisplay:
        if (window && window->handle())
            result = static_cast<EglFSScreen *>(window->handle()->screen())->display();
        else
            result = display();
        break;
    case EglWindow:
        if (window && window->handle())
            result = reinterpret_cast<void*>(static_cast<EglFSWindow *>(window->handle())->eglWindow());
        break;
    default:
        break;
    }

    return result;
}
Exemplo n.º 24
0
void *QXcbNativeInterface::nativeResourceForScreen(const QByteArray &resource, QScreen *screen)
{
    void *result = 0;
    const QXcbScreen *xcbScreen = static_cast<QXcbScreen *>(screen->handle());
    switch (resourceType(resource)) {
    case Display:
#ifdef XCB_USE_XLIB
        result = xcbScreen->connection()->xlib_display();
#endif
        break;
    case AppTime:
        result = appTime(xcbScreen);
        break;
    case AppUserTime:
        result = appUserTime(xcbScreen);
        break;
    case ScreenHintStyle:
        result = reinterpret_cast<void *>(xcbScreen->hintStyle() + 1);
        break;
    case ScreenSubpixelType:
        result = reinterpret_cast<void *>(xcbScreen->subpixelType() + 1);
        break;
    case ScreenAntialiasingEnabled:
        result = reinterpret_cast<void *>(xcbScreen->antialiasingEnabled() + 1);
        break;
    case TrayWindow:
        if (QXcbSystemTrayTracker *s = systemTrayTracker(screen))
            result = (void *)quintptr(s->trayWindow());
        break;
    case GetTimestamp:
        result = getTimestamp(xcbScreen);
        break;
    case NoFontHinting:
        result = xcbScreen->noFontHinting() ? this : 0; //qboolptr...
        break;
    default:
        break;
    }
    return result;
}
Exemplo n.º 25
0
void *QXcbNativeInterface::nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context)
{
    void *result = 0;
    switch (resourceType(resourceString)) {
    case EglContext:
        result = eglContextForContext(context);
        break;
    case EglConfig:
        result = eglConfigForContext(context);
        break;
    case GLXConfig:
        result = glxConfigForContext(context);
        break;
    case GLXContext:
        result = glxContextForContext(context);
        break;
    default:
        break;
    }

    return result;
}
Exemplo n.º 26
0
void *QXcbNativeInterface::nativeResourceForWindow(const QByteArray &resourceString, QWindow *window)
{
    void *result = 0;
    switch (resourceType(resourceString)) {
    case Display:
        result = displayForWindow(window);
        break;
    case EglDisplay:
        result = eglDisplayForWindow(window);
        break;
    case Connection:
        result = connectionForWindow(window);
        break;
    case Screen:
        result = screenForWindow(window);
        break;
    default:
        break;
    }

    return result;
}
Exemplo n.º 27
0
void *EglFSIntegration::nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context)
{
    void *result = 0;

    switch (resourceType(resource)) {
    case EglContext:
        if (context->handle())
            result = static_cast<EglFSContext *>(context->handle())->eglContext();
        break;
    case EglConfig:
        if (context->handle())
            result = static_cast<EglFSContext *>(context->handle())->eglConfig();
        break;
    case EglDisplay:
        if (context->handle())
            result = static_cast<EglFSContext *>(context->handle())->eglDisplay();
        break;
    default:
        break;
    }

    return result;
}
Exemplo n.º 28
0
PRBool
ESFTPRT (RDF_Resource u)
{
  return ((resourceType(u) == ES_RT) ||
	  (resourceType(u) == FTP_RT));
}
void QtWebEngineUrlRequestInterceptor::interceptRequest(QWebEngineUrlRequestInfo &request)
{
	if (!m_areImagesEnabled && request.resourceType() == QWebEngineUrlRequestInfo::ResourceTypeImage)
	{
		request.block(true);

		return;
	}

	if (!m_contentBlockingProfiles.contains(request.firstPartyUrl().host()))
	{
		if (SettingsManager::getOption(SettingsManager::ContentBlocking_EnableContentBlockingOption, request.firstPartyUrl()).toBool())
		{
			m_contentBlockingProfiles[request.firstPartyUrl().host()] = ContentBlockingManager::getProfileList(SettingsManager::getOption(SettingsManager::ContentBlocking_ProfilesOption, request.firstPartyUrl()).toStringList());
		}
		else
		{
			m_contentBlockingProfiles[request.firstPartyUrl().host()] = QVector<int>();
		}
	}

	const QVector<int> contentBlockingProfiles(m_contentBlockingProfiles.value(request.firstPartyUrl().host()));

	if (contentBlockingProfiles.isEmpty())
	{
		const NetworkManagerFactory::DoNotTrackPolicy doNotTrackPolicy(NetworkManagerFactory::getDoNotTrackPolicy());

		if (doNotTrackPolicy != NetworkManagerFactory::SkipTrackPolicy)
		{
			request.setHttpHeader(QStringLiteral("DNT").toLatin1(), ((doNotTrackPolicy == NetworkManagerFactory::DoNotAllowToTrackPolicy) ? QStringLiteral("1") : QStringLiteral("0")).toLatin1());
		}

		return;
	}

	NetworkManager::ResourceType resourceType(NetworkManager::OtherType);
	bool storeBlockedUrl(true);

	switch (request.resourceType())
	{
		case QWebEngineUrlRequestInfo::ResourceTypeMainFrame:
			resourceType = NetworkManager::MainFrameType;

			break;
		case QWebEngineUrlRequestInfo::ResourceTypeSubFrame:
			resourceType = NetworkManager::SubFrameType;

			break;
		case QWebEngineUrlRequestInfo::ResourceTypeStylesheet:
			resourceType = NetworkManager::StyleSheetType;
			storeBlockedUrl = false;

			break;
		case QWebEngineUrlRequestInfo::ResourceTypeScript:
			resourceType = NetworkManager::ScriptType;
			storeBlockedUrl = false;

			break;
		case QWebEngineUrlRequestInfo::ResourceTypeImage:
			resourceType = NetworkManager::ImageType;

			break;
		case QWebEngineUrlRequestInfo::ResourceTypeObject:
		case QWebEngineUrlRequestInfo::ResourceTypeMedia:
			resourceType = NetworkManager::ObjectType;

			break;
#if QT_VERSION >= 0x050700
		case QWebEngineUrlRequestInfo::ResourceTypePluginResource:
			resourceType = NetworkManager::ObjectSubrequestType;
			storeBlockedUrl = false;

			break;
#endif
		case QWebEngineUrlRequestInfo::ResourceTypeXhr:
			resourceType = NetworkManager::XmlHttpRequestType;

			break;
		default:
			break;
	}

	const ContentBlockingManager::CheckResult result(ContentBlockingManager::checkUrl(contentBlockingProfiles, request.firstPartyUrl(), request.requestUrl(), resourceType));

	if (result.isBlocked)
	{
		if (storeBlockedUrl && !m_blockedElements.value(request.firstPartyUrl().host()).contains(request.requestUrl().url()))
		{
			m_blockedElements[request.firstPartyUrl().host()].append(request.requestUrl().url());
		}

		Console::addMessage(QCoreApplication::translate("main", "Request blocked with rule: %1").arg(result.rule), Console::NetworkCategory, Console::LogLevel, request.requestUrl().toString(), -1);

		request.block(true);
	}
}
void QtWebEngineUrlRequestInterceptor::interceptRequest(QWebEngineUrlRequestInfo &request)
{
	if (!m_contentBlockingProfiles.contains(request.firstPartyUrl().host()))
	{
		m_contentBlockingProfiles[request.firstPartyUrl().host()] = ContentBlockingManager::getProfileList(SettingsManager::getValue(QLatin1String("Content/BlockingProfiles"), request.firstPartyUrl()).toStringList());
	}

	const QVector<int> contentBlockingProfiles(m_contentBlockingProfiles.value(request.firstPartyUrl().host()));

	if (contentBlockingProfiles.isEmpty())
	{
		const NetworkManagerFactory::DoNotTrackPolicy doNotTrackPolicy(NetworkManagerFactory::getDoNotTrackPolicy());

		if (doNotTrackPolicy != NetworkManagerFactory::SkipTrackPolicy)
		{
			request.setHttpHeader(QStringLiteral("DNT").toLatin1(), ((doNotTrackPolicy == NetworkManagerFactory::DoNotAllowToTrackPolicy) ? QStringLiteral("1") : QStringLiteral("0")).toLatin1());
		}

		return;
	}

	ContentBlockingManager::ResourceType resourceType(ContentBlockingManager::OtherType);

	switch (request.resourceType())
	{
		case QWebEngineUrlRequestInfo::ResourceTypeMainFrame:
			resourceType = ContentBlockingManager::MainFrameType;

			break;
		case QWebEngineUrlRequestInfo::ResourceTypeSubFrame:
			resourceType = ContentBlockingManager::SubFrameType;

			break;
		case QWebEngineUrlRequestInfo::ResourceTypeStylesheet:
			resourceType = ContentBlockingManager::StyleSheetType;

			break;
		case QWebEngineUrlRequestInfo::ResourceTypeScript:
			resourceType = ContentBlockingManager::ScriptType;

			break;
		case QWebEngineUrlRequestInfo::ResourceTypeImage:
			resourceType = ContentBlockingManager::ImageType;

			break;
		case QWebEngineUrlRequestInfo::ResourceTypeObject:
		case QWebEngineUrlRequestInfo::ResourceTypeMedia:
			resourceType = ContentBlockingManager::ObjectType;

			break;
		case QWebEngineUrlRequestInfo::ResourceTypeXhr:
			resourceType = ContentBlockingManager::XmlHttpRequestType;

			break;
		default:
			break;
	}

	const ContentBlockingManager::CheckResult result(ContentBlockingManager::checkUrl(contentBlockingProfiles, request.firstPartyUrl(), request.requestUrl(), resourceType));

	if (result.isBlocked)
	{
		Console::addMessage(QCoreApplication::translate("main", "Blocked request"), Otter::NetworkMessageCategory, LogMessageLevel, request.requestUrl().toString(), -1);

		request.block(true);
	}
}