本文整理汇总了C++中WebViewImpl::permissionClient方法的典型用法代码示例。如果您正苦于以下问题:C++ WebViewImpl::permissionClient方法的具体用法?C++ WebViewImpl::permissionClient怎么用?C++ WebViewImpl::permissionClient使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WebViewImpl
的用法示例。
在下文中一共展示了WebViewImpl::permissionClient方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: canEstablishDatabase
bool DatabaseObserver::canEstablishDatabase(ExecutionContext* executionContext, const String& name, const String& displayName, unsigned long estimatedSize)
{
ASSERT(executionContext->isContextThread());
ASSERT(executionContext->isDocument() || executionContext->isWorkerGlobalScope());
if (executionContext->isDocument()) {
Document* document = toDocument(executionContext);
WebFrameImpl* webFrame = WebFrameImpl::fromFrame(document->frame());
if (!webFrame)
return false;
WebViewImpl* webView = webFrame->viewImpl();
if (!webView)
return false;
if (webView->permissionClient())
return webView->permissionClient()->allowDatabase(webFrame, name, displayName, estimatedSize);
} else {
WorkerGlobalScope* workerGlobalScope = toWorkerGlobalScope(executionContext);
WorkerPermissionClient* permissionClient = WorkerPermissionClient::from(workerGlobalScope);
if (permissionClient->proxy())
return permissionClient->allowDatabase(name, displayName, estimatedSize);
// FIXME: Deprecate this bridge code when PermissionClientProxy is
// implemented by the embedder.
WebWorkerBase* webWorker = static_cast<WebWorkerBase*>(workerGlobalScope->thread()->workerLoaderProxy().toWebWorkerBase());
WebView* view = webWorker->view();
if (!view)
return false;
return allowDatabaseForWorker(view->mainFrame(), name, displayName, estimatedSize);
}
return true;
}
示例2: canEstablishDatabase
bool DatabaseObserver::canEstablishDatabase(ScriptExecutionContext* scriptExecutionContext, const String& name, const String& displayName, unsigned long estimatedSize)
{
ASSERT(scriptExecutionContext->isContextThread());
ASSERT(scriptExecutionContext->isDocument() || scriptExecutionContext->isWorkerContext());
if (scriptExecutionContext->isDocument()) {
Document* document = static_cast<Document*>(scriptExecutionContext);
WebFrameImpl* webFrame = WebFrameImpl::fromFrame(document->frame());
if (!webFrame)
return false;
WebViewImpl* webView = webFrame->viewImpl();
if (!webView)
return false;
if (webView->permissionClient())
return webView->permissionClient()->allowDatabase(webFrame, name, displayName, estimatedSize);
} else {
#if ENABLE(WORKERS)
WorkerContext* workerContext = static_cast<WorkerContext*>(scriptExecutionContext);
WorkerLoaderProxy* workerLoaderProxy = &workerContext->thread()->workerLoaderProxy();
NewWebWorkerBase* webWorker = static_cast<NewWebWorkerBase*>(workerLoaderProxy);
return allowDatabaseForWorker(webWorker->newCommonClient(), webWorker->view()->mainFrame(), name, displayName, estimatedSize);
#else
ASSERT_NOT_REACHED();
#endif
}
return true;
}
示例3: canEstablishDatabase
bool DatabaseObserver::canEstablishDatabase(ScriptExecutionContext* scriptExecutionContext, const String& name, const String& displayName, unsigned long estimatedSize)
{
ASSERT(scriptExecutionContext->isContextThread());
ASSERT(scriptExecutionContext->isDocument() || scriptExecutionContext->isWorkerGlobalScope());
if (scriptExecutionContext->isDocument()) {
Document* document = toDocument(scriptExecutionContext);
WebFrameImpl* webFrame = WebFrameImpl::fromFrame(document->frame());
if (!webFrame)
return false;
WebViewImpl* webView = webFrame->viewImpl();
if (!webView)
return false;
if (webView->permissionClient())
return webView->permissionClient()->allowDatabase(webFrame, name, displayName, estimatedSize);
} else {
WorkerGlobalScope* workerGlobalScope = toWorkerGlobalScope(scriptExecutionContext);
WebWorkerBase* webWorker = static_cast<WebWorkerBase*>(workerGlobalScope->thread()->workerLoaderProxy().toWebWorkerBase());
WebView* view = webWorker->view();
if (!view)
return false;
return allowDatabaseForWorker(view->mainFrame(), name, displayName, estimatedSize);
}
return true;
}
开发者ID:IllusionRom-deprecated,项目名称:android_platform_external_chromium_org_third_party_WebKit,代码行数:25,代码来源:DatabaseObserver.cpp
示例4: allowIndexedDB
bool IDBFactoryBackendProxy::allowIndexedDB(ScriptExecutionContext* context, const String& name, const WebSecurityOrigin& origin, PassRefPtr<IDBCallbacks> callbacks)
{
bool allowed;
ASSERT(context->isDocument() || context->isWorkerContext());
if (context->isDocument()) {
Document* document = static_cast<Document*>(context);
WebFrameImpl* webFrame = WebFrameImpl::fromFrame(document->frame());
WebViewImpl* webView = webFrame->viewImpl();
// FIXME: webView->permissionClient() returns 0 in test_shell and content_shell http://crbug.com/137269
allowed = !webView->permissionClient() || webView->permissionClient()->allowIndexedDB(webFrame, name, origin);
} else {
WorkerContext* workerContext = static_cast<WorkerContext*>(context);
WebWorkerBase* webWorkerBase = static_cast<WebWorkerBase*>(&workerContext->thread()->workerLoaderProxy());
WorkerRunLoop& runLoop = workerContext->thread()->runLoop();
String mode = allowIndexedDBMode;
mode.append(String::number(runLoop.createUniqueId()));
RefPtr<AllowIndexedDBMainThreadBridge> bridge = AllowIndexedDBMainThreadBridge::create(webWorkerBase, mode, name);
// Either the bridge returns, or the queue gets terminated.
if (runLoop.runInMode(workerContext, mode) == MessageQueueTerminated) {
bridge->cancel();
allowed = false;
} else
allowed = bridge->result();
}
if (!allowed)
callbacks->onError(WebIDBDatabaseError(IDBDatabaseException::UNKNOWN_ERR, "The user denied permission to access the database."));
return allowed;
}
示例5: didNotAllowPlugins
void FrameLoaderClientImpl::didNotAllowPlugins()
{
WebViewImpl* webview = m_webFrame->viewImpl();
if (webview && webview->permissionClient())
webview->permissionClient()->didNotAllowPlugins(m_webFrame);
}
示例6: allowRunningInsecureContent
bool FrameLoaderClientImpl::allowRunningInsecureContent(bool enabledPerSettings, SecurityOrigin* context, const KURL& url)
{
WebViewImpl* webview = m_webFrame->viewImpl();
if (webview && webview->permissionClient())
return webview->permissionClient()->allowRunningInsecureContent(m_webFrame, enabledPerSettings, WebSecurityOrigin(context), WebURL(url));
return enabledPerSettings;
}
示例7: allowImage
bool FrameLoaderClientImpl::allowImage(bool enabledPerSettings, const KURL& imageURL)
{
WebViewImpl* webview = m_webFrame->viewImpl();
if (webview && webview->permissionClient())
return webview->permissionClient()->allowImage(m_webFrame, enabledPerSettings, imageURL);
return enabledPerSettings;
}
示例8: allowPlugins
bool FrameLoaderClientImpl::allowPlugins(bool enabledPerSettings)
{
WebViewImpl* webview = m_webFrame->viewImpl();
if (webview && webview->permissionClient())
return webview->permissionClient()->allowPlugins(m_webFrame, enabledPerSettings);
return enabledPerSettings;
}
示例9: allowScriptFromSource
bool FrameLoaderClientImpl::allowScriptFromSource(bool enabledPerSettings, const KURL& scriptURL)
{
WebViewImpl* webview = m_webFrame->viewImpl();
if (webview && webview->permissionClient())
return webview->permissionClient()->allowScriptFromSource(m_webFrame, enabledPerSettings, scriptURL);
return enabledPerSettings;
}
示例10: allowScriptExtension
bool FrameLoaderClientImpl::allowScriptExtension(const String& extensionName,
int extensionGroup,
int worldId)
{
WebViewImpl* webview = m_webFrame->viewImpl();
if (webview && webview->permissionClient())
return webview->permissionClient()->allowScriptExtension(m_webFrame, extensionName, extensionGroup, worldId);
return true;
}
示例11: allowIndexedDBTask
static void allowIndexedDBTask(ScriptExecutionContext*, PassRefPtr<AllowIndexedDBMainThreadBridge> bridge, PassRefPtr<WebFrameImpl> prpWebFrame, const String& name, const String& mode)
{
RefPtr<WebFrameImpl> webFrame = prpWebFrame;
WebViewImpl* webView = webFrame->viewImpl();
if (!webView) {
bridge->signalCompleted(false, mode);
return;
}
bool allowed = !webView->permissionClient() || webView->permissionClient()->allowIndexedDB(webFrame.get(), name, WebSecurityOrigin());
bridge->signalCompleted(allowed, mode);
}
示例12: deleteDatabase
void IDBFactoryBackendProxy::deleteDatabase(const String& name, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<SecurityOrigin> prpOrigin, Frame* frame, const String& dataDir)
{
WebSecurityOrigin origin(prpOrigin);
WebFrameImpl* webFrame = WebFrameImpl::fromFrame(frame);
WebViewImpl* webView = webFrame->viewImpl();
if (webView->permissionClient() && !webView->permissionClient()->allowIndexedDB(webFrame, name, origin)) {
callbacks->onError(WebIDBDatabaseError(0, "The user denied permission to access the database."));
return;
}
m_webIDBFactory->deleteDatabase(name, new WebIDBCallbacksImpl(callbacks), origin, webFrame, dataDir);
}
示例13: open
void IDBFactoryBackendProxy::open(const String& name, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<SecurityOrigin> prpOrigin, Frame* frame, const String& dataDir, int64_t maximumSize, BackingStoreType backingStoreType)
{
WebSecurityOrigin origin(prpOrigin);
WebFrameImpl* webFrame = WebFrameImpl::fromFrame(frame);
WebViewImpl* webView = webFrame->viewImpl();
if (webView->permissionClient() && !webView->permissionClient()->allowIndexedDB(webFrame, name, origin)) {
callbacks->onError(WebIDBDatabaseError(0, "The user denied permission to access the database."));
return;
}
m_webIDBFactory->open(name, new WebIDBCallbacksImpl(callbacks), origin, webFrame, dataDir, maximumSize, static_cast<WebIDBFactory::BackingStoreType>(backingStoreType));
}
示例14: allowIndexedDB
bool IDBFactoryBackendProxy::allowIndexedDB(ExecutionContext* context, const String& name, const WebSecurityOrigin& origin, PassRefPtr<IDBCallbacks> callbacks)
{
bool allowed;
ASSERT_WITH_SECURITY_IMPLICATION(context->isDocument() || context->isWorkerGlobalScope());
if (context->isDocument()) {
Document* document = toDocument(context);
WebFrameImpl* webFrame = WebFrameImpl::fromFrame(document->frame());
WebViewImpl* webView = webFrame->viewImpl();
// FIXME: webView->permissionClient() returns 0 in test_shell and content_shell http://crbug.com/137269
allowed = !webView->permissionClient() || webView->permissionClient()->allowIndexedDB(webFrame, name, origin);
} else {
WorkerGlobalScope* workerGlobalScope = toWorkerGlobalScope(context);
WorkerPermissionClient* permissionClient = WorkerPermissionClient::from(workerGlobalScope);
if (permissionClient->proxy()) {
allowed = permissionClient->allowIndexedDB(name);
if (!allowed)
callbacks->onError(WebIDBDatabaseError(UnknownError, "The user denied permission to access the database."));
return allowed;
}
// FIXME: Deprecate this bridge code when PermissionClientProxy is
// implemented by the embedder.
WebWorkerBase* webWorkerBase = static_cast<WebWorkerBase*>(workerGlobalScope->thread()->workerLoaderProxy().toWebWorkerBase());
WorkerRunLoop& runLoop = workerGlobalScope->thread()->runLoop();
String mode = allowIndexedDBMode;
mode.append(String::number(runLoop.createUniqueId()));
RefPtr<AllowIndexedDBMainThreadBridge> bridge = AllowIndexedDBMainThreadBridge::create(workerGlobalScope, webWorkerBase, mode, name);
// Either the bridge returns, or the queue gets terminated.
if (runLoop.runInMode(workerGlobalScope, mode) == MessageQueueTerminated) {
bridge->cancel();
return false;
}
allowed = bridge->result();
}
if (!allowed)
callbacks->onError(WebIDBDatabaseError(UnknownError, "The user denied permission to access the database."));
return allowed;
}