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

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

Issue 2050123002: Remove OwnPtr from Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: First attempt to land. Created 4 years, 6 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 20 matching lines...) Expand all
31 #include "bindings/core/v8/V8V0CustomElementLifecycleCallbacks.h" 31 #include "bindings/core/v8/V8V0CustomElementLifecycleCallbacks.h"
32 32
33 #include "bindings/core/v8/DOMDataStore.h" 33 #include "bindings/core/v8/DOMDataStore.h"
34 #include "bindings/core/v8/ScriptController.h" 34 #include "bindings/core/v8/ScriptController.h"
35 #include "bindings/core/v8/V0CustomElementBinding.h" 35 #include "bindings/core/v8/V0CustomElementBinding.h"
36 #include "bindings/core/v8/V8Binding.h" 36 #include "bindings/core/v8/V8Binding.h"
37 #include "bindings/core/v8/V8Element.h" 37 #include "bindings/core/v8/V8Element.h"
38 #include "bindings/core/v8/V8HiddenValue.h" 38 #include "bindings/core/v8/V8HiddenValue.h"
39 #include "bindings/core/v8/V8PerContextData.h" 39 #include "bindings/core/v8/V8PerContextData.h"
40 #include "core/dom/ExecutionContext.h" 40 #include "core/dom/ExecutionContext.h"
41 #include "wtf/PassOwnPtr.h" 41 #include <memory>
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 V8V0CustomElementLifecycleCallbacks* V8V0CustomElementLifecycleCallbacks::create (ScriptState* scriptState, v8::Local<v8::Object> prototype, v8::MaybeLocal<v8::F unction> created, v8::MaybeLocal<v8::Function> attached, v8::MaybeLocal<v8::Func tion> detached, v8::MaybeLocal<v8::Function> attributeChanged) 51 V8V0CustomElementLifecycleCallbacks* V8V0CustomElementLifecycleCallbacks::create (ScriptState* scriptState, v8::Local<v8::Object> prototype, v8::MaybeLocal<v8::F unction> created, v8::MaybeLocal<v8::Function> attached, v8::MaybeLocal<v8::Func tion> detached, v8::MaybeLocal<v8::Function> attributeChanged)
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 if (context.IsEmpty()) 116 if (context.IsEmpty())
117 return 0; 117 return 0;
118 118
119 return V8PerContextData::from(context); 119 return V8PerContextData::from(context);
120 } 120 }
121 121
122 V8V0CustomElementLifecycleCallbacks::~V8V0CustomElementLifecycleCallbacks() 122 V8V0CustomElementLifecycleCallbacks::~V8V0CustomElementLifecycleCallbacks()
123 { 123 {
124 } 124 }
125 125
126 bool V8V0CustomElementLifecycleCallbacks::setBinding(PassOwnPtr<V0CustomElementB inding> binding) 126 bool V8V0CustomElementLifecycleCallbacks::setBinding(std::unique_ptr<V0CustomEle mentBinding> binding)
127 { 127 {
128 V8PerContextData* perContextData = creationContextData(); 128 V8PerContextData* perContextData = creationContextData();
129 if (!perContextData) 129 if (!perContextData)
130 return false; 130 return false;
131 131
132 // The context is responsible for keeping the prototype 132 // The context is responsible for keeping the prototype
133 // alive. This in turn keeps callbacks alive through hidden 133 // alive. This in turn keeps callbacks alive through hidden
134 // references; see CALLBACK_LIST(SET_HIDDEN_VALUE). 134 // references; see CALLBACK_LIST(SET_HIDDEN_VALUE).
135 perContextData->addCustomElementBinding(std::move(binding)); 135 perContextData->addCustomElementBinding(std::move(binding));
136 return true; 136 return true;
(...skipping 104 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(V8V0CustomElementLifecycleCallbacks) 244 DEFINE_TRACE(V8V0CustomElementLifecycleCallbacks)
245 { 245 {
246 V0CustomElementLifecycleCallbacks::trace(visitor); 246 V0CustomElementLifecycleCallbacks::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