| OLD | NEW |
| 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 } | 168 } |
| 169 | 169 |
| 170 class TemporaryScriptWrappableVisitorScope { | 170 class TemporaryScriptWrappableVisitorScope { |
| 171 WTF_MAKE_NONCOPYABLE(TemporaryScriptWrappableVisitorScope); | 171 WTF_MAKE_NONCOPYABLE(TemporaryScriptWrappableVisitorScope); |
| 172 STACK_ALLOCATED(); | 172 STACK_ALLOCATED(); |
| 173 | 173 |
| 174 public: | 174 public: |
| 175 TemporaryScriptWrappableVisitorScope( | 175 TemporaryScriptWrappableVisitorScope( |
| 176 v8::Isolate* isolate, | 176 v8::Isolate* isolate, |
| 177 std::unique_ptr<ScriptWrappableVisitor> visitor) | 177 std::unique_ptr<ScriptWrappableVisitor> visitor) |
| 178 : m_isolate(isolate) { | 178 : m_isolate(isolate), m_savedVisitor(std::move(visitor)) { |
| 179 swapWithV8PerIsolateDataVisitor(visitor); | 179 swapWithV8PerIsolateDataVisitor(m_savedVisitor); |
| 180 } | 180 } |
| 181 ~TemporaryScriptWrappableVisitorScope() { | 181 ~TemporaryScriptWrappableVisitorScope() { |
| 182 swapWithV8PerIsolateDataVisitor(m_savedVisitor); | 182 swapWithV8PerIsolateDataVisitor(m_savedVisitor); |
| 183 } | 183 } |
| 184 | 184 |
| 185 private: | 185 inline ScriptWrappableVisitor* currentVisitor() { |
| 186 inline ScriptWrappableVisitor* currentVisitor(v8::Isolate* isolate) { | |
| 187 return V8PerIsolateData::from(m_isolate)->scriptWrappableVisitor(); | 186 return V8PerIsolateData::from(m_isolate)->scriptWrappableVisitor(); |
| 188 } | 187 } |
| 189 | 188 |
| 189 private: |
| 190 void swapWithV8PerIsolateDataVisitor( | 190 void swapWithV8PerIsolateDataVisitor( |
| 191 std::unique_ptr<ScriptWrappableVisitor>&); | 191 std::unique_ptr<ScriptWrappableVisitor>&); |
| 192 | 192 |
| 193 v8::Isolate* m_isolate; | 193 v8::Isolate* m_isolate; |
| 194 std::unique_ptr<ScriptWrappableVisitor> m_savedVisitor; | 194 std::unique_ptr<ScriptWrappableVisitor> m_savedVisitor; |
| 195 }; | 195 }; |
| 196 | 196 |
| 197 void setScriptWrappableVisitor( | 197 void setScriptWrappableVisitor( |
| 198 std::unique_ptr<ScriptWrappableVisitor> visitor) { | 198 std::unique_ptr<ScriptWrappableVisitor> visitor) { |
| 199 m_scriptWrappableVisitor = std::move(visitor); | 199 m_scriptWrappableVisitor = std::move(visitor); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 Vector<std::unique_ptr<EndOfScopeTask>> m_endOfScopeTasks; | 248 Vector<std::unique_ptr<EndOfScopeTask>> m_endOfScopeTasks; |
| 249 std::unique_ptr<ThreadDebugger> m_threadDebugger; | 249 std::unique_ptr<ThreadDebugger> m_threadDebugger; |
| 250 | 250 |
| 251 Persistent<ActiveScriptWrappableSet> m_activeScriptWrappables; | 251 Persistent<ActiveScriptWrappableSet> m_activeScriptWrappables; |
| 252 std::unique_ptr<ScriptWrappableVisitor> m_scriptWrappableVisitor; | 252 std::unique_ptr<ScriptWrappableVisitor> m_scriptWrappableVisitor; |
| 253 }; | 253 }; |
| 254 | 254 |
| 255 } // namespace blink | 255 } // namespace blink |
| 256 | 256 |
| 257 #endif // V8PerIsolateData_h | 257 #endif // V8PerIsolateData_h |
| OLD | NEW |