Beispiel #1
0
void IDBTransaction::setActive(bool active) {
  DCHECK_NE(m_state, Finished) << "A finished transaction tried to setActive("
                               << (active ? "true" : "false") << ")";
  if (m_state == Finishing)
    return;
  DCHECK_NE(active, (m_state == Active));
  m_state = active ? Active : Inactive;

  if (!active && m_requestList.isEmpty() && backendDB())
    backendDB()->commit(m_id);
}
Beispiel #2
0
void FetchRequest::setCrossOriginAccessControl(
    SecurityOrigin* origin,
    CrossOriginAttributeValue crossOrigin) {
  DCHECK_NE(crossOrigin, CrossOriginAttributeNotSet);
  const bool useCredentials = crossOrigin == CrossOriginAttributeUseCredentials;
  const bool isSameOriginRequest =
      origin && origin->canRequestNoSuborigin(m_resourceRequest.url());

  // Currently FetchRequestMode and FetchCredentialsMode are only used when the
  // request goes to Service Worker.
  m_resourceRequest.setFetchRequestMode(WebURLRequest::FetchRequestModeCORS);
  m_resourceRequest.setFetchCredentialsMode(
      useCredentials ? WebURLRequest::FetchCredentialsModeInclude
                     : WebURLRequest::FetchCredentialsModeSameOrigin);

  m_options.allowCredentials = (isSameOriginRequest || useCredentials)
                                   ? AllowStoredCredentials
                                   : DoNotAllowStoredCredentials;
  m_options.corsEnabled = IsCORSEnabled;
  m_options.securityOrigin = origin;
  m_options.credentialsRequested = useCredentials
                                       ? ClientRequestedCredentials
                                       : ClientDidNotRequestCredentials;

  updateRequestForAccessControl(m_resourceRequest, origin,
                                m_options.allowCredentials);
}
Beispiel #3
0
void ClientOSRenderer::Initialize() {
  if (initialized_)
    return;

  glHint(GL_POLYGON_SMOOTH_HINT, GL_NICEST); VERIFY_NO_ERROR;

  glClearColor(0.0f, 0.0f, 0.0f, 1.0f); VERIFY_NO_ERROR;

  // Necessary for non-power-of-2 textures to render correctly.
  glPixelStorei(GL_UNPACK_ALIGNMENT, 1); VERIFY_NO_ERROR;

  // Create the texture.
  glGenTextures(1, &texture_id_); VERIFY_NO_ERROR;
  DCHECK_NE(texture_id_, 0U); VERIFY_NO_ERROR;

  glBindTexture(GL_TEXTURE_2D, texture_id_); VERIFY_NO_ERROR;
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
                  GL_NEAREST); VERIFY_NO_ERROR;
  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER,
                  GL_NEAREST); VERIFY_NO_ERROR;
  glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); VERIFY_NO_ERROR;
  const GLubyte* byth = glGetString(GL_VERSION);
  byth = glGetString(GL_VENDOR);
  byth = glGetString(GL_RENDERER);
  byth = glGetString(GL_EXTENSIONS);
  //OutputDebugStringA((char*)byth);
  //Gdiplus::GdiplusStartupInput StartupInput;
  //GdiplusStartup(&m_gdiplusToken, &StartupInput, NULL);
  initialized_ = true;
}
Beispiel #4
0
inline void TreeScopeAdopter::moveNodeToNewDocument(
    Node& node,
    Document& oldDocument,
    Document& newDocument) const {
  DCHECK_NE(oldDocument, newDocument);

  if (node.hasRareData()) {
    NodeRareData* rareData = node.rareData();
    if (rareData->nodeLists())
      rareData->nodeLists()->adoptDocument(oldDocument, newDocument);
  }

  oldDocument.moveNodeIteratorsToNewDocument(node, newDocument);

  if (node.getCustomElementState() == CustomElementState::Custom) {
    Element& element = toElement(node);
    CustomElement::enqueueAdoptedCallback(&element, &oldDocument, &newDocument);
  }

  if (node.isShadowRoot())
    toShadowRoot(node).setDocument(newDocument);

#if DCHECK_IS_ON()
  didMoveToNewDocumentWasCalled = false;
  oldDocumentDidMoveToNewDocumentWasCalledWith = &oldDocument;
#endif

  node.didMoveToNewDocument(oldDocument);
#if DCHECK_IS_ON()
  DCHECK(didMoveToNewDocumentWasCalled);
#endif
}
Element* SlotScopedTraversal::previous(const Element& current) {
  Element* nearestInclusiveAncestorAssignedToSlot =
      SlotScopedTraversal::nearestInclusiveAncestorAssignedToSlot(current);
  DCHECK(nearestInclusiveAncestorAssignedToSlot);

  if (current != nearestInclusiveAncestorAssignedToSlot) {
    // Search within children of an element which is assigned to a slot.
    Element* previous = previousSkippingChildrenOfShadowHost(
        current, *nearestInclusiveAncestorAssignedToSlot);
    DCHECK(previous);
    return previous;
  }

  // Seek to the previous element assigned to the same slot.
  const HeapVector<Member<Node>>& assignedNodes =
      nearestInclusiveAncestorAssignedToSlot->assignedSlot()->assignedNodes();
  size_t currentIndex =
      assignedNodes.reverseFind(*nearestInclusiveAncestorAssignedToSlot);
  DCHECK_NE(currentIndex, kNotFound);
  for (; currentIndex > 0; --currentIndex) {
    const Member<Node> assignedNode = assignedNodes[currentIndex - 1];
    if (!assignedNode->isElementNode())
      continue;
    return lastWithinOrSelfSkippingChildrenOfShadowHost(
        *toElement(assignedNode));
  }
  return nullptr;
}
 /**
  * @brief Make a TypedValue of this Type.
  *
  * @param value_ptr An untyped pointer to the data which will be represented
  *        as a TypedValue.
  * @param value_size The size of the data at value_ptr in bytes. This may be
  *        omitted for numeric types, but must be explicitly specified for any
  *        other type. For Char and VarChar, this should include the
  *        terminating null character, if any.
  * @return A TypedValue representing the data at value_ptr.
  **/
 inline TypedValue makeValue(const void* value_ptr,
                             const std::size_t value_size = 0) const {
   DCHECK(value_ptr != nullptr);
   switch (type_id_) {
     case kInt:
       return TypedValue(*static_cast<const int*>(value_ptr));
     case kLong:
       return TypedValue(*static_cast<const std::int64_t*>(value_ptr));
     case kFloat:
       return TypedValue(*static_cast<const float*>(value_ptr));
     case kDouble:
       return TypedValue(*static_cast<const double*>(value_ptr));
     case kDatetime:
       return TypedValue(*static_cast<const DatetimeLit*>(value_ptr));
     case kDatetimeInterval:
       return TypedValue(*static_cast<const DatetimeIntervalLit*>(value_ptr));
     case kYearMonthInterval:
       return TypedValue(*static_cast<const YearMonthIntervalLit*>(value_ptr));
     case kNullType: {
       LOG(FATAL) << "Calling makeValue() to make a non-null value for "
                  << "NullType, which is impossible.";
     }
     default:
       DCHECK_NE(value_size, 0u);
       DCHECK_LE(value_size, maximum_byte_length_);
       return TypedValue(type_id_, value_ptr, value_size);
   }
 }
