Commit baba2fc6 authored by sigbjornf@opera.com's avatar sigbjornf@opera.com

Oilpan: fix build after r180084.

Address type conversion subtlety over RawPtr<>s. We have at hand:

 Handle<Value> toV8(PassRefPtrWillBeRawPtr<NodeList>, ...);

 template<NodeType>class StaticNodeTypeList : public NodeList {
   public:
       static PassRefPtrWillBeRawPtr<StaticNodeTypeList> adopt(..);
       ...
   }

 typedef StaticNodeTypeList<Element> StaticElementList;

and the call

 toV8(StaticElementList::adopt(namedItems), ....);

For the toV8() call to be successfully resolved, the adopt() result
must be convertible to PassRefPtrWillBeRawPtr<NodeList>. For the non-Oilpan
case, we do have the

   PassRefPtr(const PassRefPtr<U>, EnsurePtrConvertibleArgDecl(U, T))

constructor at hand, which will convert the PassRefPtr<StaticElementList>
into PassRefPtr<NodeList>. We do not have the corresponding type-convertible
constructor over RawPtr<>, as providing that runs into problems when
using RawPtr<> as part of the PassOwnPtrWillBeRawPtr transition type.

Address/step-around-the-issue by being explicit about the conversion.

TBR=haraken,oilpan-reviews
BUG=
NOTRY=true

Review URL: https://codereview.chromium.org/451303003

git-svn-id: svn://svn.chromium.org/blink/trunk@180096 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 4ae8ce1e
......@@ -54,7 +54,14 @@ static v8::Handle<v8::Value> getNamedItems(HTMLAllCollection* collection, Atomic
// FIXME: HTML5 specification says this should be a HTMLCollection.
// http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-interfaces.html#htmlallcollection
return toV8(StaticElementList::adopt(namedItems), info.Holder(), info.GetIsolate());
//
// FIXME: Oilpan: explicit conversion needed as there is currently
// no implicit RawPtr<T>(RawPtr<U>) constructor (for type
// convertible pairs T and U) that would implicitly convert a
// RawPtr<StaticElementList> to a RawPtr<NodeList> (the former is
// a subclass of the latter.) Such a conversion is needed to
// resolve the toV8() call.
return toV8(PassRefPtrWillBeRawPtr<NodeList>(StaticElementList::adopt(namedItems)), info.Holder(), info.GetIsolate());
}
template<class CallbackInfo>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment