| 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 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 #include <v8-debug.h> | 28 #include <v8-debug.h> |
| 29 #include <memory> | 29 #include <memory> |
| 30 #include "bindings/core/v8/DOMDataStore.h" | 30 #include "bindings/core/v8/DOMDataStore.h" |
| 31 #include "bindings/core/v8/ScriptSourceCode.h" | 31 #include "bindings/core/v8/ScriptSourceCode.h" |
| 32 #include "bindings/core/v8/V8HiddenValue.h" | 32 #include "bindings/core/v8/V8HiddenValue.h" |
| 33 #include "bindings/core/v8/V8ObjectConstructor.h" | 33 #include "bindings/core/v8/V8ObjectConstructor.h" |
| 34 #include "bindings/core/v8/V8PrivateProperty.h" | 34 #include "bindings/core/v8/V8PrivateProperty.h" |
| 35 #include "bindings/core/v8/V8ScriptRunner.h" | 35 #include "bindings/core/v8/V8ScriptRunner.h" |
| 36 #include "bindings/core/v8/V8ValueCache.h" | 36 #include "bindings/core/v8/V8ValueCache.h" |
| 37 #include "core/inspector/MainThreadDebugger.h" | |
| 38 #include "platform/ScriptForbiddenScope.h" | 37 #include "platform/ScriptForbiddenScope.h" |
| 39 #include "public/platform/Platform.h" | 38 #include "public/platform/Platform.h" |
| 40 #include "wtf/LeakAnnotations.h" | 39 #include "wtf/LeakAnnotations.h" |
| 41 #include "wtf/PtrUtil.h" | 40 #include "wtf/PtrUtil.h" |
| 42 | 41 |
| 43 namespace blink { | 42 namespace blink { |
| 44 | 43 |
| 45 static V8PerIsolateData* mainThreadPerIsolateData = 0; | 44 static V8PerIsolateData* mainThreadPerIsolateData = 0; |
| 46 | 45 |
| 47 static void beforeCallEnteredCallback(v8::Isolate* isolate) { | 46 static void beforeCallEnteredCallback(v8::Isolate* isolate) { |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 for (const auto& task : tasks) | 259 for (const auto& task : tasks) |
| 261 task->run(); | 260 task->run(); |
| 262 ASSERT(m_endOfScopeTasks.isEmpty()); | 261 ASSERT(m_endOfScopeTasks.isEmpty()); |
| 263 } | 262 } |
| 264 | 263 |
| 265 void V8PerIsolateData::clearEndOfScopeTasks() { | 264 void V8PerIsolateData::clearEndOfScopeTasks() { |
| 266 m_endOfScopeTasks.clear(); | 265 m_endOfScopeTasks.clear(); |
| 267 } | 266 } |
| 268 | 267 |
| 269 void V8PerIsolateData::setThreadDebugger( | 268 void V8PerIsolateData::setThreadDebugger( |
| 270 std::unique_ptr<ThreadDebugger> threadDebugger) { | 269 std::unique_ptr<V8PerIsolateData::Data> threadDebugger) { |
| 271 ASSERT(!m_threadDebugger); | 270 ASSERT(!m_threadDebugger); |
| 272 m_threadDebugger = std::move(threadDebugger); | 271 m_threadDebugger = std::move(threadDebugger); |
| 273 } | 272 } |
| 274 | 273 |
| 275 ThreadDebugger* V8PerIsolateData::threadDebugger() { | 274 V8PerIsolateData::Data* V8PerIsolateData::threadDebugger() { |
| 276 return m_threadDebugger.get(); | 275 return m_threadDebugger.get(); |
| 277 } | 276 } |
| 278 | 277 |
| 279 void V8PerIsolateData::addActiveScriptWrappable( | 278 void V8PerIsolateData::addActiveScriptWrappable( |
| 280 ActiveScriptWrappableBase* wrappable) { | 279 ActiveScriptWrappableBase* wrappable) { |
| 281 if (!m_activeScriptWrappables) | 280 if (!m_activeScriptWrappables) |
| 282 m_activeScriptWrappables = new ActiveScriptWrappableSet(); | 281 m_activeScriptWrappables = new ActiveScriptWrappableSet(); |
| 283 | 282 |
| 284 m_activeScriptWrappables->insert(wrappable); | 283 m_activeScriptWrappables->insert(wrappable); |
| 285 } | 284 } |
| 286 | 285 |
| 287 void V8PerIsolateData::TemporaryScriptWrappableVisitorScope:: | 286 void V8PerIsolateData::TemporaryScriptWrappableVisitorScope:: |
| 288 swapWithV8PerIsolateDataVisitor( | 287 swapWithV8PerIsolateDataVisitor( |
| 289 std::unique_ptr<ScriptWrappableVisitor>& visitor) { | 288 std::unique_ptr<ScriptWrappableVisitor>& visitor) { |
| 290 ScriptWrappableVisitor* current = currentVisitor(); | 289 ScriptWrappableVisitor* current = currentVisitor(); |
| 291 if (current) | 290 if (current) |
| 292 current->performCleanup(); | 291 current->performCleanup(); |
| 293 | 292 |
| 294 V8PerIsolateData::from(m_isolate)->m_scriptWrappableVisitor.swap( | 293 V8PerIsolateData::from(m_isolate)->m_scriptWrappableVisitor.swap( |
| 295 m_savedVisitor); | 294 m_savedVisitor); |
| 296 m_isolate->SetEmbedderHeapTracer(currentVisitor()); | 295 m_isolate->SetEmbedderHeapTracer(currentVisitor()); |
| 297 } | 296 } |
| 298 | 297 |
| 299 } // namespace blink | 298 } // namespace blink |
| OLD | NEW |