本文整理汇总了C++中webcore::KURL::string方法的典型用法代码示例。如果您正苦于以下问题:C++ KURL::string方法的具体用法?C++ KURL::string怎么用?C++ KURL::string使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类webcore::KURL
的用法示例。
在下文中一共展示了KURL::string方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: removeOriginAccessWhitelistEntry
void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef protocol, JSStringRef host, bool includeSubdomains)
{
WebCore::KURL kurl;
kurl.setProtocol(String(protocol->characters(), protocol->length()));
kurl.setHost(String(host->characters(), host->length()));
ewk_security_policy_whitelist_origin_del(sourceOrigin->ustring().utf8().data(), kurl.string().utf8().data(), includeSubdomains);
}
示例2: getRealObject
void
JavaBridge::setCookies(WebCore::KURL const& url, WebCore::String const& value)
{
JNIEnv* env = JSC::Bindings::getJNIEnv();
const WebCore::String& urlStr = url.string();
jstring jUrlStr = env->NewString(urlStr.characters(), urlStr.length());
jstring jValueStr = env->NewString(value.characters(), value.length());
AutoJObject obj = getRealObject(env, mJavaObject);
env->CallVoidMethod(obj.get(), mSetCookies, jUrlStr, jValueStr);
env->DeleteLocalRef(jUrlStr);
env->DeleteLocalRef(jValueStr);
}
示例3: willLoadFromCache
/*
* This static method is called to check to see if a POST response is in
* the cache. This may be slow, but is only used during a navigation to
* a POST response.
*/
bool WebCoreResourceLoader::willLoadFromCache(const WebCore::KURL& url, int64_t identifier)
{
JNIEnv* env = JSC::Bindings::getJNIEnv();
WebCore::String urlStr = url.string();
jstring jUrlStr = env->NewString(urlStr.characters(), urlStr.length());
jclass resourceLoader = env->FindClass("android/webkit/LoadListener");
bool val = env->CallStaticBooleanMethod(resourceLoader,
gResourceLoader.mWillLoadFromCacheMethodID, jUrlStr, identifier);
checkException(env);
env->DeleteLocalRef(jUrlStr);
return val;
}
示例4: javaObject
void
JavaBridge::setCookies(WebCore::KURL const& url, WTF::String const& value)
{
JNIEnv* env = JSC::Bindings::getJNIEnv();
AutoJObject obj = javaObject(env);
if (!obj.get())
return;
const WTF::String& urlStr = url.string();
jstring jUrlStr = wtfStringToJstring(env, urlStr);
jstring jValueStr = wtfStringToJstring(env, value);
env->CallVoidMethod(obj.get(), mSetCookies, jUrlStr, jValueStr);
env->DeleteLocalRef(jUrlStr);
env->DeleteLocalRef(jValueStr);
}
示例5: getSignedPublicKeyAndChallengeString
WebCore::String JavaBridge::getSignedPublicKeyAndChallengeString(unsigned index,
const WebCore::String& challenge, const WebCore::KURL& url) {
JNIEnv* env = JSC::Bindings::getJNIEnv();
jstring jChallenge = env->NewString(challenge.characters(),
challenge.length());
const WebCore::String& urlStr = url.string();
jstring jUrl = env->NewString(urlStr.characters(), urlStr.length());
AutoJObject obj = getRealObject(env, mJavaObject);
jstring key = (jstring) env->CallObjectMethod(obj.get(),
mGetSignedPublicKey, index, jChallenge, jUrl);
WebCore::String ret = to_string(env, key);
env->DeleteLocalRef(jChallenge);
env->DeleteLocalRef(jUrl);
env->DeleteLocalRef(key);
return ret;
}
示例6: getSignedPublicKeyAndChallengeString
WTF::String JavaBridge::getSignedPublicKeyAndChallengeString(unsigned index,
const WTF::String& challenge, const WebCore::KURL& url) {
JNIEnv* env = JSC::Bindings::getJNIEnv();
AutoJObject obj = javaObject(env);
if (!obj.get())
return String();
jstring jChallenge = wtfStringToJstring(env, challenge);
const WTF::String& urlStr = url.string();
jstring jUrl = wtfStringToJstring(env, urlStr);
jstring key = (jstring) env->CallObjectMethod(obj.get(),
mGetSignedPublicKey, index, jChallenge, jUrl);
WTF::String ret = jstringToWtfString(env, key);
env->DeleteLocalRef(jChallenge);
env->DeleteLocalRef(jUrl);
env->DeleteLocalRef(key);
return ret;
}
示例7: String
WTF::String
JavaBridge::cookies(WebCore::KURL const& url)
{
JNIEnv* env = JSC::Bindings::getJNIEnv();
AutoJObject obj = javaObject(env);
if (!obj.get())
return String();
const WTF::String& urlStr = url.string();
jstring jUrlStr = wtfStringToJstring(env, urlStr);
jstring string = (jstring)(env->CallObjectMethod(obj.get(), mCookies, jUrlStr));
WTF::String ret = jstringToWtfString(env, string);
env->DeleteLocalRef(jUrlStr);
env->DeleteLocalRef(string);
return ret;
}
示例8: sourceParsed
void WebDebugListenerImpl::sourceParsed(ExecState* execState, const SourceCode& source, int errorLine, const UString& errorMsg)
{
if (m_listener && !m_inDebug) {
m_inDebug = true;
WebCore::String coreSourceURL = WebCore::ustringToString(source.provider()->url());
WebCore::Frame *frame = static_cast<WebCore::JSDOMWindow*>(execState->lexicalGlobalObject())->impl()->frame();
if (!(coreSourceURL.isNull() || coreSourceURL.isEmpty())) {
WebCore::KURL sourceURL(WebCore::ParsedURLString, coreSourceURL);
WebCore::KURL mappedURL;
if(WebCore::FrameLoaderClientApollo::mapFrameUrl(frame, sourceURL, &mappedURL)) {
coreSourceURL = mappedURL.string();
}
}
WebCore::String coreErrorMsg = WebCore::ustringToString(errorMsg);
WebCore::String coreSource(source.data(), source.length());
m_listener->m_pVTable->sourceParsed(m_listener, source.provider()->asID(), coreSourceURL.webString(), coreSource.webString(), source.firstLine(), errorLine, coreErrorMsg.webString());
m_inDebug = false;
}
}
示例9:
WebURL::WebURL(const WebCore::KURL& url)
: m_spec(url.string().utf8())
, m_parsed(url.parsed())
, m_isValid(url.isValid())
{
}
示例10: receivedRedirect
void NetworkResourceLoadScheduler::receivedRedirect(SchedulableLoader* loader, const WebCore::KURL& redirectURL)
{
ASSERT(isMainThread());
LOG(NetworkScheduling, "(NetworkProcess) NetworkResourceLoadScheduler::receivedRedirect loader originally for '%s' redirected to '%s'", loader->request().url().string().utf8().data(), redirectURL.string().utf8().data());
HostRecord* oldHost = loader->hostRecord();
// The load may have been cancelled while the message was in flight from network thread to main thread.
if (!oldHost)
return;
HostRecord* newHost = hostForURL(redirectURL, CreateIfNotFound);
if (oldHost->name() == newHost->name())
return;
oldHost->removeLoader(loader);
newHost->addLoaderInProgress(loader);
}