本文整理汇总了C++中URL::GetContextId方法的典型用法代码示例。如果您正苦于以下问题:C++ URL::GetContextId方法的具体用法?C++ URL::GetContextId怎么用?C++ URL::GetContextId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类URL
的用法示例。
在下文中一共展示了URL::GetContextId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
URL
MediaSourceManagerImpl::GetUrlWithMediaContext(const URL& url)
{
// Don't override anything but the default context for now.
if (url.GetContextId() != 0)
return url;
// Create new context manager if it doesn't exists already.
if (!m_url_context_id)
{
m_url_context_id = urlManager->GetNewContextID();
OpFileFolder media_cache_folder;
if (OpStatus::IsError(g_folder_manager->AddFolder(OPFILE_CACHE_FOLDER, UNI_L("media"), &media_cache_folder)))
{
OP_ASSERT(!"Failed to create folder for dedicated media cache. Falling back to default");
return url;
}
Context_Manager_Multimedia::CreateManager(m_url_context_id, media_cache_folder, media_cache_folder, FALSE, PrefsCollectionNetwork::MediaCacheSize);
}
// Create new url with the media context.
const OpStringC tmp_url_str
= url.GetAttribute(URL::KUniName_With_Fragment_Username_Password_NOT_FOR_UI,
URL::KNoRedirect);
return g_url_api->GetURL(tmp_url_str, m_url_context_id);
}