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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/V8CustomElementLifecycleCallbacks.cpp

Issue 1853743005: Oilpan: Remove WillBe types (part 13) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 30 matching lines...) Expand all
41 #include "wtf/PassOwnPtr.h" 41 #include "wtf/PassOwnPtr.h"
42 42
43 namespace blink { 43 namespace blink {
44 44
45 #define CALLBACK_LIST(V) \ 45 #define CALLBACK_LIST(V) \
46 V(created, CreatedCallback) \ 46 V(created, CreatedCallback) \
47 V(attached, AttachedCallback) \ 47 V(attached, AttachedCallback) \
48 V(detached, DetachedCallback) \ 48 V(detached, DetachedCallback) \
49 V(attributeChanged, AttributeChangedCallback) 49 V(attributeChanged, AttributeChangedCallback)
50 50
51 PassRefPtrWillBeRawPtr<V8CustomElementLifecycleCallbacks> V8CustomElementLifecyc leCallbacks::create(ScriptState* scriptState, v8::Local<v8::Object> prototype, v 8::MaybeLocal<v8::Function> created, v8::MaybeLocal<v8::Function> attached, v8:: MaybeLocal<v8::Function> detached, v8::MaybeLocal<v8::Function> attributeChanged ) 51 RawPtr<V8CustomElementLifecycleCallbacks> V8CustomElementLifecycleCallbacks::cre ate(ScriptState* scriptState, v8::Local<v8::Object> prototype, v8::MaybeLocal<v8 ::Function> created, v8::MaybeLocal<v8::Function> attached, v8::MaybeLocal<v8::F unction> detached, v8::MaybeLocal<v8::Function> attributeChanged)
52 { 52 {
53 v8::Isolate* isolate = scriptState->isolate(); 53 v8::Isolate* isolate = scriptState->isolate();
54 // A given object can only be used as a Custom Element prototype 54 // A given object can only be used as a Custom Element prototype
55 // once; see customElementIsInterfacePrototypeObject 55 // once; see customElementIsInterfacePrototypeObject
56 #define SET_HIDDEN_VALUE(Value, Name) \ 56 #define SET_HIDDEN_VALUE(Value, Name) \
57 ASSERT(V8HiddenValue::getHiddenValue(scriptState, prototype, V8HiddenValue:: customElement##Name(isolate)).IsEmpty()); \ 57 ASSERT(V8HiddenValue::getHiddenValue(scriptState, prototype, V8HiddenValue:: customElement##Name(isolate)).IsEmpty()); \
58 if (!Value.IsEmpty()) \ 58 if (!Value.IsEmpty()) \
59 V8HiddenValue::setHiddenValue(scriptState, prototype, V8HiddenValue::cus tomElement##Name(isolate), Value.ToLocalChecked()); 59 V8HiddenValue::setHiddenValue(scriptState, prototype, V8HiddenValue::cus tomElement##Name(isolate), Value.ToLocalChecked());
60 60
61 CALLBACK_LIST(SET_HIDDEN_VALUE) 61 CALLBACK_LIST(SET_HIDDEN_VALUE)
62 #undef SET_HIDDEN_VALUE 62 #undef SET_HIDDEN_VALUE
63 63
64 return adoptRefWillBeNoop(new V8CustomElementLifecycleCallbacks(scriptState, prototype, created, attached, detached, attributeChanged)); 64 return new V8CustomElementLifecycleCallbacks(scriptState, prototype, created , attached, detached, attributeChanged);
65 } 65 }
66 66
67 static CustomElementLifecycleCallbacks::CallbackType flagSet(v8::MaybeLocal<v8:: Function> attached, v8::MaybeLocal<v8::Function> detached, v8::MaybeLocal<v8::Fu nction> attributeChanged) 67 static CustomElementLifecycleCallbacks::CallbackType flagSet(v8::MaybeLocal<v8:: Function> attached, v8::MaybeLocal<v8::Function> detached, v8::MaybeLocal<v8::Fu nction> attributeChanged)
68 { 68 {
69 // V8 Custom Elements always run created to swizzle prototypes. 69 // V8 Custom Elements always run created to swizzle prototypes.
70 int flags = CustomElementLifecycleCallbacks::CreatedCallback; 70 int flags = CustomElementLifecycleCallbacks::CreatedCallback;
71 71
72 if (!attached.IsEmpty()) 72 if (!attached.IsEmpty())
73 flags |= CustomElementLifecycleCallbacks::AttachedCallback; 73 flags |= CustomElementLifecycleCallbacks::AttachedCallback;
74 74
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 ScriptController::callFunction(getExecutionContext(), callback, receiver, 0, 0, isolate); 241 ScriptController::callFunction(getExecutionContext(), callback, receiver, 0, 0, isolate);
242 } 242 }
243 243
244 DEFINE_TRACE(V8CustomElementLifecycleCallbacks) 244 DEFINE_TRACE(V8CustomElementLifecycleCallbacks)
245 { 245 {
246 CustomElementLifecycleCallbacks::trace(visitor); 246 CustomElementLifecycleCallbacks::trace(visitor);
247 ContextLifecycleObserver::trace(visitor); 247 ContextLifecycleObserver::trace(visitor);
248 } 248 }
249 249
250 } // namespace blink 250 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698