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

Unified Diff: Source/bindings/core/v8/inspector/InspectorWrapper.h

Issue 1152733010: Oilpan: fix build after r196583. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/inspector/InspectorWrapper.h
diff --git a/Source/bindings/core/v8/inspector/InspectorWrapper.h b/Source/bindings/core/v8/inspector/InspectorWrapper.h
index 21fa0e3dce2b84e66cd512b248744ab88f2e9377..736884ad0b182e0ad87d4281e971afc66a4b022c 100644
--- a/Source/bindings/core/v8/inspector/InspectorWrapper.h
+++ b/Source/bindings/core/v8/inspector/InspectorWrapper.h
@@ -34,19 +34,33 @@ protected:
static v8::Local<v8::String> v8InternalizedString(v8::Isolate*, const char* name);
};
+template<typename T, bool = IsGarbageCollectedType<T>::value>
+class InspectorWrapperTypeTrait {
+public:
+ using PassType = PassRefPtr<T>;
+ using Type = RefPtr<T>;
+};
+
+template<typename T>
+class InspectorWrapperTypeTrait<T, true> {
+public:
+ using PassType = PassRefPtrWillBeRawPtr<T>;
+ using Type = RefPtrWillBeRawPtr<T>;
+};
+
template<class T, char* const hiddenPropertyName, char* const className>
class InspectorWrapper final : public InspectorWrapperBase {
public:
class WeakCallbackData final {
public:
- WeakCallbackData(v8::Isolate* isolate, PassRefPtr<T> impl, v8::Local<v8::Object> wrapper)
+ WeakCallbackData(v8::Isolate* isolate, typename InspectorWrapperTypeTrait<T>::PassType impl, v8::Local<v8::Object> wrapper)
: m_impl(impl)
, m_persistent(isolate, wrapper)
{
m_persistent.SetWeak(this, &WeakCallbackData::weakCallback, v8::WeakCallbackType::kParameter);
}
- RefPtr<T> m_impl;
+ typename InspectorWrapperTypeTrait<T>::Type m_impl;
private:
static void weakCallback(const v8::WeakCallbackInfo<WeakCallbackData>& info)
@@ -62,13 +76,13 @@ public:
return InspectorWrapperBase::createWrapperTemplate(isolate, className, methods, attributes);
}
- static v8::Local<v8::Object> wrap(v8::Local<v8::FunctionTemplate> constructorTemplate, v8::Local<v8::Context> context, PassRefPtr<T> object)
+ static v8::Local<v8::Object> wrap(v8::Local<v8::FunctionTemplate> constructorTemplate, v8::Local<v8::Context> context, typename blink::InspectorWrapperTypeTrait<T>::PassType object)
{
v8::Context::Scope contextScope(context);
v8::Local<v8::Object> result = InspectorWrapperBase::createWrapper(constructorTemplate, context);
if (result.IsEmpty())
return v8::Local<v8::Object>();
- RefPtrWillBeRawPtr<T> impl(object);
+ typename blink::InspectorWrapperTypeTrait<T>::Type impl(object);
v8::Isolate* isolate = context->GetIsolate();
v8::Local<v8::External> objectReference = v8::External::New(isolate, new WeakCallbackData(isolate, impl, result));
result->SetHiddenValue(v8InternalizedString(isolate, hiddenPropertyName), objectReference);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698