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

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

Issue 1381693002: Don't report promise rejection events during the microtask checkpoint (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updates Created 5 years, 2 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
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 void clearWeak()
76 {
77 m_handle.template ClearWeak<void>();
78 }
79
75 bool isEmpty() const { return m_handle.IsEmpty(); } 80 bool isEmpty() const { return m_handle.IsEmpty(); }
76 bool isWeak() const { return m_handle.IsWeak(); } 81 bool isWeak() const { return m_handle.IsWeak(); }
77 82
78 void set(v8::Isolate* isolate, v8::Local<T> handle) 83 void set(v8::Isolate* isolate, v8::Local<T> handle)
79 { 84 {
80 m_handle.Reset(isolate, handle); 85 m_handle.Reset(isolate, handle);
81 } 86 }
82 87
83 // Note: This is clear in the OwnPtr sense, not the v8::Handle sense. 88 // Note: This is clear in the OwnPtr sense, not the v8::Handle sense.
84 void clear() 89 void clear()
(...skipping 25 matching lines...) Expand all
110 { 115 {
111 return m_handle; 116 return m_handle;
112 } 117 }
113 118
114 v8::Persistent<T> m_handle; 119 v8::Persistent<T> m_handle;
115 }; 120 };
116 121
117 } // namespace blink 122 } // namespace blink
118 123
119 #endif // ScopedPersistent_h 124 #endif // ScopedPersistent_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698