CTTE: RenderNamedFlowThread always has a WebKitNamedFlow.
[WebKit-https.git] / Source / WebCore / dom / NamedFlowCollection.cpp
index c87981671cd58e64db68ce5ae59e8c1a2f06e59d..e140e4c6835f9d06cc7cd9b411778abaf1cc3258 100644 (file)
@@ -66,14 +66,14 @@ WebKitNamedFlow* NamedFlowCollection::flowByName(const String& flowName)
     return *it;
 }
 
-PassRefPtr<WebKitNamedFlow> NamedFlowCollection::ensureFlowWithName(const String& flowName)
+PassRef<WebKitNamedFlow> NamedFlowCollection::ensureFlowWithName(const String& flowName)
 {
     NamedFlowSet::iterator it = m_namedFlows.find<String, NamedFlowHashTranslator>(flowName);
     if (it != m_namedFlows.end()) {
         WebKitNamedFlow* namedFlow = *it;
         ASSERT(namedFlow->flowState() == WebKitNamedFlow::FlowStateNull);
 
-        return namedFlow;
+        return *namedFlow;
     }
 
     RefPtr<WebKitNamedFlow> newFlow = WebKitNamedFlow::create(this, flowName);
@@ -81,7 +81,7 @@ PassRefPtr<WebKitNamedFlow> NamedFlowCollection::ensureFlowWithName(const String
 
     InspectorInstrumentation::didCreateNamedFlow(document(), newFlow.get());
 
-    return newFlow.release();
+    return newFlow.releaseNonNull();
 }
 
 void NamedFlowCollection::discardNamedFlow(WebKitNamedFlow* namedFlow)