本文整理汇总了C++中ASSERT_NOT_REACHED函数的典型用法代码示例。如果您正苦于以下问题:C++ ASSERT_NOT_REACHED函数的具体用法?C++ ASSERT_NOT_REACHED怎么用?C++ ASSERT_NOT_REACHED使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ASSERT_NOT_REACHED函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ASSERT_NOT_REACHED
bool WebSharedWorkerImpl::isStarted()
{
// Should not ever be called from the worker thread (this API is only called on WebSharedWorkerProxy on the renderer thread).
ASSERT_NOT_REACHED();
return workerThread();
}
开发者ID:ychaim,项目名称:chromium.bb,代码行数:6,代码来源:WebSharedWorkerImpl.cpp
示例2: switch
//.........这里部分代码省略.........
return 476;
case CSSPropertyAliasEpubWritingMode:
return 477;
case CSSPropertyAliasWebkitAlignContent:
return 478;
case CSSPropertyAliasWebkitAlignItems:
return 479;
case CSSPropertyAliasWebkitAlignSelf:
return 480;
case CSSPropertyAliasWebkitBorderBottomLeftRadius:
return 481;
case CSSPropertyAliasWebkitBorderBottomRightRadius:
return 482;
case CSSPropertyAliasWebkitBorderTopLeftRadius:
return 483;
case CSSPropertyAliasWebkitBorderTopRightRadius:
return 484;
case CSSPropertyAliasWebkitBoxSizing:
return 485;
case CSSPropertyAliasWebkitFlex:
return 486;
case CSSPropertyAliasWebkitFlexBasis:
return 487;
case CSSPropertyAliasWebkitFlexDirection:
return 488;
case CSSPropertyAliasWebkitFlexFlow:
return 489;
case CSSPropertyAliasWebkitFlexGrow:
return 490;
case CSSPropertyAliasWebkitFlexShrink:
return 491;
case CSSPropertyAliasWebkitFlexWrap:
return 492;
case CSSPropertyAliasWebkitJustifyContent:
return 493;
case CSSPropertyAliasWebkitOpacity:
return 494;
case CSSPropertyAliasWebkitOrder:
return 495;
case CSSPropertyAliasWebkitShapeImageThreshold:
return 496;
case CSSPropertyAliasWebkitShapeMargin:
return 497;
case CSSPropertyAliasWebkitShapeOutside:
return 498;
case CSSPropertyScrollSnapType:
return 499;
case CSSPropertyScrollSnapPointsX:
return 500;
case CSSPropertyScrollSnapPointsY:
return 501;
case CSSPropertyScrollSnapCoordinate:
return 502;
case CSSPropertyScrollSnapDestination:
return 503;
case CSSPropertyTranslate:
return 504;
case CSSPropertyRotate:
return 505;
case CSSPropertyScale:
return 506;
case CSSPropertyImageOrientation:
return 507;
case CSSPropertyBackdropFilter:
return 508;
case CSSPropertyTextCombineUpright:
return 509;
case CSSPropertyTextOrientation:
return 510;
case CSSPropertyGridColumnGap:
return 511;
case CSSPropertyGridRowGap:
return 512;
case CSSPropertyGridGap:
return 513;
case CSSPropertyFontFeatureSettings:
return 514;
case CSSPropertyVariable:
return 515;
case CSSPropertyFontDisplay:
return 516;
case CSSPropertyContain:
return 517;
case CSSPropertyD:
return 518;
// 1. Add new features above this line (don't change the assigned numbers of the existing
// items).
// 2. Update maximumCSSSampleId() with the new maximum value.
// 3. Run the update_use_counter_css.py script in
// chromium/src/tools/metrics/histograms to update the UMA histogram names.
case CSSPropertyInvalid:
ASSERT_NOT_REACHED();
return 0;
}
ASSERT_NOT_REACHED();
return 0;
}
开发者ID:joone,项目名称:chromium-crosswalk,代码行数:101,代码来源:UseCounter.cpp
示例3: tls_thread_init
//.........这里部分代码省略.........
ASSERT_CURIOSITY(false && "arch_prctl failed on set but not get");
LOG(GLOBAL, LOG_THREADS, 1,
"os_tls_init: arch_prctl failed: error %d\n", res);
}
} else {
/* FIXME PR 205276: we don't currently handle it: fall back on ldt, but
* we'll have the same conflict w/ the selector...
*/
ASSERT_BUG_NUM(205276, cur_gs == NULL);
}
}
#endif
if (os_tls->tls_type == TLS_TYPE_NONE) {
/* Second choice is set_thread_area */
/* PR 285898: if we added CLONE_SETTLS to all clone calls (and emulated vfork
* with clone) we could avoid having to set tls up for each thread (as well
* as solve race PR 207903), at least for kernel 2.5.32+. For now we stick
* w/ manual setup.
*/
our_modify_ldt_t desc;
/* Pick which GDT slots we'll use for DR TLS and for library TLS if
* using the private loader.
*/
choose_gdt_slots(os_tls);
if (tls_gdt_index > -1) {
/* Now that we know which GDT slot to use, install the per-thread base
* into it.
*/
/* Base here must be 32-bit */
IF_X64(ASSERT(DYNAMO_OPTION(heap_in_lower_4GB) &&
segment <= (byte*)UINT_MAX));
initialize_ldt_struct(&desc, segment, PAGE_SIZE, tls_gdt_index);
res = dynamorio_syscall(SYS_set_thread_area, 1, &desc);
LOG(GLOBAL, LOG_THREADS, 3,
"%s: set_thread_area %d => %d res, %d index\n",
__FUNCTION__, tls_gdt_index, res, desc.entry_number);
ASSERT(res < 0 || desc.entry_number == tls_gdt_index);
} else {
res = -1; /* fall back on LDT */
}
if (res >= 0) {
LOG(GLOBAL, LOG_THREADS, 1,
"os_tls_init: set_thread_area successful for base "PFX" @index %d\n",
segment, tls_gdt_index);
os_tls->tls_type = TLS_TYPE_GDT;
index = tls_gdt_index;
selector = GDT_SELECTOR(index);
WRITE_DR_SEG(selector); /* macro needs lvalue! */
} else {
IF_VMX86(ASSERT_NOT_REACHED()); /* since no modify_ldt */
LOG(GLOBAL, LOG_THREADS, 1,
"os_tls_init: set_thread_area failed: error %d\n", res);
}
#ifdef CLIENT_INTERFACE
/* Install the library TLS base. */
if (INTERNAL_OPTION(private_loader) && res >= 0) {
app_pc base = IF_X64_ELSE(os_tls->os_seg_info.dr_fs_base,
os_tls->os_seg_info.dr_gs_base);
/* lib_tls_gdt_index is picked in choose_gdt_slots. */
ASSERT(lib_tls_gdt_index >= gdt_entry_tls_min);
initialize_ldt_struct(&desc, base, GDT_NO_SIZE_LIMIT,
lib_tls_gdt_index);
res = dynamorio_syscall(SYS_set_thread_area, 1, &desc);
LOG(GLOBAL, LOG_THREADS, 3,
"%s: set_thread_area %d => %d res, %d index\n",
__FUNCTION__, lib_tls_gdt_index, res, desc.entry_number);
if (res >= 0) {
/* i558 update lib seg reg to enforce the segment changes */
selector = GDT_SELECTOR(lib_tls_gdt_index);
LOG(GLOBAL, LOG_THREADS, 2, "%s: setting %s to selector 0x%x\n",
__FUNCTION__, reg_names[LIB_SEG_TLS], selector);
WRITE_LIB_SEG(selector);
}
}
#endif
}
if (os_tls->tls_type == TLS_TYPE_NONE) {
/* Third choice: modify_ldt, which should be available on kernel 2.3.99+ */
/* Base here must be 32-bit */
IF_X64(ASSERT(DYNAMO_OPTION(heap_in_lower_4GB) && segment <= (byte*)UINT_MAX));
/* we have the thread_initexit_lock so no race here */
index = find_unused_ldt_index();
selector = LDT_SELECTOR(index);
ASSERT(index != -1);
create_ldt_entry((void *)segment, PAGE_SIZE, index);
os_tls->tls_type = TLS_TYPE_LDT;
WRITE_DR_SEG(selector); /* macro needs lvalue! */
LOG(GLOBAL, LOG_THREADS, 1,
"os_tls_init: modify_ldt successful for base "PFX" w/ index %d\n",
segment, index);
}
os_tls->ldt_index = index;
}
开发者ID:DynamoRIO,项目名称:drk,代码行数:101,代码来源:tls_linux_x86.c
示例4: unreachable
static void unreachable()
{
ASSERT_NOT_REACHED();
exit(1);
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:5,代码来源:JITCall.cpp
示例5: decode
bool decode(ArgumentDecoder* decoder, RetainPtr<CFTypeRef>& result)
{
CFType type;
if (!decoder->decodeEnum(type))
return false;
switch (type) {
case CFArray: {
RetainPtr<CFArrayRef> array;
if (!decode(decoder, array))
return false;
result.adoptCF(array.leakRef());
return true;
}
case CFBoolean: {
RetainPtr<CFBooleanRef> boolean;
if (!decode(decoder, boolean))
return false;
result.adoptCF(boolean.leakRef());
return true;
}
case CFData: {
RetainPtr<CFDataRef> data;
if (!decode(decoder, data))
return false;
result.adoptCF(data.leakRef());
return true;
}
case CFDate: {
RetainPtr<CFDateRef> date;
if (!decode(decoder, date))
return false;
result.adoptCF(date.leakRef());
return true;
}
case CFDictionary: {
RetainPtr<CFDictionaryRef> dictionary;
if (!decode(decoder, dictionary))
return false;
result.adoptCF(dictionary.leakRef());
return true;
}
case CFNull:
result.adoptCF(kCFNull);
return true;
case CFNumber: {
RetainPtr<CFNumberRef> number;
if (!decode(decoder, number))
return false;
result.adoptCF(number.leakRef());
return true;
}
case CFString: {
RetainPtr<CFStringRef> string;
if (!decode(decoder, string))
return false;
result.adoptCF(string.leakRef());
return true;
}
case CFURL: {
RetainPtr<CFURLRef> url;
if (!decode(decoder, url))
return false;
result.adoptCF(url.leakRef());
return true;
}
#if PLATFORM(MAC)
case SecCertificate: {
RetainPtr<SecCertificateRef> certificate;
if (!decode(decoder, certificate))
return false;
result.adoptCF(certificate.leakRef());
return true;
}
case SecKeychainItem: {
RetainPtr<SecKeychainItemRef> keychainItem;
if (!decode(decoder, keychainItem))
return false;
result.adoptCF(keychainItem.leakRef());
return true;
}
#endif
case Null:
result = tokenNullTypeRef();
return true;
case Unknown:
ASSERT_NOT_REACHED();
return false;
}
return false;
}
开发者ID:Moondee,项目名称:Artemis,代码行数:92,代码来源:ArgumentCodersCF.cpp
示例6: ASSERT
bool CSSValue::equals(const CSSValue& other) const
{
if (m_isTextClone) {
ASSERT(isCSSOMSafe());
return static_cast<const TextCloneCSSValue*>(this)->cssText() == other.cssText();
}
if (m_classType == other.m_classType) {
switch (m_classType) {
case AspectRatioClass:
return compareCSSValues<CSSAspectRatioValue>(*this, other);
case BorderImageSliceClass:
return compareCSSValues<CSSBorderImageSliceValue>(*this, other);
case CanvasClass:
return compareCSSValues<CSSCanvasValue>(*this, other);
case CursorImageClass:
return compareCSSValues<CSSCursorImageValue>(*this, other);
#if ENABLE(CSS_FILTERS)
case FilterImageClass:
return compareCSSValues<CSSFilterImageValue>(*this, other);
#endif
case FontClass:
return compareCSSValues<CSSFontValue>(*this, other);
case FontFaceSrcClass:
return compareCSSValues<CSSFontFaceSrcValue>(*this, other);
case FontFeatureClass:
return compareCSSValues<CSSFontFeatureValue>(*this, other);
case FunctionClass:
return compareCSSValues<CSSFunctionValue>(*this, other);
case LinearGradientClass:
return compareCSSValues<CSSLinearGradientValue>(*this, other);
case RadialGradientClass:
return compareCSSValues<CSSRadialGradientValue>(*this, other);
case CrossfadeClass:
return compareCSSValues<CSSCrossfadeValue>(*this, other);
case ImageClass:
return compareCSSValues<CSSImageValue>(*this, other);
case InheritedClass:
return compareCSSValues<CSSInheritedValue>(*this, other);
case InitialClass:
return compareCSSValues<CSSInitialValue>(*this, other);
case GridTemplateClass:
return compareCSSValues<CSSGridTemplateValue>(*this, other);
case PrimitiveClass:
return compareCSSValues<CSSPrimitiveValue>(*this, other);
case ReflectClass:
return compareCSSValues<CSSReflectValue>(*this, other);
case ShadowClass:
return compareCSSValues<CSSShadowValue>(*this, other);
case CubicBezierTimingFunctionClass:
return compareCSSValues<CSSCubicBezierTimingFunctionValue>(*this, other);
case StepsTimingFunctionClass:
return compareCSSValues<CSSStepsTimingFunctionValue>(*this, other);
case UnicodeRangeClass:
return compareCSSValues<CSSUnicodeRangeValue>(*this, other);
case ValueListClass:
return compareCSSValues<CSSValueList>(*this, other);
case WebKitCSSTransformClass:
return compareCSSValues<WebKitCSSTransformValue>(*this, other);
case LineBoxContainClass:
return compareCSSValues<CSSLineBoxContainValue>(*this, other);
case CalculationClass:
return compareCSSValues<CSSCalcValue>(*this, other);
#if ENABLE(CSS_IMAGE_SET)
case ImageSetClass:
return compareCSSValues<CSSImageSetValue>(*this, other);
#endif
#if ENABLE(CSS_FILTERS)
case WebKitCSSFilterClass:
return compareCSSValues<WebKitCSSFilterValue>(*this, other);
#if ENABLE(CSS_SHADERS)
case WebKitCSSArrayFunctionValueClass:
return compareCSSValues<WebKitCSSArrayFunctionValue>(*this, other);
case WebKitCSSMatFunctionValueClass:
return compareCSSValues<WebKitCSSMatFunctionValue>(*this, other);
case WebKitCSSMixFunctionValueClass:
return compareCSSValues<WebKitCSSMixFunctionValue>(*this, other);
case WebKitCSSShaderClass:
return compareCSSValues<WebKitCSSShaderValue>(*this, other);
#endif
#endif
#if ENABLE(SVG)
case SVGColorClass:
return compareCSSValues<SVGColor>(*this, other);
case SVGPaintClass:
return compareCSSValues<SVGPaint>(*this, other);
case WebKitCSSSVGDocumentClass:
return compareCSSValues<WebKitCSSSVGDocumentValue>(*this, other);
#endif
default:
ASSERT_NOT_REACHED();
return false;
}
} else if (m_classType == ValueListClass && other.m_classType != ValueListClass)
return toCSSValueList(this)->equals(other);
else if (m_classType != ValueListClass && other.m_classType == ValueListClass)
return static_cast<const CSSValueList&>(other).equals(*this);
return false;
}
开发者ID:ewmailing,项目名称:webkit,代码行数:99,代码来源:CSSValue.cpp
示例7: ASSERT_NOT_REACHED
void DOMWindowExtensionNoCache::willDisconnectDOMWindowExtensionFromGlobalObject(WKBundleDOMWindowExtensionRef extension)
{
// No items should be going into a 0-capacity page cache.
ASSERT_NOT_REACHED();
}
开发者ID:cheekiatng,项目名称:webkit,代码行数:5,代码来源:DOMWindowExtensionNoCache_Bundle.cpp
示例8: parseManifest
//.........这里部分代码省略.........
// Get rid of trailing whitespace
const UChar* tmp = p - 1;
while (tmp > lineStart && (*tmp == ' ' || *tmp == '\t'))
tmp--;
String line(lineStart, tmp - lineStart + 1);
if (line == "CACHE:")
mode = Explicit;
else if (line == "FALLBACK:")
mode = Fallback;
else if (line == "NETWORK:")
mode = OnlineWhitelist;
else if (line.endsWith(':'))
mode = Unknown;
else if (mode == Unknown)
continue;
else if (mode == Explicit || mode == OnlineWhitelist) {
auto upconvertedLineCharacters = StringView(line).upconvertedCharacters();
const UChar* p = upconvertedLineCharacters;
const UChar* lineEnd = p + line.length();
// Look for whitespace separating the URL from subsequent ignored tokens.
while (p < lineEnd && *p != '\t' && *p != ' ')
p++;
if (mode == OnlineWhitelist && p - upconvertedLineCharacters == 1 && line[0] == '*') {
// Wildcard was found.
manifest.allowAllNetworkRequests = true;
continue;
}
URL url(manifestURL, line.substring(0, p - upconvertedLineCharacters));
if (!url.isValid())
continue;
if (url.hasFragmentIdentifier())
url.removeFragmentIdentifier();
if (!equalIgnoringASCIICase(url.protocol(), manifestURL.protocol()))
continue;
if (mode == Explicit && manifestURL.protocolIs("https") && !protocolHostAndPortAreEqual(manifestURL, url))
continue;
if (mode == Explicit)
manifest.explicitURLs.add(url.string());
else
manifest.onlineWhitelistedURLs.append(url);
} else if (mode == Fallback) {
auto upconvertedLineCharacters = StringView(line).upconvertedCharacters();
const UChar* p = upconvertedLineCharacters;
const UChar* lineEnd = p + line.length();
// Look for whitespace separating the two URLs
while (p < lineEnd && *p != '\t' && *p != ' ')
p++;
if (p == lineEnd) {
// There was no whitespace separating the URLs.
continue;
}
URL namespaceURL(manifestURL, line.substring(0, p - upconvertedLineCharacters));
if (!namespaceURL.isValid())
continue;
if (namespaceURL.hasFragmentIdentifier())
namespaceURL.removeFragmentIdentifier();
if (!protocolHostAndPortAreEqual(manifestURL, namespaceURL))
continue;
// Skip whitespace separating fallback namespace from URL.
while (p < lineEnd && (*p == '\t' || *p == ' '))
p++;
// Look for whitespace separating the URL from subsequent ignored tokens.
const UChar* fallbackStart = p;
while (p < lineEnd && *p != '\t' && *p != ' ')
p++;
URL fallbackURL(manifestURL, String(fallbackStart, p - fallbackStart));
if (!fallbackURL.isValid())
continue;
if (fallbackURL.hasFragmentIdentifier())
fallbackURL.removeFragmentIdentifier();
if (!protocolHostAndPortAreEqual(manifestURL, fallbackURL))
continue;
manifest.fallbackURLs.append(std::make_pair(namespaceURL, fallbackURL));
} else
ASSERT_NOT_REACHED();
}
return true;
}
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:101,代码来源:ManifestParser.cpp
示例9: ASSERT_NOT_REACHED
// This state function is used as a stub function to plug unimplemented states
// in the state dispatch table. They are unimplemented because they should
// never be reached in the course of correct execution.
SQLTransactionState SQLTransaction::unreachableState()
{
ASSERT_NOT_REACHED();
return SQLTransactionState::End;
}
开发者ID:jeremyroman,项目名称:blink,代码行数:8,代码来源:SQLTransaction.cpp
示例10: ASSERT
//.........这里部分代码省略.........
case CSSPropertyTextDecorationColor:
return AnimatableColor::create(style.textDecorationColor().resolve(style.color()), style.visitedLinkTextDecorationColor().resolve(style.visitedLinkColor()));
case CSSPropertyTextIndent:
return createFromLength(style.textIndent(), style);
case CSSPropertyTextShadow:
return AnimatableShadow::create(style.textShadow());
case CSSPropertyTop:
return createFromLength(style.top(), style);
case CSSPropertyWebkitBorderHorizontalSpacing:
return createFromDouble(style.horizontalBorderSpacing());
case CSSPropertyWebkitBorderVerticalSpacing:
return createFromDouble(style.verticalBorderSpacing());
case CSSPropertyWebkitClipPath:
if (ClipPathOperation* operation = style.clipPath())
return AnimatableClipPathOperation::create(operation);
return AnimatableUnknown::create(CSSValueNone);
case CSSPropertyWebkitColumnCount:
return createFromDouble(style.columnCount());
case CSSPropertyWebkitColumnGap:
return createFromDouble(style.columnGap());
case CSSPropertyWebkitColumnRuleColor:
return createFromColor(property, style);
case CSSPropertyWebkitColumnRuleWidth:
return createFromDouble(style.columnRuleWidth());
case CSSPropertyWebkitColumnWidth:
return createFromDouble(style.columnWidth());
case CSSPropertyWebkitFilter:
return AnimatableFilterOperations::create(style.filter());
case CSSPropertyWebkitMaskBoxImageOutset:
return createFromBorderImageLengthBox(style.maskBoxImageOutset(), style);
case CSSPropertyWebkitMaskBoxImageSlice:
return createFromLengthBoxAndBool(style.maskBoxImageSlices(), style.maskBoxImageSlicesFill(), style);
case CSSPropertyWebkitMaskBoxImageSource:
return createFromStyleImage(style.maskBoxImageSource());
case CSSPropertyWebkitMaskBoxImageWidth:
return createFromBorderImageLengthBox(style.maskBoxImageWidth(), style);
case CSSPropertyWebkitMaskImage:
return createFromFillLayers<CSSPropertyWebkitMaskImage>(style.maskLayers(), style);
case CSSPropertyWebkitMaskPositionX:
return createFromFillLayers<CSSPropertyWebkitMaskPositionX>(style.maskLayers(), style);
case CSSPropertyWebkitMaskPositionY:
return createFromFillLayers<CSSPropertyWebkitMaskPositionY>(style.maskLayers(), style);
case CSSPropertyWebkitMaskSize:
return createFromFillLayers<CSSPropertyWebkitMaskSize>(style.maskLayers(), style);
case CSSPropertyPerspective:
return createFromDouble(style.perspective());
case CSSPropertyPerspectiveOrigin:
ASSERT(RuntimeEnabledFeatures::cssTransformsUnprefixedEnabled());
return AnimatableLengthPoint::create(
createFromLength(style.perspectiveOriginX(), style),
createFromLength(style.perspectiveOriginY(), style));
case CSSPropertyWebkitPerspectiveOriginX:
ASSERT(!RuntimeEnabledFeatures::cssTransformsUnprefixedEnabled());
return createFromLength(style.perspectiveOriginX(), style);
case CSSPropertyWebkitPerspectiveOriginY:
ASSERT(!RuntimeEnabledFeatures::cssTransformsUnprefixedEnabled());
return createFromLength(style.perspectiveOriginY(), style);
case CSSPropertyShapeOutside:
return createFromShapeValue(style.shapeOutside());
case CSSPropertyShapeMargin:
return createFromLength(style.shapeMargin(), style);
case CSSPropertyShapeImageThreshold:
return createFromDouble(style.shapeImageThreshold());
case CSSPropertyWebkitTextStrokeColor:
return createFromColor(property, style);
case CSSPropertyTransform:
return AnimatableTransform::create(style.transform());
case CSSPropertyTransformOrigin:
ASSERT(RuntimeEnabledFeatures::cssTransformsUnprefixedEnabled());
return AnimatableLengthPoint3D::create(
createFromLength(style.transformOriginX(), style),
createFromLength(style.transformOriginY(), style),
createFromDouble(style.transformOriginZ()));
case CSSPropertyWebkitTransformOriginX:
ASSERT(!RuntimeEnabledFeatures::cssTransformsUnprefixedEnabled());
return createFromLength(style.transformOriginX(), style);
case CSSPropertyWebkitTransformOriginY:
ASSERT(!RuntimeEnabledFeatures::cssTransformsUnprefixedEnabled());
return createFromLength(style.transformOriginY(), style);
case CSSPropertyWebkitTransformOriginZ:
ASSERT(!RuntimeEnabledFeatures::cssTransformsUnprefixedEnabled());
return createFromDouble(style.transformOriginZ());
case CSSPropertyWidows:
return createFromDouble(style.widows());
case CSSPropertyWidth:
return createFromLength(style.width(), style);
case CSSPropertyWordSpacing:
return createFromDouble(style.wordSpacing());
case CSSPropertyVisibility:
return AnimatableVisibility::create(style.visibility());
case CSSPropertyZIndex:
return createFromDouble(style.zIndex());
case CSSPropertyZoom:
return createFromDouble(style.zoom());
default:
ASSERT_NOT_REACHED();
// This return value is to avoid a release crash if possible.
return AnimatableUnknown::create(nullptr);
}
}
开发者ID:coinpayee,项目名称:blink,代码行数:101,代码来源:CSSAnimatableValueFactory.cpp
示例11: lockDatabase
// It is the caller's responsibility to make sure that nobody is trying to create, delete, open, or close databases in this origin while the deletion is
// taking place.
bool DatabaseTracker::deleteOrigin(SecurityOrigin* origin)
{
Vector<String> databaseNames;
{
MutexLocker lockDatabase(m_databaseGuard);
openTrackerDatabase(DontCreateIfDoesNotExist);
if (!m_database.isOpen())
return false;
if (!databaseNamesForOriginNoLock(origin, databaseNames)) {
LOG_ERROR("Unable to retrieve list of database names for origin %s", origin->databaseIdentifier().ascii().data());
return false;
}
if (!canDeleteOrigin(origin)) {
LOG_ERROR("Tried to delete an origin (%s) while either creating database in it or already deleting it", origin->databaseIdentifier().ascii().data());
ASSERT_NOT_REACHED();
return false;
}
recordDeletingOrigin(origin);
}
// We drop the lock here because holding locks during a call to deleteDatabaseFile will deadlock.
for (unsigned i = 0; i < databaseNames.size(); ++i) {
if (!deleteDatabaseFile(origin, databaseNames[i])) {
// Even if the file can't be deleted, we want to try and delete the rest, don't return early here.
LOG_ERROR("Unable to delete file for database %s in origin %s", databaseNames[i].ascii().data(), origin->databaseIdentifier().ascii().data());
}
}
{
MutexLocker lockDatabase(m_databaseGuard);
deleteOriginLockFor(origin);
doneDeletingOrigin(origin);
SQLiteStatement statement(m_database, "DELETE FROM Databases WHERE origin=?");
if (statement.prepare() != SQLResultOk) {
LOG_ERROR("Unable to prepare deletion of databases from origin %s from tracker", origin->databaseIdentifier().ascii().data());
return false;
}
statement.bindText(1, origin->databaseIdentifier());
if (!statement.executeCommand()) {
LOG_ERROR("Unable to execute deletion of databases from origin %s from tracker", origin->databaseIdentifier().ascii().data());
return false;
}
SQLiteStatement originStatement(m_database, "DELETE FROM Origins WHERE origin=?");
if (originStatement.prepare() != SQLResultOk) {
LOG_ERROR("Unable to prepare deletion of origin %s from tracker", origin->databaseIdentifier().ascii().data());
return false;
}
originStatement.bindText(1, origin->databaseIdentifier());
if (!originStatement.executeCommand()) {
LOG_ERROR("Unable to execute deletion of databases from origin %s from tracker", origin->databaseIdentifier().ascii().data());
return false;
}
SQLiteFileSystem::deleteEmptyDatabaseDirectory(originPath(origin));
RefPtr<SecurityOrigin> originPossiblyLastReference = origin;
bool isEmpty = true;
openTrackerDatabase(DontCreateIfDoesNotExist);
if (m_database.isOpen()) {
SQLiteStatement statement(m_database, "SELECT origin FROM Origins");
if (statement.prepare() != SQLResultOk)
LOG_ERROR("Failed to prepare statement.");
else if (statement.step() == SQLResultRow)
isEmpty = false;
}
// If we removed the last origin, do some additional deletion.
if (isEmpty) {
if (m_database.isOpen())
m_database.close();
SQLiteFileSystem::deleteDatabaseFile(trackerDatabasePath());
SQLiteFileSystem::deleteEmptyDatabaseDirectory(m_databaseDirectoryPath);
}
if (m_client) {
m_client->dispatchDidModifyOrigin(origin);
for (unsigned i = 0; i < databaseNames.size(); ++i)
m_client->dispatchDidModifyDatabase(origin, databaseNames[i]);
}
}
return true;
}
开发者ID:ZeusbaseWeb,项目名称:webkit,代码行数:92,代码来源:DatabaseTracker.cpp
示例12: ASSERT
void MediaPlayerPrivateAVFoundation::dispatchNotification()
{
ASSERT(isMainThread());
Notification notification = Notification();
{
MutexLocker lock(m_queueMutex);
if (m_queuedNotifications.isEmpty())
return;
if (!m_delayCallbacks) {
// Only dispatch one notification callback per invocation because they can cause recursion.
notification = m_queuedNotifications.first();
m_queuedNotifications.remove(0);
}
if (!m_queuedNotifications.isEmpty() && !m_mainThreadCallPending)
callOnMainThread(mainThreadCallback, this);
if (!notification.isValid())
return;
}
LOG(Media, "MediaPlayerPrivateAVFoundation::dispatchNotification(%p) - dispatching %s", this, notificationName(notification));
switch (notification.type()) {
case Notification::ItemDidPlayToEndTime:
didEnd();
break;
case Notification::ItemTracksChanged:
tracksChanged();
updateStates();
break;
case Notification::ItemStatusChanged:
updateStates();
break;
case Notification::ItemSeekableTimeRangesChanged:
seekableTimeRangesChanged();
updateStates();
break;
case Notification::ItemLoadedTimeRangesChanged:
loadedTimeRangesChanged();
updateStates();
break;
case Notification::ItemPresentationSizeChanged:
sizeChanged();
updateStates();
break;
case Notification::ItemIsPlaybackLikelyToKeepUpChanged:
updateStates();
break;
case Notification::ItemIsPlaybackBufferEmptyChanged:
updateStates();
break;
case Notification::ItemIsPlaybackBufferFullChanged:
updateStates();
break;
case Notification::PlayerRateChanged:
updateStates();
rateChanged();
break;
case Notification::PlayerTimeChanged:
timeChanged(notification.time());
break;
case Notification::SeekCompleted:
seekCompleted(notification.finished());
break;
case Notification::AssetMetadataLoaded:
metadataLoaded();
updateStates();
break;
case Notification::AssetPlayabilityKnown:
updateStates();
playabilityKnown();
break;
case Notification::DurationChanged:
invalidateCachedDuration();
break;
case Notification::ContentsNeedsDisplay:
contentsNeedsDisplay();
break;
case Notification::InbandTracksNeedConfiguration:
m_inbandTrackConfigurationPending = false;
configureInbandTracks();
break;
case Notification::FunctionType:
notification.function()();
break;
case Notification::TargetIsWirelessChanged:
#if ENABLE(IOS_AIRPLAY)
playbackTargetIsWirelessChanged();
#endif
break;
case Notification::None:
ASSERT_NOT_REACHED();
break;
}
}
开发者ID:Wrichik1999,项目名称:webkit,代码行数:100,代码来源:MediaPlayerPrivateAVFoundation.cpp
示例13: request
void MainResourceLoader::continueAfterContentPolicy(PolicyAction contentPolicy, const ResourceResponse& r)
{
KURL url = request().url();
const String& mimeType = r.mimeType();
switch (contentPolicy) {
case PolicyUse: {
// Prevent remote web archives from loading because they can claim to be from any domain and thus avoid cross-domain security checks (4120255).
bool isRemoteWebArchive = equalIgnoringCase("application/x-webarchive", mimeType) && !m_substituteData.isValid() && !url.isLocalFile();
if (!frameLoader()->canShowMIMEType(mimeType) || isRemoteWebArchive) {
frameLoader()->policyChecker()->cannotShowMIMEType(r);
// Check reachedTerminalState since the load may have already been cancelled inside of _handleUnimplementablePolicyWithErrorCode::.
if (!reachedTerminalState())
stopLoadingForPolicyChange();
return;
}
break;
}
case PolicyDownload:
// m_handle can be null, e.g. when loading a substitute resource from application cache.
if (!m_handle) {
receivedError(cannotShowURLError());
return;
}
frameLoader()->client()->download(m_handle.get(), request(), m_handle.get()->request(), r);
// It might have gone missing
if (frameLoader())
receivedError(interruptionForPolicyChangeError());
return;
case PolicyIgnore:
stopLoadingForPolicyChange();
return;
default:
ASSERT_NOT_REACHED();
}
RefPtr<MainResourceLoader> protect(this);
if (r.isHTTP()) {
int status = r.httpStatusCode();
if (status < 200 || status >= 300) {
bool hostedByObject = frameLoader()->isHostedByObjectElement();
frameLoader()->handleFallbackContent();
// object elements are no longer rendered after we fallback, so don't
// keep trying to process data from their load
if (hostedByObject)
cancel();
}
}
// we may have cancelled this load as part of switching to fallback content
if (!reachedTerminalState())
ResourceLoader::didReceiveResponse(r);
if (frameLoader() && !frameLoader()->isStopping()) {
if (m_substituteData.isValid()) {
if (m_substituteData.content()->size())
didReceiveData(m_substituteData.content()->data(), m_substituteData.content()->size(), m_substituteData.content()->size(), true);
if (frameLoader() && !frameLoader()->isStopping())
didFinishLoading();
} else if (shouldLoadAsEmptyDocument(url) || frameLoader()->representationExistsForURLScheme(url.protocol()))
didFinishLoading();
}
}
开发者ID:ShouqingZhang,项目名称:webkitdriver,代码行数:69,代码来源:MainResourceLoader.cpp
示例14: switch
WebMouseEvent WebInputEventFactory::mouseEvent(HWND hwnd, UINT message,
WPARAM wparam, LPARAM lparam)
{
WebMouseEvent result; //(WebInputEvent::Uninitialized());
switch (message) {
case WM_MOUSEMOVE:
result.type = WebInputEvent::MouseMove;
if (wparam & MK_LBUTTON)
result.button = WebMouseEvent::ButtonLeft;
else if (wparam & MK_MBUTTON)
result.button = WebMouseEvent::ButtonMiddle;
else if (wparam & MK_RBUTTON)
result.button = WebMouseEvent::ButtonRight;
else
result.button = WebMouseEvent::ButtonNone;
break;
case WM_MOUSELEAVE:
result.type = WebInputEvent::MouseLeave;
result.button = WebMouseEvent::ButtonNone;
// set the current mouse position (relative to the client area of the
// current window) since none is specified for this event
lparam = GetRelativeCursorPos(hwnd);
break;
case WM_LBUTTONDOWN:
case WM_LBUTTONDBLCLK:
result.type = WebInputEvent::MouseDown;
result.button = WebMouseEvent::ButtonLeft;
break;
case WM_MBUTTONDOWN:
case WM_MBUTTONDBLCLK:
result.type = WebInputEvent::MouseDown;
result.button = WebMouseEvent::ButtonMiddle;
break;
case WM_RBUTTONDOWN:
case WM_RBUTTONDBLCLK:
result.type = WebInputEvent::MouseDown;
result.button = WebMouseEvent::ButtonRight;
break;
case WM_LBUTTONUP:
result.type = WebInputEvent::MouseUp;
result.button = WebMouseEvent::ButtonLeft;
break;
case WM_MBUTTONUP:
result.type = WebInputEvent::MouseUp;
result.button = WebMouseEvent::ButtonMiddle;
break;
case WM_RBUTTONUP:
result.type = WebInputEvent::MouseUp;
result.button = WebMouseEvent::ButtonRight;
break;
default:
ASSERT_NOT_REACHED();
}
// TODO(pkasting): http://b/1117926 Are we guaranteed that the message that
// GetMessageTime() refers to is the same one that we're passed in? Perhaps
// one of the construction parameters should be the time passed by the
// caller, who would know for sure.
result.timeStampSeconds = GetMessageTime() / 1000.0;
// set position fields:
result.x = static_cast<short>(LOWORD(lparam));
result.y = static_cast<short>(HIWORD(lparam));
result.windowX = result.x;
result.windowY = result.y;
POINT globalPoint = { result.x, result.y };
ClientToScreen(hwnd, &globalPoint);
result.globalX = globalPoint.x;
result.globalY = globalPoint.y;
// calculate number of clicks:
// This differs slightly from the WebKit code in WebKit/win/WebView.cpp
// where their original code looks buggy.
static int lastClickPositionX;
static int lastClickPositionY;
static WebMouseEvent::Button lastClickButton = WebMouseEvent::ButtonLeft;
double currentTime = result.timeStampSeconds;
bool cancelPreviousClick =
(abs(lastClickPositionX - result.x) > (GetSystemMetrics(SM_CXDOUBLECLK) / 2))
|| (abs(lastClickPositionY - result.y) > (GetSystemMetrics(SM_CYDOUBLECLK) / 2))
|| ((currentTime - gLastClickTime) * 1000.0 > GetDoubleClickTime());
if (result.type == WebInputEvent::MouseDown) {
if (!cancelPreviousClick && (result.button == lastClickButton))
++gLastClickCount;
else {
gLastClickCount = 1;
lastClickPositionX = result.x;
lastClickPositionY = result.y;
}
gLastClickTime = currentTime;
lastClickButton = result.button;
} else if (result.type == WebInputEvent::MouseMove
|| result.type == WebInputEvent::MouseLeave) {
//.........这里部分代码省略.........
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:101,代码来源:WebInputEventFactory.cpp
示例15: switch
unsigned FontFace::traitsMask() const
{
unsigned traitsMask = 0;
if (m_style) {
if (!m_style->isPrimitiveValue())
return 0;
switch (toCSSPrimitiveValue(m_style.get())->getValueID()) {
case CSSValueNormal:
traitsMask |= FontStyleNormalMask;
break;
case CSSValueItalic:
case CSSValueOblique:
traitsMask |= FontStyleItalicMask;
break;
default:
break;
}
} else {
traitsMask |= FontStyleNormalMask;
}
if (m_weight) {
if (!m_weight->isPrimitiveValue())
return 0;
switch (toCSSPrimitiveValue(m_weight.get())->getValueID()) {
case CSSValueBold:
case CSSValue700:
traitsMask |= FontWeight700Mask;
break;
case CSSValueNormal:
case CSSValue400:
traitsMask |= FontWeight400Mask;
break;
case CSSValue900:
traitsMask |= FontWeight900Mask;
break;
case CSSValue800:
traitsMask |= FontWeight800Mask;
break;
case CSSValue600:
traitsMask |= FontWeight600Mask;
break;
case CSSValue500:
traitsMask |= FontWeight500Mask;
break;
case CSSValue300:
traitsMask |= FontWeight300Mask;
break;
case CSSValue200:
traitsMask |= FontWeight200Mask;
break;
case CSSValueLighter:
case CSSValue100:
traitsMask |= FontWeight100Mask;
break;
default:
ASSERT_NOT_REACHED();
break;
}
} else {
traitsMask |= FontWeight400Mask;
}
if (RefPtr<CSSValue> fontVariant = m_variant) {
// font-variant descriptor can be a value list.
if (fontVariant->isPrimitiveValue()) {
RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
list->append(fontVariant);
fontVariant = list;
} else if (!fontVariant->isValueList()) {
return 0;
}
CSSValueList* variantList = toCSSValueList(fontVariant.get());
unsigned numVariants = variantList->length();
if (!numVariants)
return 0;
for (unsigned i = 0; i < numVariants; ++i) {
switch (toCSSPrimitiveValue(variantList->itemWithoutBoundsCheck(i))->getValueID()) {
case CSSValueNormal:
traitsMask |= FontVariantNormalMask;
break;
case CSSValueSmallCaps:
traitsMask |= FontVariantSmallCapsMask;
break;
default:
break;
}
}
} else {
traitsMask |= FontVariantNormalMask;
}
return traitsMask;
}
开发者ID:kublaj,项目名称:blink,代码行数:98,代码来源:FontFace.cpp
示例16: TRACE_EVENT2
// Update the existing display items by removing invalidated entries, updating
// repainted ones, and appending new items.
// - For cached drawing display item, copy the corresponding cached DrawingDisplayItem;
// - For cached subsequence display
|
请发表评论