mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
The first one is that we weren't setting up a FontCachePurgePreventer during drawText. It's not clear that this is the correct fix, since Blink doesn't have this FontCachePurgePreventer here either, but it's also possible that they would hit this same ASSERT and just not care (since ASSERTs are disabled on clusterfuzz). The second fix is making ExceptionState actually track whether it has thrown an exception or not. The c++ code was depending on this working in order to return early from dom functions and not crash! R=abarth@google.com
54 lines
1.5 KiB
C++
54 lines
1.5 KiB
C++
// Copyright 2014 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#include "sky/engine/bindings/exception_state.h"
|
|
|
|
namespace blink {
|
|
|
|
ExceptionState::ExceptionState() : code_(0), had_exception_(false) {
|
|
}
|
|
|
|
ExceptionState::ExceptionState(Context context,
|
|
const char* propertyName,
|
|
const char* interfaceName) {
|
|
}
|
|
|
|
ExceptionState::ExceptionState(Context context, const char* interfaceName) {
|
|
}
|
|
|
|
ExceptionState::~ExceptionState() {
|
|
}
|
|
|
|
// TODO(iansf): Implement exceptions.
|
|
void ExceptionState::ThrowDOMException(const ExceptionCode&,
|
|
const String& message) {
|
|
had_exception_ = true;
|
|
}
|
|
|
|
void ExceptionState::ThrowTypeError(const String& message) {
|
|
had_exception_ = true;
|
|
}
|
|
|
|
void ExceptionState::ThrowRangeError(const String& message) {
|
|
had_exception_ = true;
|
|
}
|
|
|
|
bool ExceptionState::ThrowIfNeeded() {
|
|
return had_exception_;
|
|
}
|
|
|
|
void ExceptionState::ClearException() {
|
|
had_exception_ = false;
|
|
}
|
|
|
|
Dart_Handle ExceptionState::GetDartException(Dart_NativeArguments args,
|
|
bool auto_scope) {
|
|
// TODO(abarth): Still don't understand autoscope.
|
|
DCHECK(auto_scope);
|
|
// TODO(eseidel): This should be a real exception object!
|
|
return Dart_NewStringFromCString("Exception support missing. See exception_state.cc");
|
|
}
|
|
|
|
} // namespace blink
|