Chromium Code Reviews| Index: Source/core/dom/shadow/ElementShadow.cpp |
| diff --git a/Source/core/dom/shadow/ElementShadow.cpp b/Source/core/dom/shadow/ElementShadow.cpp |
| index 158addd3d0da4180463f8863a020789d291d6a10..8d4379001531ae8cf7a9f36fe4318c890a6819a8 100644 |
| --- a/Source/core/dom/shadow/ElementShadow.cpp |
| +++ b/Source/core/dom/shadow/ElementShadow.cpp |
| @@ -131,7 +131,7 @@ ElementShadow::~ElementShadow() |
| removeAllShadowRoots(); |
| } |
| -ShadowRoot* ElementShadow::addShadowRoot(Element& shadowHost, ShadowRoot::ShadowRootType type) |
| +ShadowRoot& ElementShadow::addShadowRoot(Element& shadowHost, ShadowRoot::ShadowRootType type) |
| { |
| RefPtr<ShadowRoot> shadowRoot = ShadowRoot::create(&shadowHost.document(), type); |
| @@ -149,7 +149,7 @@ ShadowRoot* ElementShadow::addShadowRoot(Element& shadowHost, ShadowRoot::Shadow |
| shadowHost.didAddShadowRoot(*shadowRoot); |
| InspectorInstrumentation::didPushShadowRoot(&shadowHost, shadowRoot.get()); |
| - return shadowRoot.get(); |
| + return *shadowRoot; |
|
eseidel
2013/11/06 20:18:39
It's generally not safe to return a reference from
adamk
2013/11/06 20:24:05
The easiest way to make this look safer would be t
Inactive
2013/11/07 16:54:28
I took another look at the code and the ownership
Inactive
2013/11/07 20:03:27
Done.
|
| } |
| void ElementShadow::removeAllShadowRoots() |