当前位置: 首页>>代码示例>>C++>>正文


C++ Application::IsRunningOutOfBrowser方法代码示例

本文整理汇总了C++中Application::IsRunningOutOfBrowser方法的典型用法代码示例。如果您正苦于以下问题:C++ Application::IsRunningOutOfBrowser方法的具体用法?C++ Application::IsRunningOutOfBrowser怎么用?C++ Application::IsRunningOutOfBrowser使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Application的用法示例。


在下文中一共展示了Application::IsRunningOutOfBrowser方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Uri

void
HttpRequest::Open (const char *verb, Uri *uri, DownloaderAccessPolicy policy)
{
    Surface *surface;
    Application *application;
    const char *source_location;
    Uri *src_uri = NULL;

    VERIFY_MAIN_THREAD;
    LOG_DOWNLOADER ("HttpRequest::Open (%s, %p = %s, %i)\n", verb, uri, uri == NULL ? NULL : uri->ToString (), policy);

    g_free (this->verb);
    delete original_uri;
    g_free (this->uri);

    this->verb = g_strdup (verb);
    this->original_uri = new Uri (*uri);
    this->uri = uri->ToString ();

    access_policy = policy;

    surface = GetDeployment ()->GetSurface ();
    application = GetDeployment ()->GetCurrentApplication ();

    if (application->IsRunningOutOfBrowser ()) {
        source_location = surface->GetSourceLocation ();
    } else {
        source_location = GetDeployment ()->GetXapLocation ();
        if (source_location == NULL)
            source_location = surface->GetSourceLocation ();
    }

    // FIXME: ONLY VALIDATE IF USED FROM THE PLUGIN
    if (!Downloader::ValidateDownloadPolicy (source_location, uri, policy)) {
        LOG_DOWNLOADER ("HttpRequest::Open (): aborting due to security policy violation\n");
        Failed ("Security Policy Violation");
        Abort ();
        return;
    }

    /* Make the uri we request to the derived http request an absolute uri */
    if (!uri->isAbsolute && source_location) {
        src_uri = new Uri ();
        if (!src_uri->Parse (source_location, true)) {
            Failed ("Could not parse source location");
            delete src_uri;
            return;
        }

        src_uri->Combine (uri);
        g_free (this->uri);
        this->uri = src_uri->ToString ();
        delete src_uri;
        LOG_DOWNLOADER ("HttpRequest::Open (%s, %p = %s, %i) Url was absolutified to '%s' using source location '%s'\n", verb, uri, uri == NULL ? NULL : uri->ToString (), policy, this->uri, source_location);
    }

    OpenImpl ();
}
开发者ID:,项目名称:,代码行数:58,代码来源:


注:本文中的Application::IsRunningOutOfBrowser方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。