Beispiel #7
0
void IDBTransaction::revertDatabaseMetadata() {
  DCHECK_NE(m_state, Active);
  if (!isVersionChange())
    return;

  // Mark stores created by this transaction as deleted.
  for (auto& objectStore : m_objectStoreMap.values()) {
    const int64_t objectStoreId = objectStore->id();
    if (!objectStore->isNewlyCreated()) {
      DCHECK(m_oldStoreMetadata.contains(objectStore));
      continue;
    }

    DCHECK(!m_oldStoreMetadata.contains(objectStore));
    m_database->revertObjectStoreCreation(objectStoreId);
    objectStore->markDeleted();
  }

  for (auto& it : m_oldStoreMetadata) {
    IDBObjectStore* objectStore = it.key;
    RefPtr<IDBObjectStoreMetadata> oldMetadata = it.value;

    m_database->revertObjectStoreMetadata(oldMetadata);
    objectStore->revertMetadata(oldMetadata);
  }
  for (auto& index : m_deletedIndexes)
    index->objectStore()->revertDeletedIndexMetadata(*index);
  for (auto& oldMedata : m_deletedObjectStores)
    m_database->revertObjectStoreMetadata(std::move(oldMedata));

  // We only need to revert the database's own metadata because we have reverted
  // the metadata for the database's object stores above.
  m_database->setDatabaseMetadata(m_oldDatabaseMetadata);
}
DateTimeNumericFieldElement::DateTimeNumericFieldElement(
    Document& document,
    FieldOwner& fieldOwner,
    const Range& range,
    const Range& hardLimits,
    const String& placeholder,
    const DateTimeNumericFieldElement::Step& step)
    : DateTimeFieldElement(document, fieldOwner),
      m_placeholder(placeholder),
      m_range(range),
      m_hardLimits(hardLimits),
      m_step(step),
      m_value(0),
      m_hasValue(false) {
  DCHECK_NE(m_step.step, 0);
  DCHECK_LE(m_range.minimum, m_range.maximum);
  DCHECK_LE(m_hardLimits.minimum, m_hardLimits.maximum);

  // We show a direction-neutral string such as "--" as a placeholder. It
  // should follow the direction of numeric values.
  if (localeForOwner().isRTL()) {
    CharDirection dir = direction(formatValue(this->maximum())[0]);
    if (dir == LeftToRight || dir == EuropeanNumber || dir == ArabicNumber) {
      setInlineStyleProperty(CSSPropertyUnicodeBidi, CSSValueBidiOverride);
      setInlineStyleProperty(CSSPropertyDirection, CSSValueLtr);
    }
  }
}
void MixedContentChecker::handleCertificateError(
    LocalFrame* frame,
    const ResourceResponse& response,
    WebURLRequest::FrameType frameType,
    WebURLRequest::RequestContext requestContext) {
  Frame* effectiveFrame = effectiveFrameForFrameType(frame, frameType);
  if (frameType == WebURLRequest::FrameTypeTopLevel || !effectiveFrame)
    return;

  // Use the current local frame's client; the embedder doesn't distinguish
  // mixed content signals from different frames on the same page.
  FrameLoaderClient* client = frame->loader().client();
  bool strictMixedContentCheckingForPlugin =
      effectiveFrame->settings() &&
      effectiveFrame->settings()->strictMixedContentCheckingForPlugin();
  WebMixedContent::ContextType contextType =
      WebMixedContent::contextTypeFromRequestContext(
          requestContext, strictMixedContentCheckingForPlugin);
  if (contextType == WebMixedContent::ContextType::Blockable) {
    client->didRunContentWithCertificateErrors(response.url());
  } else {
    // contextTypeFromRequestContext() never returns NotMixedContent (it
    // computes the type of mixed content, given that the content is mixed).
    DCHECK_NE(contextType, WebMixedContent::ContextType::NotMixedContent);
    client->didDisplayContentWithCertificateErrors(response.url());
  }
}
Beispiel #10
0
void ClientOSRenderer::OnPaint(CefRefPtr<CefBrowser> browser,
                               CefRenderHandler::PaintElementType type,
                               const CefRenderHandler::RectList& dirtyRects,
                               const void* buffer, int width, int height) {
  if (!initialized_)
    Initialize();

  if (transparent_) {
    // Enable alpha blending.
    glEnable(GL_BLEND); VERIFY_NO_ERROR;
  }

  // Enable 2D textures.
  glEnable(GL_TEXTURE_2D); VERIFY_NO_ERROR;

  DCHECK_NE(texture_id_, 0U);
  glBindTexture(GL_TEXTURE_2D, texture_id_); VERIFY_NO_ERROR;

  if (type == PET_VIEW) {
    int old_width = view_width_;
    int old_height = view_height_;

    view_width_ = width;
	view_height_ = height;

	{
		int linebyte = (((width << 5) + 31) >> 5) << 2;

		int lineInval = 4 - ((width << 5) >> 3) & 3;
	}

    if (show_update_rect_)
      update_rect_ = dirtyRects[0];

    glPixelStorei(GL_UNPACK_ROW_LENGTH, view_width_); VERIFY_NO_ERROR;

    if (old_width != view_width_ || old_height != view_height_ ||
        (dirtyRects.size() == 1 &&
         dirtyRects[0] == CefRect(0, 0, view_width_, view_height_))) {
      // Update/resize the whole texture.
      glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); VERIFY_NO_ERROR;
      glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); VERIFY_NO_ERROR;	
	  test32Bmp(buffer, width, height);
      glTexImage2D(
          GL_TEXTURE_2D, 0, GL_RGBA, view_width_, view_height_, 0,
          GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, buffer); VERIFY_NO_ERROR;
    } else {
      // Update just the dirty rectangles.
      CefRenderHandler::RectList::const_iterator i = dirtyRects.begin();
      for (; i != dirtyRects.end(); ++i) {
        const CefRect& rect = *i;
        glPixelStorei(GL_UNPACK_SKIP_PIXELS, rect.x); VERIFY_NO_ERROR;
        glPixelStorei(GL_UNPACK_SKIP_ROWS, rect.y); VERIFY_NO_ERROR;
		test32Bmp(buffer, width, height);
        glTexSubImage2D(GL_TEXTURE_2D, 0, rect.x, rect.y, rect.width,
                        rect.height, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
                        buffer); VERIFY_NO_ERROR;
      }
    }
  } else if (type == PET_POPUP && popup_rect_.width > 0 &&
Beispiel #11
0
void IDBTransaction::onAbort(DOMException* error) {
  IDB_TRACE("IDBTransaction::onAbort");
  if (!getExecutionContext()) {
    finished();
    return;
  }

  DCHECK_NE(m_state, Finished);
  if (m_state != Finishing) {
    // Abort was not triggered by front-end.
    DCHECK(error);
    setError(error);

    abortOutstandingRequests();
    revertDatabaseMetadata();

    m_state = Finishing;
  }

  if (isVersionChange())
    m_database->close();

  // Enqueue events before notifying database, as database may close which
  // enqueues more events and order matters.
  enqueueEvent(Event::createBubble(EventTypeNames::abort));
  finished();
}
Beispiel #12
0
DispatchEventResult IDBTransaction::dispatchEventInternal(Event* event) {
  IDB_TRACE("IDBTransaction::dispatchEvent");
  if (!getExecutionContext()) {
    m_state = Finished;
    return DispatchEventResult::CanceledBeforeDispatch;
  }
  DCHECK_NE(m_state, Finished);
  DCHECK(m_hasPendingActivity);
  DCHECK(getExecutionContext());
  DCHECK_EQ(event->target(), this);
  m_state = Finished;

  HeapVector<Member<EventTarget>> targets;
  targets.append(this);
  targets.append(db());

  // FIXME: When we allow custom event dispatching, this will probably need to
  // change.
  DCHECK(event->type() == EventTypeNames::complete ||
         event->type() == EventTypeNames::abort);
  DispatchEventResult dispatchResult =
      IDBEventDispatcher::dispatch(event, targets);
  // FIXME: Try to construct a test where |this| outlives openDBRequest and we
  // get a crash.
  if (m_openDBRequest) {
    DCHECK(isVersionChange());
    m_openDBRequest->transactionDidFinishAndDispatch();
  }
  m_hasPendingActivity = false;
  return dispatchResult;
}
Beispiel #13
0
 Range::Range(const CHARRANGE& range, LONG total_length)
 {
     // Check if this is an invalid range.
     if(range.cpMin==-1 && range.cpMax==-1)
     {
         *this = InvalidRange();
     }
     else
     {
         DCHECK_GE(range.cpMin, 0);
         set_start(range.cpMin);
         // {0,-1} is the "whole range" but that doesn't mean much out of context,
         // so use the |total_length| parameter.
         if(range.cpMax == -1)
         {
             DCHECK_EQ(0, range.cpMin);
             DCHECK_NE(-1, total_length);
             set_end(total_length);
         }
         else
         {
             set_end(range.cpMax);
         }
     }
 }
Beispiel #14
0
intptr_t Fiber::preempt(State state) {
  intptr_t ret;

  auto preemptImpl = [&]() mutable {
    DCHECK_EQ(fiberManager_.activeFiber_, this);
    DCHECK_EQ(state_, RUNNING);
    DCHECK_NE(state, RUNNING);

    state_ = state;

    recordStackPosition();

    ret = fiberManager_.deactivateFiber(this);

    DCHECK_EQ(fiberManager_.activeFiber_, this);
    DCHECK_EQ(state_, READY_TO_RUN);
    state_ = RUNNING;
  };

  if (fiberManager_.preemptRunner_) {
    fiberManager_.preemptRunner_->run(std::ref(preemptImpl));
  } else {
    preemptImpl();
  }

  return ret;
}
Beispiel #15
0
void CSSLazyParsingState::countRuleParsed() {
  ++m_parsedStyleRules;
  while (m_parsedStyleRules > m_styleRulesNeededForNextMilestone) {
    DCHECK_NE(UsageAll, m_usage);
    ++m_usage;
    recordUsageMetrics();
  }
}
Beispiel #16
0
void EventSource::didFail(const ResourceError& error) {
  DCHECK_NE(kClosed, m_state);
  DCHECK(m_loader);

  if (error.isCancellation())
    m_state = kClosed;
  networkRequestEnded();
}
Beispiel #17
0
void IDBTransaction::setError(DOMException* error) {
  DCHECK_NE(m_state, Finished);
  DCHECK(error);

  // The first error to be set is the true cause of the
  // transaction abort.
  if (!m_error)
    m_error = error;
}
Beispiel #18
0
int64_t IDBDatabase::findObjectStoreId(const String& name) const {
  for (const auto& it : m_metadata.objectStores) {
    if (it.value->name == name) {
      DCHECK_NE(it.key, IDBObjectStoreMetadata::InvalidId);
      return it.key;
    }
  }
  return IDBObjectStoreMetadata::InvalidId;
}
Beispiel #19
0
void KeyframeEffectModelBase::ensureInterpolationEffectPopulated() const {
  if (m_interpolationEffect.isPopulated())
    return;

  for (const auto& entry : *m_keyframeGroups) {
    const PropertySpecificKeyframeVector& keyframes = entry.value->keyframes();
    for (size_t i = 0; i < keyframes.size() - 1; i++) {
      size_t startIndex = i;
      size_t endIndex = i + 1;
      double startOffset = keyframes[startIndex]->offset();
      double endOffset = keyframes[endIndex]->offset();
      double applyFrom = startOffset;
      double applyTo = endOffset;

      if (i == 0) {
        applyFrom = -std::numeric_limits<double>::infinity();
        DCHECK_EQ(startOffset, 0.0);
        if (endOffset == 0.0) {
          DCHECK_NE(keyframes[endIndex + 1]->offset(), 0.0);
          endIndex = startIndex;
        }
      }
      if (i == keyframes.size() - 2) {
        applyTo = std::numeric_limits<double>::infinity();
        DCHECK_EQ(endOffset, 1.0);
        if (startOffset == 1.0) {
          DCHECK_NE(keyframes[startIndex - 1]->offset(), 1.0);
          startIndex = endIndex;
        }
      }

      if (applyFrom != applyTo) {
        m_interpolationEffect.addInterpolationsFromKeyframes(
            entry.key, *keyframes[startIndex], *keyframes[endIndex], applyFrom,
            applyTo);
      }
      // else the interpolation will never be used in sampling
    }
  }

  m_interpolationEffect.setPopulated();
}
Beispiel #20
0
void IDBTransaction::enqueueEvent(Event* event) {
  DCHECK_NE(m_state, Finished)
      << "A finished transaction tried to enqueue an event of type "
      << event->type() << ".";
  if (!getExecutionContext())
    return;

  EventQueue* eventQueue = getExecutionContext()->getEventQueue();
  event->setTarget(this);
  eventQueue->enqueueEvent(event);
}
void RadioButtonGroup::requiredAttributeChanged(HTMLInputElement* button) {
  DCHECK_EQ(button->type(), InputTypeNames::radio);
  auto it = m_members.find(button);
  DCHECK_NE(it, m_members.end());
  bool wasValid = isValid();
  // Synchronize the 'required' flag for the button, along with
  // updating the overall count.
  updateRequiredButton(*it, button->isRequired());
  if (wasValid != isValid())
    setNeedsValidityCheckForAllButtons();
}
Beispiel #22
0
void IDBTransaction::objectStoreCreated(const String& name,
                                        IDBObjectStore* objectStore) {
  DCHECK_NE(m_state, Finished)
      << "A finished transaction created an object store";
  DCHECK_EQ(m_mode, WebIDBTransactionModeVersionChange)
      << "A non-versionchange transaction created an object store";
  DCHECK(!m_objectStoreMap.contains(name))
      << "An object store was created with the name of an existing store";
  DCHECK(objectStore->isNewlyCreated())
      << "Object store IDs are not assigned sequentially";
  m_objectStoreMap.set(name, objectStore);
}
static Node* nextAncestorSibling(const Node& node, const Node* stayWithin) {
  DCHECK(!pseudoAwareNextSibling(node));
  DCHECK_NE(node, stayWithin);
  for (Node* parentNode = parent(node); parentNode;
       parentNode = parent(*parentNode)) {
    if (parentNode == stayWithin)
      return 0;
    if (Node* nextNode = pseudoAwareNextSibling(*parentNode))
      return nextNode;
  }
  return 0;
}
Beispiel #24
0
void IDBTransaction::objectStoreRenamed(const String& oldName,
                                        const String& newName) {
  DCHECK_NE(m_state, Finished)
      << "A finished transaction renamed an object store";
  DCHECK_EQ(m_mode, WebIDBTransactionModeVersionChange)
      << "A non-versionchange transaction renamed an object store";

  DCHECK(!m_objectStoreMap.contains(newName));
  DCHECK(m_objectStoreMap.contains(oldName))
      << "The object store had to be accessed in order to be renamed.";
  m_objectStoreMap.set(newName, m_objectStoreMap.take(oldName));
}
Beispiel #25
0
Node* NodeTraversal::nextAncestorSibling(const Node& current,
                                         const Node* stayWithin) {
  DCHECK(!current.nextSibling());
  DCHECK_NE(current, stayWithin);
  for (Node& parent : ancestorsOf(current)) {
    if (parent == stayWithin)
      return 0;
    if (parent.nextSibling())
      return parent.nextSibling();
  }
  return 0;
}
LayoutObject* nextInTopLayer(const Element& element) {
  if (!element.isInTopLayer())
    return 0;
  const HeapVector<Member<Element>>& topLayerElements =
      element.document().topLayerElements();
  size_t position = topLayerElements.find(&element);
  DCHECK_NE(position, kNotFound);
  for (size_t i = position + 1; i < topLayerElements.size(); ++i) {
    if (LayoutObject* layoutObject = topLayerElements[i]->layoutObject())
      return layoutObject;
  }
  return 0;
}
Beispiel #27
0
    void Thread::StopSoon()
    {
        // 只能在启动线程中调用(启动本线程的线程!=本线程).
        DCHECK_NE(thread_id_, GetCurrentThreadId());

        if(stopping_ || !message_loop_)
        {
            return;
        }

        stopping_ = true;
        message_loop_->PostTask(new ThreadQuitTask());
    }
Beispiel #28
0
bool ImageFrame::takeBitmapDataIfWritable(ImageFrame* other) {
  DCHECK(other);
  DCHECK_EQ(FrameComplete, other->m_status);
  DCHECK_EQ(FrameEmpty, m_status);
  DCHECK_NE(this, other);
  if (other->m_bitmap.isImmutable())
    return false;
  m_hasAlpha = other->m_hasAlpha;
  m_bitmap.reset();
  m_bitmap.swap(other->m_bitmap);
  other->m_status = FrameEmpty;
  return true;
}
Beispiel #29
0
float SVGLengthContext::resolveLength(const SVGElement* context,
                                      SVGUnitTypes::SVGUnitType type,
                                      const SVGLength& x) {
  DCHECK_NE(SVGUnitTypes::kSvgUnitTypeUnknown, type);
  if (type == SVGUnitTypes::kSvgUnitTypeUserspaceonuse) {
    SVGLengthContext lengthContext(context);
    return x.value(lengthContext);
  }

  // FIXME: valueAsPercentage() won't be correct for eg. cm units. They need to
  // be resolved in user space and then be considered in objectBoundingBox
  // space.
  return x.valueAsPercentage();
}
Beispiel #30
0
IDBTransaction* IDBTransaction::createNonVersionChange(
    ScriptState* scriptState,
    int64_t id,
    const HashSet<String>& scope,
    WebIDBTransactionMode mode,
    IDBDatabase* db) {
  DCHECK_NE(mode, WebIDBTransactionModeVersionChange);
  DCHECK(!scope.isEmpty()) << "Non-version transactions should operate on a "
                              "well-defined set of stores";
  IDBTransaction* transaction =
      new IDBTransaction(scriptState, id, scope, mode, db);
  transaction->suspendIfNeeded();
  return transaction;
}