本文整理汇总了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 ();
}