Fixes for 1750 roll
TBR=jacobr@google.com Review URL: https://codereview.chromium.org//150783005 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32477 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
event_test: Skip # Issue 1996
|
||||
interactive_test: Skip # Must be run manually.
|
||||
dromaeo_smoke_test: Skip # Issue 14521, 8257
|
||||
custom/template_wrappers_test: Pass, Fail # Issue 16656 (Chrome 33 regression)
|
||||
|
||||
[ $compiler == dart2js && $csp ]
|
||||
custom/js_custom_test: Fail # Issue 14643
|
||||
@@ -35,6 +36,10 @@ xhr_test/json: Fail # Issue 13069
|
||||
async_test: Fail # Background timers not implemented.
|
||||
keyboard_event_test: Fail # Issue 13902
|
||||
isolates_test: Fail # Issue 13921
|
||||
node_test/iterating : RuntimeError # Issue 16657 (Chrome 33 regression)
|
||||
indexeddb_5_test: RuntimeError # Issue 16657 Chrome 33 regression)
|
||||
fileapi_test/fileEntry: RuntimeError # Issue 16657 (Chrome 33 regression)
|
||||
audiocontext_test/functional: RuntimeError # Issue 16657 (Chrome 33 regression)
|
||||
|
||||
[ $compiler == none && $runtime == drt && $system == windows ]
|
||||
worker_test/functional: Pass, Crash # Issue 9929.
|
||||
|
||||
@@ -299,7 +299,7 @@ interface WebSocket {
|
||||
[Custom] void send(ArrayBufferView data);
|
||||
};
|
||||
|
||||
[Supplemental]
|
||||
[Supplemental, Constructor]
|
||||
interface XMLHttpRequest {
|
||||
[Custom] void send();
|
||||
[Custom] void send(ArrayBuffer data); // FIXME: this should be eventually deprecated.
|
||||
|
||||
@@ -666,7 +666,7 @@ class IDLTypeInfo(object):
|
||||
cls = self.bindings_class()
|
||||
|
||||
if 'Callback' in idl_node.ext_attrs:
|
||||
return '%s', 'RefPtr<%s>' % self.native_type(), cls, 'create'
|
||||
return '%s.release()', 'OwnPtr<%s>' % self.native_type(), cls, 'create'
|
||||
|
||||
if self.custom_to_native():
|
||||
type = 'RefPtr<%s>' % self.native_type()
|
||||
|
||||
@@ -128,6 +128,7 @@ _removed_html_interfaces = [
|
||||
'WebKitCSSMixFunctionValue',
|
||||
'WebKitCSSTransformValue',
|
||||
'WebKitMediaSource',
|
||||
'WebKitNotification',
|
||||
'WebKitSourceBuffer',
|
||||
'WebKitSourceBufferList',
|
||||
'WorkerLocation', # Workers
|
||||
@@ -603,6 +604,7 @@ removed_html_members = monitored.Set('htmlrenamer.removed_html_members', [
|
||||
'=Event.returnValue', # Only suppress on Event, allow for BeforeUnloadEvnt.
|
||||
'Event.srcElement',
|
||||
'EventSource.URL',
|
||||
'FontFace.ready',
|
||||
'FontFaceSet.load',
|
||||
'FontFaceSet.ready',
|
||||
'HTMLAnchorElement.charset',
|
||||
@@ -813,7 +815,7 @@ class HtmlRenamer(object):
|
||||
if self.ShouldSuppressMember(interface, member, member_prefix):
|
||||
return None
|
||||
|
||||
if 'CheckSecurityForNode' in member_node.ext_attrs:
|
||||
if 'CheckSecurity' in member_node.ext_attrs:
|
||||
return None
|
||||
|
||||
name = self._FindMatch(interface, member, member_prefix,
|
||||
|
||||
@@ -39,6 +39,7 @@ _cpp_callback_map = {
|
||||
('DOMWindow', 'clearTimeout'): 'DOMWindowTimers',
|
||||
('DOMWindow', 'clearInterval'): 'DOMWindowTimers',
|
||||
('DOMWindow', 'createImageBitmap'): 'ImageBitmapFactories',
|
||||
('Element', 'animate'): 'ElementAnimation',
|
||||
('HTMLInputElement', 'webkitEntries'): 'HTMLInputElementFileSystem',
|
||||
('HTMLVideoElement', 'getVideoPlaybackQuality'): 'HTMLVideoElementMediaSource',
|
||||
('Navigator', 'doNotTrack'): 'NavigatorDoNotTrack',
|
||||
@@ -199,6 +200,7 @@ class DartiumBackend(HtmlDartGenerator):
|
||||
class_name = 'Dart%s' % self._interface.id
|
||||
for operation in self._interface.operations:
|
||||
function_name = operation.id
|
||||
return_type = self.SecureOutputType(operation.type.id)
|
||||
parameters = []
|
||||
arguments = []
|
||||
if operation.ext_attrs.get('CallWith') == 'ThisValue':
|
||||
@@ -212,20 +214,28 @@ class DartiumBackend(HtmlDartGenerator):
|
||||
conversion_includes.extend(argument_type_info.conversion_includes())
|
||||
|
||||
# FIXME(vsm): Handle ThisValue attribute.
|
||||
if (return_type == 'void'):
|
||||
ret = ''
|
||||
else:
|
||||
ret = ' return 0;\n'
|
||||
|
||||
if operation.ext_attrs.get('CallWith') == 'ThisValue':
|
||||
cpp_header_handlers_emitter.Emit(
|
||||
'\n'
|
||||
' virtual bool $FUNCTION($PARAMETERS) {\n'
|
||||
' virtual $RETURN_TYPE $FUNCTION($PARAMETERS) {\n'
|
||||
' DART_UNIMPLEMENTED();\n'
|
||||
' return false;\n'
|
||||
'$RET'
|
||||
' }\n',
|
||||
RETURN_TYPE=return_type,
|
||||
RET=ret,
|
||||
FUNCTION=function_name,
|
||||
PARAMETERS=', '.join(parameters))
|
||||
continue
|
||||
|
||||
cpp_header_handlers_emitter.Emit(
|
||||
'\n'
|
||||
' virtual bool $FUNCTION($PARAMETERS);\n',
|
||||
' virtual $RETURN_TYPE $FUNCTION($PARAMETERS);\n',
|
||||
RETURN_TYPE=return_type,
|
||||
FUNCTION=function_name,
|
||||
PARAMETERS=', '.join(parameters))
|
||||
|
||||
@@ -236,17 +246,26 @@ class DartiumBackend(HtmlDartGenerator):
|
||||
arguments_declaration = 'Dart_Handle arguments[] = { %s }' % ', '.join(arguments)
|
||||
if not len(arguments):
|
||||
arguments_declaration = 'Dart_Handle* arguments = 0'
|
||||
if (return_type == 'void'):
|
||||
ret1 = 'return'
|
||||
ret2 = ''
|
||||
else:
|
||||
ret1 = 'return 0'
|
||||
ret2 = ' return'
|
||||
cpp_impl_handlers_emitter.Emit(
|
||||
'\n'
|
||||
'bool $CLASS_NAME::$FUNCTION($PARAMETERS)\n'
|
||||
'$RETURN_TYPE $CLASS_NAME::$FUNCTION($PARAMETERS)\n'
|
||||
'{\n'
|
||||
' if (!m_callback.isIsolateAlive())\n'
|
||||
' return false;\n'
|
||||
' $RET1;\n'
|
||||
' DartIsolateScope scope(m_callback.isolate());\n'
|
||||
' DartApiScope apiScope;\n'
|
||||
' $ARGUMENTS_DECLARATION;\n'
|
||||
' return m_callback.handleEvent($ARGUMENT_COUNT, arguments);\n'
|
||||
' $RET2 m_callback.handleEvent($ARGUMENT_COUNT, arguments);\n'
|
||||
'}\n',
|
||||
RETURN_TYPE=return_type,
|
||||
RET1=ret1,
|
||||
RET2=ret2,
|
||||
CLASS_NAME=class_name,
|
||||
FUNCTION=function_name,
|
||||
PARAMETERS=', '.join(parameters),
|
||||
@@ -508,6 +527,8 @@ class DartiumBackend(HtmlDartGenerator):
|
||||
'PureInterface' in ext_attrs or
|
||||
'CPPPureInterface' in ext_attrs or
|
||||
'SpecialWrapFor' in ext_attrs or
|
||||
('Custom' in ext_attrs and ext_attrs['Custom'] == 'Wrap') or
|
||||
('Custom' in ext_attrs and ext_attrs['Custom'] == 'ToV8') or
|
||||
self._interface_type_info.custom_to_dart()):
|
||||
to_dart_emitter.Emit(
|
||||
' static Dart_Handle createWrapper(DartDOMData* domData, NativeType* value);\n')
|
||||
@@ -586,6 +607,8 @@ class DartiumBackend(HtmlDartGenerator):
|
||||
webcore_function_name = self._ToWebKitName(attr.id)
|
||||
|
||||
function_expression = self._GenerateWebCoreFunctionExpression(webcore_function_name, attr)
|
||||
raises = ('RaisesException' in attr.ext_attrs and
|
||||
attr.ext_attrs['RaisesException'] != 'Setter')
|
||||
self._GenerateNativeCallback(
|
||||
cpp_callback_name,
|
||||
True,
|
||||
@@ -594,7 +617,7 @@ class DartiumBackend(HtmlDartGenerator):
|
||||
[],
|
||||
attr.type.id,
|
||||
attr.type.nullable,
|
||||
'GetterRaisesException' in attr.ext_attrs or 'RaisesException' in attr.ext_attrs,
|
||||
raises,
|
||||
auto_scope_setup)
|
||||
|
||||
def _AddSetter(self, attr, html_name):
|
||||
@@ -611,12 +634,18 @@ class DartiumBackend(HtmlDartGenerator):
|
||||
if 'Reflect' in attr.ext_attrs:
|
||||
webcore_function_name = self._TypeInfo(attr.type.id).webcore_setter_name()
|
||||
else:
|
||||
if 'ImplementedAs' in attr.ext_attrs:
|
||||
attr_name = attr.ext_attrs['ImplementedAs']
|
||||
else:
|
||||
attr_name = attr.id
|
||||
webcore_function_name = re.sub(r'^(xml|css|(?=[A-Z])|\w)',
|
||||
lambda s: s.group(1).upper(),
|
||||
attr.id)
|
||||
attr_name)
|
||||
webcore_function_name = 'set%s' % webcore_function_name
|
||||
|
||||
function_expression = self._GenerateWebCoreFunctionExpression(webcore_function_name, attr)
|
||||
raises = ('RaisesException' in attr.ext_attrs and
|
||||
attr.ext_attrs['RaisesException'] != 'Getter')
|
||||
self._GenerateNativeCallback(
|
||||
cpp_callback_name,
|
||||
True,
|
||||
@@ -625,7 +654,7 @@ class DartiumBackend(HtmlDartGenerator):
|
||||
[attr],
|
||||
'void',
|
||||
False,
|
||||
'SetterRaisesException' in attr.ext_attrs,
|
||||
raises,
|
||||
auto_scope_setup,
|
||||
generate_custom_element_scope_if_needed=True)
|
||||
|
||||
@@ -1082,7 +1111,7 @@ class DartiumBackend(HtmlDartGenerator):
|
||||
# In this case, the getter is mapped to a static method.
|
||||
if (not function_expression.startswith('receiver->') and
|
||||
not function_expression.startswith(interface_name + '::')):
|
||||
if interface_name == 'DOMWindow' or interface_name == 'Navigator' or interface_name == 'WorkerGlobalScope':
|
||||
if interface_name in ['DOMWindow', 'Element', 'Navigator', 'WorkerGlobalScope']:
|
||||
cpp_arguments.insert(0, 'receiver')
|
||||
else:
|
||||
cpp_arguments.append('receiver')
|
||||
@@ -1104,7 +1133,7 @@ class DartiumBackend(HtmlDartGenerator):
|
||||
' $NATIVE_TYPE result = $FUNCTION_CALL;\n'
|
||||
' if (isNull)\n'
|
||||
' return;\n',
|
||||
NATIVE_TYPE=return_type_info.native_type(),
|
||||
NATIVE_TYPE=return_type_info.parameter_type(),
|
||||
FUNCTION_CALL=function_call)
|
||||
value_expression = 'result'
|
||||
else:
|
||||
|
||||
@@ -16,31 +16,31 @@ namespace WebCore {
|
||||
|
||||
class Dart$(INTERFACE) : public $(INTERFACE), public ActiveDOMCallback {
|
||||
public:
|
||||
typedef $(INTERFACE) NativeType;
|
||||
typedef Dart$(INTERFACE) NativeType;
|
||||
|
||||
static PassRefPtr<NativeType> create(Dart_Handle object, Dart_Handle& exception)
|
||||
static PassOwnPtr<NativeType> create(Dart_Handle object, Dart_Handle& exception)
|
||||
{
|
||||
return adoptRef(new Dart$(INTERFACE)(object, exception, DartUtilities::scriptExecutionContext()));
|
||||
return adoptPtr(new Dart$(INTERFACE)(object, exception, DartUtilities::scriptExecutionContext()));
|
||||
}
|
||||
|
||||
static PassRefPtr<NativeType> createWithNullCheck(Dart_Handle object, Dart_Handle& exception)
|
||||
static PassOwnPtr<NativeType> createWithNullCheck(Dart_Handle object, Dart_Handle& exception)
|
||||
{
|
||||
if (Dart_IsNull(object))
|
||||
return 0;
|
||||
return PassOwnPtr<NativeType>();
|
||||
return create(object, exception);
|
||||
}
|
||||
|
||||
static PassRefPtr<NativeType> create(Dart_NativeArguments args, int idx, Dart_Handle& exception)
|
||||
static PassOwnPtr<NativeType> create(Dart_NativeArguments args, int idx, Dart_Handle& exception)
|
||||
{
|
||||
Dart_Handle object = Dart_GetNativeArgument(args, idx);
|
||||
return create(object, exception);
|
||||
}
|
||||
|
||||
static PassRefPtr<NativeType> createWithNullCheck(Dart_NativeArguments args, int idx, Dart_Handle& exception)
|
||||
static PassOwnPtr<NativeType> createWithNullCheck(Dart_NativeArguments args, int idx, Dart_Handle& exception)
|
||||
{
|
||||
Dart_Handle object = Dart_GetNativeArgument(args, idx);
|
||||
if (Dart_IsNull(object))
|
||||
return 0;
|
||||
return PassOwnPtr<NativeType>();
|
||||
return create(object, exception);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user