OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 if (SerializedScriptValue* serializedValue = event->serializedDetail()) | 66 if (SerializedScriptValue* serializedValue = event->serializedDetail()) |
67 detail = serializedValue->deserialize(); | 67 detail = serializedValue->deserialize(); |
68 else | 68 else |
69 detail = event->detail().v8ValueFor(ScriptState::current(info.GetIsolate
())); | 69 detail = event->detail().v8ValueFor(ScriptState::current(info.GetIsolate
())); |
70 // |detail| should be null when it is an empty handle because its default va
lue is null. | 70 // |detail| should be null when it is an empty handle because its default va
lue is null. |
71 if (detail.IsEmpty()) | 71 if (detail.IsEmpty()) |
72 detail = v8::Null(info.GetIsolate()); | 72 detail = v8::Null(info.GetIsolate()); |
73 v8SetReturnValue(info, cacheState(info.GetIsolate(), info.Holder(), detail))
; | 73 v8SetReturnValue(info, cacheState(info.GetIsolate(), info.Holder(), detail))
; |
74 } | 74 } |
75 | 75 |
76 void V8CustomEvent::initCustomEventMethodCustom(const v8::FunctionCallbackInfo<v
8::Value>& info) | |
77 { | |
78 CustomEvent* event = V8CustomEvent::toImpl(info.Holder()); | |
79 | |
80 TOSTRING_VOID(V8StringResource<>, typeArg, info[0]); | |
81 bool canBubbleArg; | |
82 bool cancelableArg; | |
83 if (!v8Call(info[1]->BooleanValue(info.GetIsolate()->GetCurrentContext()), c
anBubbleArg) | |
84 || !v8Call(info[2]->BooleanValue(info.GetIsolate()->GetCurrentContext())
, cancelableArg)) | |
85 return; | |
86 v8::Local<v8::Value> detailsArg = info[3]; | |
87 | |
88 event->initEvent(typeArg, canBubbleArg, cancelableArg); | |
89 event->setDetail(ScriptValue(ScriptState::current(info.GetIsolate()), detail
sArg)); | |
90 } | |
91 | |
92 } // namespace blink | 76 } // namespace blink |
OLD | NEW |