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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/ScopedPersistent.h

Issue 1983953002: Replace uses of v8::Persistent with ScopedPersistent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/webgl/WebGLFramebuffer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 { 65 {
66 return v8::Local<T>::New(isolate, m_handle); 66 return v8::Local<T>::New(isolate, m_handle);
67 } 67 }
68 68
69 template<typename P> 69 template<typename P>
70 void setWeak(P* parameters, void (*callback)(const v8::WeakCallbackInfo<P>&) , v8::WeakCallbackType type = v8::WeakCallbackType::kParameter) 70 void setWeak(P* parameters, void (*callback)(const v8::WeakCallbackInfo<P>&) , v8::WeakCallbackType type = v8::WeakCallbackType::kParameter)
71 { 71 {
72 m_handle.SetWeak(parameters, callback, type); 72 m_handle.SetWeak(parameters, callback, type);
73 } 73 }
74 74
75 // Turns this handle into a weak phantom handle without
76 // finalization callback.
77 void setPhantom()
78 {
79 m_handle.SetWeak();
80 }
81
75 void clearWeak() 82 void clearWeak()
76 { 83 {
77 m_handle.template ClearWeak<void>(); 84 m_handle.template ClearWeak<void>();
78 } 85 }
79 86
80 bool isEmpty() const { return m_handle.IsEmpty(); } 87 bool isEmpty() const { return m_handle.IsEmpty(); }
81 bool isWeak() const { return m_handle.IsWeak(); } 88 bool isWeak() const { return m_handle.IsWeak(); }
82 89
83 void set(v8::Isolate* isolate, v8::Local<T> handle) 90 void set(v8::Isolate* isolate, v8::Local<T> handle)
84 { 91 {
(...skipping 30 matching lines...) Expand all
115 { 122 {
116 return m_handle; 123 return m_handle;
117 } 124 }
118 125
119 v8::Persistent<T> m_handle; 126 v8::Persistent<T> m_handle;
120 }; 127 };
121 128
122 } // namespace blink 129 } // namespace blink
123 130
124 #endif // ScopedPersistent_h 131 #endif // ScopedPersistent_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/webgl/WebGLFramebuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698