Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(480)

Side by Side Diff: sky/engine/bindings/scripts/v8_attributes.py

Issue 922053002: Remove unused V8 integration code in Sky (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 # Copyright (C) 2013 Google Inc. All rights reserved.
2 #
3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are
5 # met:
6 #
7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following disclaimer
11 # in the documentation and/or other materials provided with the
12 # distribution.
13 # * Neither the name of Google Inc. nor the names of its
14 # contributors may be used to endorse or promote products derived from
15 # this software without specific prior written permission.
16 #
17 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
29 """Generate template values for attributes.
30
31 Extends IdlType with property |constructor_type_name|.
32
33 Design doc: http://www.chromium.org/developers/design-documents/idl-compiler
34 """
35
36 import idl_types
37 from idl_types import inherits_interface
38 from v8_globals import includes, interfaces
39 import v8_types
40 import v8_utilities
41 from v8_utilities import (capitalize, cpp_name, has_extended_attribute,
42 has_extended_attribute_value, scoped_name, strip_suffi x,
43 uncapitalize, extended_attribute_value_as_list)
44
45
46 def attribute_context(interface, attribute):
47 idl_type = attribute.idl_type
48 base_idl_type = idl_type.base_type
49 extended_attributes = attribute.extended_attributes
50
51 idl_type.add_includes_for_type()
52
53 # [CheckSecurity]
54 is_check_security_for_node = 'CheckSecurity' in extended_attributes
55 if is_check_security_for_node:
56 includes.add('bindings/core/v8/BindingSecurity.h')
57 # [CustomElementCallbacks], [Reflect]
58 is_custom_element_callbacks = 'CustomElementCallbacks' in extended_attribute s
59 is_reflect = 'Reflect' in extended_attributes
60 if is_custom_element_callbacks or is_reflect:
61 includes.add('core/dom/custom/CustomElementProcessingStack.h')
62 # [PerWorldBindings]
63 if 'PerWorldBindings' in extended_attributes:
64 assert idl_type.is_wrapper_type or 'LogActivity' in extended_attributes, '[PerWorldBindings] should only be used with wrapper types: %s.%s' % (interface .name, attribute.name)
65 # [TypeChecking]
66 has_type_checking_unrestricted = (
67 (has_extended_attribute_value(interface, 'TypeChecking', 'Unrestricted') or
68 has_extended_attribute_value(attribute, 'TypeChecking', 'Unrestricted') ) and
69 idl_type.name in ('Float', 'Double'))
70 # [ImplementedInPrivateScript]
71 is_implemented_in_private_script = 'ImplementedInPrivateScript' in extended_ attributes
72 if is_implemented_in_private_script:
73 includes.add('bindings/core/v8/PrivateScriptRunner.h')
74 includes.add('core/frame/LocalFrame.h')
75 includes.add('platform/ScriptForbiddenScope.h')
76
77 # [OnlyExposedToPrivateScript]
78 is_only_exposed_to_private_script = 'OnlyExposedToPrivateScript' in extended _attributes
79
80 if (base_idl_type == 'EventHandler' and
81 interface.name in ['Window'] and
82 attribute.name == 'onerror'):
83 includes.add('bindings/core/v8/V8ErrorHandler.h')
84
85 context = {
86 'access_control_list': access_control_list(attribute),
87 'activity_logging_world_list_for_getter': v8_utilities.activity_logging_ world_list(attribute, 'Getter'), # [ActivityLogging]
88 'activity_logging_world_list_for_setter': v8_utilities.activity_logging_ world_list(attribute, 'Setter'), # [ActivityLogging]
89 'activity_logging_include_old_value_for_setter': 'LogPreviousValue' in e xtended_attributes, # [ActivityLogging]
90 'activity_logging_world_check': v8_utilities.activity_logging_world_chec k(attribute), # [ActivityLogging]
91 'argument_cpp_type': idl_type.cpp_type_args(used_as_rvalue_type=True),
92 'cached_attribute_validation_method': extended_attributes.get('CachedAtt ribute'),
93 'conditional_string': v8_utilities.conditional_string(attribute),
94 'constructor_type': idl_type.constructor_type_name
95 if is_constructor_attribute(attribute) else None,
96 'cpp_name': cpp_name(attribute),
97 'cpp_type': idl_type.cpp_type,
98 'cpp_type_initializer': idl_type.cpp_type_initializer,
99 'deprecate_as': v8_utilities.deprecate_as(attribute), # [DeprecateAs]
100 'enum_validation_expression': idl_type.enum_validation_expression,
101 'exposed_test': v8_utilities.exposed(attribute, interface), # [Exposed]
102 'has_custom_getter': has_custom_getter(attribute),
103 'has_custom_setter': has_custom_setter(attribute),
104 'has_type_checking_unrestricted': has_type_checking_unrestricted,
105 'idl_type': str(idl_type), # need trailing [] on array for Dictionary:: ConversionContext::setConversionType
106 'is_call_with_execution_context': v8_utilities.has_extended_attribute_va lue(attribute, 'CallWith', 'ExecutionContext'),
107 'is_call_with_script_state': v8_utilities.has_extended_attribute_value(a ttribute, 'CallWith', 'ScriptState'),
108 'is_check_security_for_node': is_check_security_for_node,
109 'is_custom_element_callbacks': is_custom_element_callbacks,
110 'is_expose_js_accessors': 'ExposeJSAccessors' in extended_attributes,
111 'is_getter_raises_exception': # [RaisesException]
112 'RaisesException' in extended_attributes and
113 extended_attributes['RaisesException'] in (None, 'Getter'),
114 'is_implemented_in_private_script': is_implemented_in_private_script,
115 'is_initialized_by_event_constructor':
116 'InitializedByEventConstructor' in extended_attributes,
117 'is_keep_alive_for_gc': is_keep_alive_for_gc(interface, attribute),
118 'is_nullable': idl_type.is_nullable,
119 'is_explicit_nullable': idl_type.is_explicit_nullable,
120 'is_partial_interface_member':
121 'PartialInterfaceImplementedAs' in extended_attributes,
122 'is_per_world_bindings': 'PerWorldBindings' in extended_attributes,
123 'is_read_only': attribute.is_read_only,
124 'is_reflect': is_reflect,
125 'is_replaceable': 'Replaceable' in attribute.extended_attributes,
126 'is_static': attribute.is_static,
127 'is_url': 'URL' in extended_attributes,
128 'is_unforgeable': 'Unforgeable' in extended_attributes,
129 'measure_as': v8_utilities.measure_as(attribute), # [MeasureAs]
130 'name': attribute.name,
131 'only_exposed_to_private_script': is_only_exposed_to_private_script,
132 'private_script_v8_value_to_local_cpp_value': idl_type.v8_value_to_local _cpp_value(
133 extended_attributes, 'v8Value', 'cppValue', isolate='scriptState->is olate()', used_in_private_script=True),
134 'property_attributes': property_attributes(attribute),
135 'put_forwards': 'PutForwards' in extended_attributes,
136 'reflect_empty': extended_attributes.get('ReflectEmpty'),
137 'reflect_invalid': extended_attributes.get('ReflectInvalid', ''),
138 'reflect_missing': extended_attributes.get('ReflectMissing'),
139 'reflect_only': extended_attribute_value_as_list(attribute, 'ReflectOnly '),
140 'runtime_enabled_function': v8_utilities.runtime_enabled_function_name(a ttribute), # [RuntimeEnabled]
141 'setter_callback': setter_callback_name(interface, attribute),
142 'should_be_exposed_to_script': not (is_implemented_in_private_script and is_only_exposed_to_private_script),
143 'world_suffixes': ['', 'ForMainWorld']
144 if 'PerWorldBindings' in extended_attributes
145 else [''], # [PerWorldBindings]
146 }
147
148 if is_constructor_attribute(attribute):
149 constructor_getter_context(interface, attribute, context)
150 return context
151 if not has_custom_getter(attribute):
152 getter_context(interface, attribute, context)
153 if (not has_custom_setter(attribute) and
154 (not attribute.is_read_only or 'PutForwards' in extended_attributes)):
155 setter_context(interface, attribute, context)
156
157 return context
158
159
160 ################################################################################
161 # Getter
162 ################################################################################
163
164 def getter_context(interface, attribute, context):
165 idl_type = attribute.idl_type
166 base_idl_type = idl_type.base_type
167 extended_attributes = attribute.extended_attributes
168
169 cpp_value = getter_expression(interface, attribute, context)
170 # Normally we can inline the function call into the return statement to
171 # avoid the overhead of using a Ref<> temporary, but for some cases
172 # (nullable types, EventHandler, [CachedAttribute], or if there are
173 # exceptions), we need to use a local variable.
174 # FIXME: check if compilers are smart enough to inline this, and if so,
175 # always use a local variable (for readability and CG simplicity).
176 release = False
177 if 'ImplementedInPrivateScript' in extended_attributes:
178 if (not idl_type.is_wrapper_type and
179 not idl_type.is_basic_type and
180 not idl_type.is_enum):
181 raise Exception('Private scripts supports only primitive types and D OM wrappers.')
182
183 context['cpp_value_original'] = cpp_value
184 cpp_value = 'result'
185 # EventHandler has special handling
186 if base_idl_type != 'EventHandler':
187 release = idl_type.release
188 elif (idl_type.is_explicit_nullable or
189 base_idl_type == 'EventHandler' or
190 'CachedAttribute' in extended_attributes or
191 'LogPreviousValue' in extended_attributes or
192 'ReflectOnly' in extended_attributes or
193 context['is_keep_alive_for_gc'] or
194 context['is_getter_raises_exception']):
195 context['cpp_value_original'] = cpp_value
196 cpp_value = 'cppValue'
197 # EventHandler has special handling
198 if base_idl_type != 'EventHandler':
199 release = idl_type.release
200
201 def v8_set_return_value_statement(for_main_world=False):
202 if context['is_keep_alive_for_gc']:
203 return 'v8SetReturnValue(info, wrapper)'
204 return idl_type.v8_set_return_value(cpp_value, extended_attributes=exten ded_attributes, script_wrappable='impl', release=release, for_main_world=for_mai n_world)
205
206 context.update({
207 'cpp_value': cpp_value,
208 'cpp_value_to_v8_value': idl_type.cpp_value_to_v8_value(
209 cpp_value=cpp_value, creation_context='info.Holder()',
210 extended_attributes=extended_attributes),
211 'v8_set_return_value_for_main_world': v8_set_return_value_statement(for_ main_world=True),
212 'v8_set_return_value': v8_set_return_value_statement(),
213 })
214
215
216 def getter_expression(interface, attribute, context):
217 arguments = []
218 this_getter_base_name = getter_base_name(interface, attribute, arguments)
219 getter_name = scoped_name(interface, attribute, this_getter_base_name)
220
221 if 'ImplementedInPrivateScript' in attribute.extended_attributes:
222 arguments.append('toFrameIfNotDetached(info.GetIsolate()->GetCurrentCont ext())')
223 arguments.append('impl')
224 arguments.append('&result')
225 arguments.extend(v8_utilities.call_with_arguments(
226 attribute.extended_attributes.get('CallWith')))
227 # Members of IDL partial interface definitions are implemented in C++ as
228 # static member functions, which for instance members (non-static members)
229 # take *impl as their first argument
230 if ('PartialInterfaceImplementedAs' in attribute.extended_attributes and
231 not 'ImplementedInPrivateScript' in attribute.extended_attributes and
232 not attribute.is_static):
233 arguments.append('*impl')
234 if attribute.idl_type.is_explicit_nullable:
235 arguments.append('isNull')
236 if context['is_getter_raises_exception']:
237 arguments.append('exceptionState')
238 return '%s(%s)' % (getter_name, ', '.join(arguments))
239
240
241 CONTENT_ATTRIBUTE_GETTER_NAMES = {
242 'boolean': 'hasAttribute',
243 'long': 'getIntegralAttribute',
244 'unsigned long': 'getUnsignedIntegralAttribute',
245 }
246
247
248 def getter_base_name(interface, attribute, arguments):
249 extended_attributes = attribute.extended_attributes
250
251 if 'ImplementedInPrivateScript' in extended_attributes:
252 return '%sAttributeGetter' % uncapitalize(cpp_name(attribute))
253
254 if 'Reflect' not in extended_attributes:
255 return uncapitalize(cpp_name(attribute))
256
257 content_attribute_name = extended_attributes['Reflect'] or attribute.name.lo wer()
258 if content_attribute_name in ['class', 'id']:
259 # Special-case for performance optimization.
260 return 'get%sAttribute' % content_attribute_name.capitalize()
261
262 arguments.append(scoped_content_attribute_name(interface, attribute))
263
264 base_idl_type = attribute.idl_type.base_type
265 if base_idl_type in CONTENT_ATTRIBUTE_GETTER_NAMES:
266 return CONTENT_ATTRIBUTE_GETTER_NAMES[base_idl_type]
267 if 'URL' in attribute.extended_attributes:
268 return 'getURLAttribute'
269 return 'getAttribute'
270
271
272 def is_keep_alive_for_gc(interface, attribute):
273 idl_type = attribute.idl_type
274 base_idl_type = idl_type.base_type
275 extended_attributes = attribute.extended_attributes
276 return (
277 # For readonly attributes, for performance reasons we keep the attribute
278 # wrapper alive while the owner wrapper is alive, because the attribute
279 # never changes.
280 (attribute.is_read_only and
281 idl_type.is_wrapper_type and
282 # There are some exceptions, however:
283 not(
284 # Node lifetime is managed by object grouping.
285 inherits_interface(interface.name, 'Node') or
286 inherits_interface(base_idl_type, 'Node') or
287 # A self-reference is unnecessary.
288 attribute.name == 'self' or
289 # FIXME: Remove these hard-coded hacks.
290 base_idl_type in ['EventTarget', 'Window'] or
291 base_idl_type.startswith(('HTML', 'SVG')))))
292
293
294 ################################################################################
295 # Setter
296 ################################################################################
297
298 def setter_context(interface, attribute, context):
299 if 'PutForwards' in attribute.extended_attributes:
300 # Use target interface and attribute in place of original interface and
301 # attribute from this point onwards.
302 target_interface_name = attribute.idl_type.base_type
303 target_attribute_name = attribute.extended_attributes['PutForwards']
304 interface = interfaces[target_interface_name]
305 try:
306 attribute = next(candidate
307 for candidate in interface.attributes
308 if candidate.name == target_attribute_name)
309 except StopIteration:
310 raise Exception('[PutForward] target not found:\n'
311 'Attribute "%s" is not present in interface "%s"' %
312 (target_attribute_name, target_interface_name))
313
314 extended_attributes = attribute.extended_attributes
315 idl_type = attribute.idl_type
316
317 # [RaisesException], [RaisesException=Setter]
318 is_setter_raises_exception = (
319 'RaisesException' in extended_attributes and
320 extended_attributes['RaisesException'] in [None, 'Setter'])
321 # [TypeChecking=Interface]
322 has_type_checking_interface = (
323 (has_extended_attribute_value(interface, 'TypeChecking', 'Interface') or
324 has_extended_attribute_value(attribute, 'TypeChecking', 'Interface')) a nd
325 idl_type.is_wrapper_type)
326
327 context.update({
328 'has_setter_exception_state':
329 is_setter_raises_exception or has_type_checking_interface or
330 context['has_type_checking_unrestricted'] or
331 idl_type.may_raise_exception_on_conversion,
332 'has_type_checking_interface': has_type_checking_interface,
333 'is_setter_call_with_execution_context': v8_utilities.has_extended_attri bute_value(
334 attribute, 'SetterCallWith', 'ExecutionContext'),
335 'is_setter_raises_exception': is_setter_raises_exception,
336 'private_script_cpp_value_to_v8_value': idl_type.cpp_value_to_v8_value(
337 'cppValue', isolate='scriptState->isolate()',
338 creation_context='scriptState->context()->Global()'),
339 'v8_value_to_local_cpp_value': idl_type.v8_value_to_local_cpp_value(
340 extended_attributes, 'v8Value', 'cppValue'),
341 })
342
343 # setter_expression() depends on context values we set above.
344 context['cpp_setter'] = setter_expression(interface, attribute, context)
345
346
347 def setter_expression(interface, attribute, context):
348 extended_attributes = attribute.extended_attributes
349 arguments = v8_utilities.call_with_arguments(
350 extended_attributes.get('SetterCallWith') or
351 extended_attributes.get('CallWith'))
352
353 this_setter_base_name = setter_base_name(interface, attribute, arguments)
354 setter_name = scoped_name(interface, attribute, this_setter_base_name)
355
356 # Members of IDL partial interface definitions are implemented in C++ as
357 # static member functions, which for instance members (non-static members)
358 # take *impl as their first argument
359 if ('PartialInterfaceImplementedAs' in extended_attributes and
360 not 'ImplementedInPrivateScript' in extended_attributes and
361 not attribute.is_static):
362 arguments.append('*impl')
363 idl_type = attribute.idl_type
364 if 'ImplementedInPrivateScript' in extended_attributes:
365 arguments.append('toFrameIfNotDetached(info.GetIsolate()->GetCurrentCont ext())')
366 arguments.append('impl')
367 arguments.append('cppValue')
368 elif idl_type.base_type == 'EventHandler':
369 getter_name = scoped_name(interface, attribute, cpp_name(attribute))
370 context['event_handler_getter_expression'] = '%s(%s)' % (
371 getter_name, ', '.join(arguments))
372 if (interface.name in ['Window'] and
373 attribute.name == 'onerror'):
374 includes.add('bindings/core/v8/V8ErrorHandler.h')
375 arguments.append('V8EventListenerList::findOrCreateWrapper<V8ErrorHa ndler>(v8Value, ScriptState::current(info.GetIsolate()))')
376 else:
377 arguments.append('V8EventListenerList::getEventListener(ScriptState: :current(info.GetIsolate()), v8Value, ListenerFindOrCreate)')
378 elif idl_type.is_interface_type:
379 # FIXME: should be able to eliminate WTF::getPtr in most or all cases
380 arguments.append('WTF::getPtr(cppValue)')
381 else:
382 arguments.append('cppValue')
383 if context['is_setter_raises_exception']:
384 arguments.append('exceptionState')
385
386 return '%s(%s)' % (setter_name, ', '.join(arguments))
387
388
389 CONTENT_ATTRIBUTE_SETTER_NAMES = {
390 'boolean': 'setBooleanAttribute',
391 'long': 'setIntegralAttribute',
392 'unsigned long': 'setUnsignedIntegralAttribute',
393 }
394
395
396 def setter_base_name(interface, attribute, arguments):
397 if 'ImplementedInPrivateScript' in attribute.extended_attributes:
398 return '%sAttributeSetter' % uncapitalize(cpp_name(attribute))
399
400 if 'Reflect' not in attribute.extended_attributes:
401 return 'set%s' % capitalize(cpp_name(attribute))
402 arguments.append(scoped_content_attribute_name(interface, attribute))
403
404 base_idl_type = attribute.idl_type.base_type
405 if base_idl_type in CONTENT_ATTRIBUTE_SETTER_NAMES:
406 return CONTENT_ATTRIBUTE_SETTER_NAMES[base_idl_type]
407 return 'setAttribute'
408
409
410 def scoped_content_attribute_name(interface, attribute):
411 content_attribute_name = attribute.extended_attributes['Reflect'] or attribu te.name.lower()
412 namespace = 'HTMLNames'
413 includes.add('core/%s.h' % namespace)
414 return '%s::%sAttr' % (namespace, content_attribute_name)
415
416
417 ################################################################################
418 # Attribute configuration
419 ################################################################################
420
421 # [Replaceable]
422 def setter_callback_name(interface, attribute):
423 cpp_class_name = cpp_name(interface)
424 extended_attributes = attribute.extended_attributes
425 if (('Replaceable' in extended_attributes and
426 'PutForwards' not in extended_attributes) or
427 is_constructor_attribute(attribute)):
428 return '{0}V8Internal::{0}ForceSetAttributeOnThisCallback'.format(cpp_cl ass_name)
429 if attribute.is_read_only and 'PutForwards' not in extended_attributes:
430 return '0'
431 return '%sV8Internal::%sAttributeSetterCallback' % (cpp_class_name, attribut e.name)
432
433
434 # [DoNotCheckSecurity], [Unforgeable]
435 def access_control_list(attribute):
436 extended_attributes = attribute.extended_attributes
437 access_control = []
438 if 'DoNotCheckSecurity' in extended_attributes:
439 do_not_check_security = extended_attributes['DoNotCheckSecurity']
440 if do_not_check_security == 'Setter':
441 access_control.append('v8::ALL_CAN_WRITE')
442 else:
443 access_control.append('v8::ALL_CAN_READ')
444 if (not attribute.is_read_only or
445 'Replaceable' in extended_attributes):
446 access_control.append('v8::ALL_CAN_WRITE')
447 if 'Unforgeable' in extended_attributes:
448 access_control.append('v8::PROHIBITS_OVERWRITING')
449 return access_control or ['v8::DEFAULT']
450
451
452 # [NotEnumerable], [Unforgeable]
453 def property_attributes(attribute):
454 extended_attributes = attribute.extended_attributes
455 property_attributes_list = []
456 if ('NotEnumerable' in extended_attributes or
457 is_constructor_attribute(attribute)):
458 property_attributes_list.append('v8::DontEnum')
459 if 'Unforgeable' in extended_attributes:
460 property_attributes_list.append('v8::DontDelete')
461 return property_attributes_list or ['v8::None']
462
463
464 # [Custom], [Custom=Getter]
465 def has_custom_getter(attribute):
466 extended_attributes = attribute.extended_attributes
467 return ('Custom' in extended_attributes and
468 extended_attributes['Custom'] in [None, 'Getter'])
469
470
471 # [Custom], [Custom=Setter]
472 def has_custom_setter(attribute):
473 extended_attributes = attribute.extended_attributes
474 return (not attribute.is_read_only and
475 'Custom' in extended_attributes and
476 extended_attributes['Custom'] in [None, 'Setter'])
477
478
479 ################################################################################
480 # Constructors
481 ################################################################################
482
483 idl_types.IdlType.constructor_type_name = property(
484 # FIXME: replace this with a [ConstructorAttribute] extended attribute
485 lambda self: strip_suffix(self.base_type, 'Constructor'))
486
487
488 def is_constructor_attribute(attribute):
489 # FIXME: replace this with [ConstructorAttribute] extended attribute
490 return attribute.idl_type.name.endswith('Constructor')
491
492
493 def constructor_getter_context(interface, attribute, context):
494 context['needs_constructor_getter_callback'] = context['measure_as'] or cont ext['deprecate_as']
OLDNEW
« no previous file with comments | « sky/engine/bindings/scripts/utilities.py ('k') | sky/engine/bindings/scripts/v8_callback_interface.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698