本文整理汇总了C++中SecurityOrigin::databaseIdentifier方法的典型用法代码示例。如果您正苦于以下问题:C++ SecurityOrigin::databaseIdentifier方法的具体用法?C++ SecurityOrigin::databaseIdentifier怎么用?C++ SecurityOrigin::databaseIdentifier使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SecurityOrigin
的用法示例。
在下文中一共展示了SecurityOrigin::databaseIdentifier方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: exceededDatabaseQuota
void ChromeClientBlackBerry::exceededDatabaseQuota(Frame* frame, const String& name)
{
#if ENABLE(SQL_DATABASE)
Document* document = frame->document();
if (!document)
return;
SecurityOrigin* origin = document->securityOrigin();
#if ENABLE_DRT
if (m_webPagePrivate->m_dumpRenderTree) {
m_webPagePrivate->m_dumpRenderTree->exceededDatabaseQuota(origin, name);
return;
}
#endif
DatabaseTracker& tracker = DatabaseTracker::tracker();
unsigned long long totalUsage = tracker.totalDatabaseUsage();
unsigned long long originUsage = tracker.usageForOrigin(origin);
DatabaseDetails details = tracker.detailsForNameAndOrigin(name, origin);
unsigned long long estimatedSize = details.expectedUsage();
const String& nameStr = details.displayName();
String originStr = origin->databaseIdentifier();
unsigned long long quota = m_webPagePrivate->m_client->databaseQuota(originStr.characters(), originStr.length(),
nameStr.characters(), nameStr.length(), totalUsage, originUsage, estimatedSize);
tracker.setQuota(origin, quota);
#endif
}
示例2: exceededDatabaseQuota
void WebChromeClient::exceededDatabaseQuota(Frame* frame, const String& databaseName, DatabaseDetails details)
{
WebFrame* webFrame = WebFrame::fromCoreFrame(*frame);
ASSERT(webFrame);
SecurityOrigin* origin = frame->document()->securityOrigin();
DatabaseManager& dbManager = DatabaseManager::singleton();
uint64_t currentQuota = dbManager.quotaForOrigin(origin);
uint64_t currentOriginUsage = dbManager.usageForOrigin(origin);
uint64_t newQuota = 0;
RefPtr<API::SecurityOrigin> securityOrigin = API::SecurityOrigin::create(WebCore::SecurityOrigin::createFromDatabaseIdentifier(origin->databaseIdentifier()));
newQuota = m_page->injectedBundleUIClient().didExceedDatabaseQuota(m_page, securityOrigin.get(), databaseName, details.displayName(), currentQuota, currentOriginUsage, details.currentUsage(), details.expectedUsage());
if (!newQuota) {
unsigned syncSendFlags = IPC::InformPlatformProcessWillSuspend;
if (WebPage::synchronousMessagesShouldSpinRunLoop())
syncSendFlags |= IPC::SpinRunLoopWhileWaitingForReply;
WebProcess::singleton().parentProcessConnection()->sendSync(
Messages::WebPageProxy::ExceededDatabaseQuota(webFrame->frameID(), origin->databaseIdentifier(), databaseName, details.displayName(), currentQuota, currentOriginUsage, details.currentUsage(), details.expectedUsage()),
Messages::WebPageProxy::ExceededDatabaseQuota::Reply(newQuota), m_page->pageID(), std::chrono::milliseconds::max(), syncSendFlags);
}
dbManager.setQuota(origin, newQuota);
}
示例3: exceededDatabaseQuota
void WebChromeClient::exceededDatabaseQuota(Frame* frame, const String& databaseName)
{
WebFrame* webFrame = static_cast<WebFrameLoaderClient*>(frame->loader()->client())->webFrame();
SecurityOrigin* origin = frame->document()->securityOrigin();
DatabaseDetails details = DatabaseTracker::tracker().detailsForNameAndOrigin(databaseName, origin);
uint64_t currentQuota = DatabaseTracker::tracker().quotaForOrigin(origin);
uint64_t newQuota = 0;
WebProcess::shared().connection()->sendSync(
Messages::WebPageProxy::ExceededDatabaseQuota(webFrame->frameID(), origin->databaseIdentifier(), databaseName, details.displayName(), currentQuota, details.currentUsage(), details.expectedUsage()),
Messages::WebPageProxy::ExceededDatabaseQuota::Reply(newQuota), m_page->pageID());
DatabaseTracker::tracker().setQuota(origin, newQuota);
}
示例4: exceededDatabaseQuota
void WebChromeClient::exceededDatabaseQuota(Frame* frame, const String& databaseName, DatabaseDetails details)
{
WebFrame* webFrame = static_cast<WebFrameLoaderClient*>(frame->loader()->client())->webFrame();
SecurityOrigin* origin = frame->document()->securityOrigin();
DatabaseManager& dbManager = DatabaseManager::manager();
uint64_t currentQuota = dbManager.quotaForOrigin(origin);
uint64_t currentOriginUsage = dbManager.usageForOrigin(origin);
uint64_t newQuota = 0;
RefPtr<WebSecurityOrigin> webSecurityOrigin = WebSecurityOrigin::createFromDatabaseIdentifier(origin->databaseIdentifier());
newQuota = m_page->injectedBundleUIClient().didExceedDatabaseQuota(m_page, webSecurityOrigin.get(), databaseName, details.displayName(), currentQuota, currentOriginUsage, details.currentUsage(), details.expectedUsage());
if (!newQuota) {
WebProcess::shared().connection()->sendSync(
Messages::WebPageProxy::ExceededDatabaseQuota(webFrame->frameID(), origin->databaseIdentifier(), databaseName, details.displayName(), currentQuota, currentOriginUsage, details.currentUsage(), details.expectedUsage()),
Messages::WebPageProxy::ExceededDatabaseQuota::Reply(newQuota), m_page->pageID());
}
dbManager.setQuota(origin, newQuota);
}
示例5: startRequestForGeolocation
void GeolocationPermissionRequestManager::startRequestForGeolocation(Geolocation* geolocation)
{
uint64_t geolocationID = generateGeolocationID();
m_geolocationToIDMap.set(geolocation, geolocationID);
m_idToGeolocationMap.set(geolocationID, geolocation);
Frame* frame = geolocation->frame();
WebFrameLoaderClient* webFrameLoaderClient = toWebFrameLoaderClient(frame->loader()->client());
WebFrame* webFrame = webFrameLoaderClient ? webFrameLoaderClient->webFrame() : 0;
ASSERT(webFrame);
SecurityOrigin* origin = frame->document()->securityOrigin();
m_page->send(Messages::WebPageProxy::RequestGeolocationPermissionForFrame(geolocationID, webFrame->frameID(), origin->databaseIdentifier()));
}