这篇教程C++ ASSERT_NOT_REACHED函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中ASSERT_NOT_REACHED函数的典型用法代码示例。如果您正苦于以下问题:C++ ASSERT_NOT_REACHED函数的具体用法?C++ ASSERT_NOT_REACHED怎么用?C++ ASSERT_NOT_REACHED使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了ASSERT_NOT_REACHED函数的24个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: ASSERT_NOT_REACHEDbool 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,
示例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,
示例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,
示例4: unreachablestatic void unreachable(){ ASSERT_NOT_REACHED(); exit(1);}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:5,
示例5: decodebool 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,
示例6: ASSERTbool 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,
示例7: ASSERT_NOT_REACHEDvoid DOMWindowExtensionNoCache::willDisconnectDOMWindowExtensionFromGlobalObject(WKBundleDOMWindowExtensionRef extension){ // No items should be going into a 0-capacity page cache. ASSERT_NOT_REACHED();}
开发者ID:cheekiatng,项目名称:webkit,代码行数:5,
示例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,
示例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,
示例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,
示例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,
示例12: ASSERTvoid 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,
示例13: requestvoid 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,
示例14: switchWebMouseEvent 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,
示例15: switchunsigned 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,
示例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 item, copy the cached display items between the// corresponding SubsequenceDisplayItem and EndSubsequenceDisplayItem (incl.);// - Otherwise, copy the new display item.//// The algorithm is O(|m_currentDisplayItemList| + |m_newDisplayItemList|).// Coefficients are related to the ratio of out-of-order CachedDisplayItems// and the average number of (Drawing|Subsequence)DisplayItems per client.//void PaintController::commitNewDisplayItemsInternal(){ TRACE_EVENT2("blink,benchmark", "PaintController::commitNewDisplayItems", "current_display_list_size", (int)m_currentPaintArtifact.displayItemList().size(), "num_non_cached_new_items", (int)m_newDisplayItemList.size() - m_numCachedNewItems); m_numCachedNewItems = 0; if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) m_clientsCheckedPaintInvalidation.clear(); // These data structures are used during painting only. ASSERT(m_scopeStack.isEmpty()); m_scopeStack.clear(); m_nextScope = 1; ASSERT(!skippingCache());#if ENABLE(ASSERT) m_newDisplayItemIndicesByClient.clear(); m_clientsWithPaintOffsetInvalidations.clear(); m_invalidations.clear();#endif if (m_currentPaintArtifact.isEmpty()) {#if ENABLE(ASSERT) for (const auto& item : m_newDisplayItemList) ASSERT(!item.isCached());#endif m_currentPaintArtifact = PaintArtifact(std::move(m_newDisplayItemList), m_newPaintChunks.releasePaintChunks()); m_newDisplayItemList = DisplayItemList(kInitialDisplayItemListCapacityBytes); m_validlyCachedClientsDirty = true; return; } updateValidlyCachedClientsIfNeeded(); // Stores indices to valid DrawingDisplayItems in m_currentDisplayItems that have not been matched // by CachedDisplayItems during synchronized matching. The indexed items will be matched // by later out-of-order CachedDisplayItems in m_newDisplayItemList. This ensures that when // out-of-order CachedDisplayItems occur, we only traverse at most once over m_currentDisplayItems // looking for potential matches. Thus we can ensure that the algorithm runs in linear time. OutOfOrderIndexContext outOfOrderIndexContext(m_currentPaintArtifact.displayItemList().begin()); // TODO(jbroman): Consider revisiting this heuristic. DisplayItemList updatedList(std::max(m_currentPaintArtifact.displayItemList().usedCapacityInBytes(), m_newDisplayItemList.usedCapacityInBytes())); Vector<PaintChunk> updatedPaintChunks; DisplayItemList::iterator currentIt = m_currentPaintArtifact.displayItemList().begin(); DisplayItemList::iterator currentEnd = m_currentPaintArtifact.displayItemList().end(); for (DisplayItemList::iterator newIt = m_newDisplayItemList.begin(); newIt != m_newDisplayItemList.end(); ++newIt) { const DisplayItem& newDisplayItem = *newIt; const DisplayItem::Id newDisplayItemId = newDisplayItem.nonCachedId(); bool newDisplayItemHasCachedType = newDisplayItem.type() != newDisplayItemId.type; bool isSynchronized = currentIt != currentEnd && newDisplayItemId.matches(*currentIt); if (newDisplayItemHasCachedType) { ASSERT(newDisplayItem.isCached()); ASSERT(clientCacheIsValid(newDisplayItem.client()) || (RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled() && !paintOffsetWasInvalidated(newDisplayItem.client()))); if (!isSynchronized) { currentIt = findOutOfOrderCachedItem(newDisplayItemId, outOfOrderIndexContext); if (currentIt == currentEnd) {#ifndef NDEBUG showDebugData(); WTFLogAlways("%s not found in m_currentDisplayItemList/n", newDisplayItem.asDebugString().utf8().data());#endif ASSERT_NOT_REACHED(); // We did not find the cached display item. This should be impossible, but may occur if there is a bug // in the system, such as under-invalidation, incorrect cache checking or duplicate display ids. // In this case, attempt to recover rather than crashing or bailing on display of the rest of the display list. continue; } }#if ENABLE(ASSERT) if (RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEnabled()) { DisplayItemList::iterator temp = currentIt; checkUnderInvalidation(newIt, temp); }#endif if (newDisplayItem.isCachedDrawing()) { updatedList.appendByMoving(*currentIt); ++currentIt; } else { ASSERT(newDisplayItem.type() == DisplayItem::CachedSubsequence); copyCachedSubsequence(currentIt, updatedList); ASSERT(updatedList.last().type() == DisplayItem::EndSubsequence); } } else { ASSERT(!newDisplayItem.isDrawing() || newDisplayItem.skippedCache() || !clientCacheIsValid(newDisplayItem.client())//.........这里部分代码省略.........
开发者ID:mtucker6784,项目名称:chromium,代码行数:101,
示例17: ASSERT_NOT_REACHEDvoid CCSingleThreadProxy::setNeedsAnimate(){ // CCThread-only feature ASSERT_NOT_REACHED();}
开发者ID:conioh,项目名称:os-design,代码行数:5,
示例18: switchLayoutListMarker::ListStyleCategory LayoutListMarker::listStyleCategory() const{ switch (style()->listStyleType()) { case NoneListStyle: return ListStyleCategory::None; case Disc: case Circle: case Square: return ListStyleCategory::Symbol; case ArabicIndic: case Armenian: case Bengali: case Cambodian: case CJKIdeographic: case CjkEarthlyBranch: case CjkHeavenlyStem: case DecimalLeadingZero: case DecimalListStyle: case Devanagari: case EthiopicHalehame: case EthiopicHalehameAm: case EthiopicHalehameTiEr: case EthiopicHalehameTiEt: case Georgian: case Gujarati: case Gurmukhi: case Hangul: case HangulConsonant: case Hebrew: case Hiragana: case HiraganaIroha: case Kannada: case Katakana: case KatakanaIroha: case Khmer: case KoreanHangulFormal: case KoreanHanjaFormal: case KoreanHanjaInformal: case Lao: case LowerAlpha: case LowerArmenian: case LowerGreek: case LowerLatin: case LowerRoman: case Malayalam: case Mongolian: case Myanmar: case Oriya: case Persian: case SimpChineseFormal: case SimpChineseInformal: case Telugu: case Thai: case Tibetan: case TradChineseFormal: case TradChineseInformal: case UpperAlpha: case UpperArmenian: case UpperLatin: case UpperRoman: case Urdu: return ListStyleCategory::Language; default: ASSERT_NOT_REACHED(); return ListStyleCategory::Language; }}
开发者ID:astojilj,项目名称:chromium-crosswalk,代码行数:67,
示例19: ASSERT_NOT_REACHEDvoid SVGImage::setContainerSize(const IntSize&){ // SVGImageCache already intercepted this call, as it stores & caches the desired container sizes & zoom levels. ASSERT_NOT_REACHED();}
开发者ID:jiezh,项目名称:h5vcc,代码行数:5,
示例20: toCSSTransformValue//.........这里部分代码省略......... if (transformValue->operationType() == CSSTransformValue::RotateXTransformOperation) x = 1; else if (transformValue->operationType() == CSSTransformValue::RotateYTransformOperation) y = 1; else z = 1; operations.operations().append(RotateTransformOperation::create(x, y, z, angle, getTransformOperationType(transformValue->operationType()))); break; } case CSSTransformValue::Rotate3DTransformOperation: { if (transformValue->length() < 4) break; CSSPrimitiveValue* secondValue = toCSSPrimitiveValue(transformValue->item(1)); CSSPrimitiveValue* thirdValue = toCSSPrimitiveValue(transformValue->item(2)); CSSPrimitiveValue* fourthValue = toCSSPrimitiveValue(transformValue->item(3)); double x = firstValue->getDoubleValue(); double y = secondValue->getDoubleValue(); double z = thirdValue->getDoubleValue(); double angle = fourthValue->computeDegrees(); operations.operations().append(RotateTransformOperation::create(x, y, z, angle, getTransformOperationType(transformValue->operationType()))); break; } case CSSTransformValue::SkewTransformOperation: case CSSTransformValue::SkewXTransformOperation: case CSSTransformValue::SkewYTransformOperation: { double angleX = 0; double angleY = 0; double angle = firstValue->computeDegrees(); if (transformValue->operationType() == CSSTransformValue::SkewYTransformOperation) angleY = angle; else { angleX = angle; if (transformValue->operationType() == CSSTransformValue::SkewTransformOperation) { if (transformValue->length() > 1) { CSSPrimitiveValue* secondValue = toCSSPrimitiveValue(transformValue->item(1)); angleY = secondValue->computeDegrees(); } } } operations.operations().append(SkewTransformOperation::create(angleX, angleY, getTransformOperationType(transformValue->operationType()))); break; } case CSSTransformValue::MatrixTransformOperation: { if (transformValue->length() < 6) break; double a = firstValue->getDoubleValue(); double b = toCSSPrimitiveValue(transformValue->item(1))->getDoubleValue(); double c = toCSSPrimitiveValue(transformValue->item(2))->getDoubleValue(); double d = toCSSPrimitiveValue(transformValue->item(3))->getDoubleValue(); double e = toCSSPrimitiveValue(transformValue->item(4))->getDoubleValue(); double f = toCSSPrimitiveValue(transformValue->item(5))->getDoubleValue(); operations.operations().append(MatrixTransformOperation::create(a, b, c, d, e, f)); break; } case CSSTransformValue::Matrix3DTransformOperation: { if (transformValue->length() < 16) break; TransformationMatrix matrix(toCSSPrimitiveValue(transformValue->item(0))->getDoubleValue(), toCSSPrimitiveValue(transformValue->item(1))->getDoubleValue(), toCSSPrimitiveValue(transformValue->item(2))->getDoubleValue(), toCSSPrimitiveValue(transformValue->item(3))->getDoubleValue(), toCSSPrimitiveValue(transformValue->item(4))->getDoubleValue(), toCSSPrimitiveValue(transformValue->item(5))->getDoubleValue(), toCSSPrimitiveValue(transformValue->item(6))->getDoubleValue(), toCSSPrimitiveValue(transformValue->item(7))->getDoubleValue(), toCSSPrimitiveValue(transformValue->item(8))->getDoubleValue(), toCSSPrimitiveValue(transformValue->item(9))->getDoubleValue(), toCSSPrimitiveValue(transformValue->item(10))->getDoubleValue(), toCSSPrimitiveValue(transformValue->item(11))->getDoubleValue(), toCSSPrimitiveValue(transformValue->item(12))->getDoubleValue(), toCSSPrimitiveValue(transformValue->item(13))->getDoubleValue(), toCSSPrimitiveValue(transformValue->item(14))->getDoubleValue(), toCSSPrimitiveValue(transformValue->item(15))->getDoubleValue()); operations.operations().append(Matrix3DTransformOperation::create(matrix)); break; } case CSSTransformValue::PerspectiveTransformOperation: { double p; if (firstValue->isLength()) p = firstValue->computeLength<double>(conversionData); else { // This is a quirk that should go away when 3d transforms are finalized. double val = firstValue->getDoubleValue(); if (val < 0) return false; p = clampToPositiveInteger(val); } operations.operations().append(PerspectiveTransformOperation::create(p)); break; } case CSSTransformValue::UnknownTransformOperation: ASSERT_NOT_REACHED(); break; } } outOperations = operations; return true;}
开发者ID:Jamesducque,项目名称:mojo,代码行数:101,
示例21: ENABLEPassRefPtr<SimpleFontData> CSSFontFaceSource::getFontData(const FontDescription& fontDescription){ // If the font hasn't loaded or an error occurred, then we've got nothing. if (!isValid()) return 0; if (isLocal()) { // We're local. Just return a SimpleFontData from the normal cache. // We don't want to check alternate font family names here, so pass true as the checkingAlternateName parameter. RefPtr<SimpleFontData> fontData = FontCache::fontCache()->getFontData(fontDescription, m_string, true); m_histograms.recordLocalFont(fontData); return fontData; } // See if we have a mapping in our FontData cache. AtomicString emptyFontFamily = ""; FontCacheKey key = fontDescription.cacheKey(emptyFontFamily); RefPtr<SimpleFontData>& fontData = m_fontDataTable.add(key.hash(), 0).storedValue->value; if (fontData) return fontData; // No release, because fontData is a reference to a RefPtr that is held in the m_fontDataTable. // If we are still loading, then we let the system pick a font. if (isLoaded()) { if (m_font) {#if ENABLE(SVG_FONTS) if (m_hasExternalSVGFont) { // For SVG fonts parse the external SVG document, and extract the <font> element. if (!m_font->ensureSVGFontData()) return 0; if (!m_externalSVGFontElement) { String fragmentIdentifier; size_t start = m_string.find('#'); if (start != kNotFound) fragmentIdentifier = m_string.string().substring(start + 1); m_externalSVGFontElement = m_font->getSVGFontById(fragmentIdentifier); } if (!m_externalSVGFontElement) return 0; SVGFontFaceElement* fontFaceElement = 0; // Select first <font-face> child for (Node* fontChild = m_externalSVGFontElement->firstChild(); fontChild; fontChild = fontChild->nextSibling()) { if (fontChild->hasTagName(SVGNames::font_faceTag)) { fontFaceElement = toSVGFontFaceElement(fontChild); break; } } if (fontFaceElement) { if (!m_svgFontFaceElement) { // We're created using a CSS @font-face rule, that means we're not associated with a SVGFontFaceElement. // Use the imported <font-face> tag as referencing font-face element for these cases. m_svgFontFaceElement = fontFaceElement; } fontData = SimpleFontData::create( SVGFontData::create(fontFaceElement), fontDescription.effectiveFontSize(), fontDescription.isSyntheticBold(), fontDescription.isSyntheticItalic()); } } else#endif { // Create new FontPlatformData from our CGFontRef, point size and ATSFontRef. if (!m_font->ensureCustomFontData()) return 0; fontData = SimpleFontData::create( m_font->platformDataFromCustomData(fontDescription.effectiveFontSize(), fontDescription.isSyntheticBold(), fontDescription.isSyntheticItalic(), fontDescription.orientation(), fontDescription.widthVariant()), CustomFontData::create(false)); } } else {#if ENABLE(SVG_FONTS) // In-Document SVG Fonts if (m_svgFontFaceElement) { fontData = SimpleFontData::create( SVGFontData::create(m_svgFontFaceElement.get()), fontDescription.effectiveFontSize(), fontDescription.isSyntheticBold(), fontDescription.isSyntheticItalic()); }#endif } } else { // This temporary font is not retained and should not be returned. FontCachePurgePreventer fontCachePurgePreventer; SimpleFontData* temporaryFont = FontCache::fontCache()->getNonRetainedLastResortFallbackFont(fontDescription); if (!temporaryFont) { ASSERT_NOT_REACHED(); return 0; } RefPtr<CSSCustomFontData> cssFontData = CSSCustomFontData::create(true); cssFontData->setCSSFontFaceSource(this); fontData = SimpleFontData::create(temporaryFont->platformData(), cssFontData);//.........这里部分代码省略.........
开发者ID:Tkkg1994,项目名称:Platfrom-kccat6,代码行数:101,
示例22: ASSERTFilterOperations FilterOperationResolver::createFilterOperations(StyleResolverState& state, const CSSValue& inValue){ FilterOperations operations; if (inValue.isPrimitiveValue()) { ASSERT(toCSSPrimitiveValue(inValue).getValueID() == CSSValueNone); return operations; } const CSSToLengthConversionData& conversionData = state.cssToLengthConversionData(); for (auto& currValue : toCSSValueList(inValue)) { CSSFunctionValue* filterValue = toCSSFunctionValue(currValue.get()); FilterOperation::OperationType operationType = filterOperationForType(filterValue->functionType()); countFilterUse(operationType, state.document()); ASSERT(filterValue->length() <= 1); if (operationType == FilterOperation::REFERENCE) { CSSSVGDocumentValue* svgDocumentValue = toCSSSVGDocumentValue(filterValue->item(0)); KURL url = state.document().completeURL(svgDocumentValue->url()); RefPtrWillBeRawPtr<ReferenceFilterOperation> operation = ReferenceFilterOperation::create(svgDocumentValue->url(), AtomicString(url.fragmentIdentifier())); if (SVGURIReference::isExternalURIReference(svgDocumentValue->url(), state.document())) { if (!svgDocumentValue->loadRequested()) state.elementStyleResources().addPendingSVGDocument(operation.get(), svgDocumentValue); else if (svgDocumentValue->cachedSVGDocument()) ReferenceFilterBuilder::setDocumentResourceReference(operation.get(), adoptPtr(new DocumentResourceReference(svgDocumentValue->cachedSVGDocument()))); } operations.operations().append(operation); continue; } CSSPrimitiveValue* firstValue = filterValue->length() && filterValue->item(0)->isPrimitiveValue() ? toCSSPrimitiveValue(filterValue->item(0)) : nullptr; switch (filterValue->functionType()) { case CSSValueGrayscale: case CSSValueSepia: case CSSValueSaturate: { double amount = 1; if (filterValue->length() == 1) { amount = firstValue->getDoubleValue(); if (firstValue->isPercentage()) amount /= 100; } operations.operations().append(BasicColorMatrixFilterOperation::create(amount, operationType)); break; } case CSSValueHueRotate: { double angle = 0; if (filterValue->length() == 1) angle = firstValue->computeDegrees(); operations.operations().append(BasicColorMatrixFilterOperation::create(angle, operationType)); break; } case CSSValueInvert: case CSSValueBrightness: case CSSValueContrast: case CSSValueOpacity: { double amount = (filterValue->functionType() == CSSValueBrightness) ? 0 : 1; if (filterValue->length() == 1) { amount = firstValue->getDoubleValue(); if (firstValue->isPercentage()) amount /= 100; } operations.operations().append(BasicComponentTransferFilterOperation::create(amount, operationType)); break; } case CSSValueBlur: { Length stdDeviation = Length(0, Fixed); if (filterValue->length() >= 1) stdDeviation = firstValue->convertToLength(conversionData); operations.operations().append(BlurFilterOperation::create(stdDeviation)); break; } case CSSValueDropShadow: { CSSShadowValue* item = toCSSShadowValue(filterValue->item(0)); IntPoint location(item->x->computeLength<int>(conversionData), item->y->computeLength<int>(conversionData)); int blur = item->blur ? item->blur->computeLength<int>(conversionData) : 0; Color shadowColor = Color::black; if (item->color) shadowColor = state.document().textLinkColors().colorFromCSSValue(*item->color, state.style()->color()); operations.operations().append(DropShadowFilterOperation::create(location, blur, shadowColor)); break; } default: ASSERT_NOT_REACHED(); break; } } return operations;}
开发者ID:azureplus,项目名称:chromium,代码行数:94,
示例23: createPathForGlyphstatic CGPathRef createPathForGlyph(HDC hdc, Glyph glyph){ CGMutablePathRef path = CGPathCreateMutable(); static const MAT2 identity = { 0, 1, 0, 0, 0, 0, 0, 1 }; GLYPHMETRICS glyphMetrics; // GGO_NATIVE matches the outline perfectly when Windows font smoothing is off. // GGO_NATIVE | GGO_UNHINTED does not match perfectly either when Windows font smoothing is on or off. DWORD outlineLength = GetGlyphOutline(hdc, glyph, GGO_GLYPH_INDEX | GGO_NATIVE, &glyphMetrics, 0, 0, &identity); ASSERT(outlineLength >= 0); if (outlineLength < 0) return path; Vector<UInt8> outline(outlineLength); GetGlyphOutline(hdc, glyph, GGO_GLYPH_INDEX | GGO_NATIVE, &glyphMetrics, outlineLength, outline.data(), &identity); unsigned offset = 0; while (offset < outlineLength) { LPTTPOLYGONHEADER subpath = reinterpret_cast<LPTTPOLYGONHEADER>(outline.data() + offset); ASSERT(subpath->dwType == TT_POLYGON_TYPE); if (subpath->dwType != TT_POLYGON_TYPE) return path; CGPathMoveToPoint(path, 0, toCGFloat(subpath->pfxStart.x), toCGFloat(subpath->pfxStart.y)); unsigned subpathOffset = sizeof(*subpath); while (subpathOffset < subpath->cb) { LPTTPOLYCURVE segment = reinterpret_cast<LPTTPOLYCURVE>(reinterpret_cast<UInt8*>(subpath) + subpathOffset); switch (segment->wType) { case TT_PRIM_LINE: for (unsigned i = 0; i < segment->cpfx; i++) CGPathAddLineToPoint(path, 0, toCGFloat(segment->apfx[i].x), toCGFloat(segment->apfx[i].y)); break; case TT_PRIM_QSPLINE: for (unsigned i = 0; i < segment->cpfx; i++) { CGFloat x = toCGFloat(segment->apfx[i].x); CGFloat y = toCGFloat(segment->apfx[i].y); CGFloat cpx; CGFloat cpy; if (i == segment->cpfx - 2) { cpx = toCGFloat(segment->apfx[i + 1].x); cpy = toCGFloat(segment->apfx[i + 1].y); i++; } else { cpx = (toCGFloat(segment->apfx[i].x) + toCGFloat(segment->apfx[i + 1].x)) / 2; cpy = (toCGFloat(segment->apfx[i].y) + toCGFloat(segment->apfx[i + 1].y)) / 2; } CGPathAddQuadCurveToPoint(path, 0, x, y, cpx, cpy); } break; case TT_PRIM_CSPLINE: for (unsigned i = 0; i < segment->cpfx; i += 3) { CGFloat cp1x = toCGFloat(segment->apfx[i].x); CGFloat cp1y = toCGFloat(segment->apfx[i].y); CGFloat cp2x = toCGFloat(segment->apfx[i + 1].x); CGFloat cp2y = toCGFloat(segment->apfx[i + 1].y); CGFloat x = toCGFloat(segment->apfx[i + 2].x); CGFloat y = toCGFloat(segment->apfx[i + 2].y); CGPathAddCurveToPoint(path, 0, cp1x, cp1y, cp2x, cp2y, x, y); } break; default: ASSERT_NOT_REACHED(); return path; } subpathOffset += sizeof(*segment) + (segment->cpfx - 1) * sizeof(segment->apfx[0]); } CGPathCloseSubpath(path); offset += subpath->cb; } return path;}
开发者ID:boyliang,项目名称:ComponentSuperAccessor,代码行数:79,
示例24: ASSERT_NOT_REACHEDSVGFilterEffect* SVGFEMergeElement::filterEffect(SVGResourceFilter* filter) const{ ASSERT_NOT_REACHED(); return 0;}
开发者ID:Fale,项目名称:qtmoko,代码行数:5,
注:本文中的ASSERT_NOT_REACHED函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ ASSERT_NO_FATAL_FAILURE函数代码示例 C++ ASSERT_NOT_OK函数代码示例 |