OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/api.h" | 5 #include "src/api.h" |
6 | 6 |
7 #include <string.h> // For memcpy, strlen. | 7 #include <string.h> // For memcpy, strlen. |
8 #ifdef V8_USE_ADDRESS_SANITIZER | 8 #ifdef V8_USE_ADDRESS_SANITIZER |
9 #include <sanitizer/asan_interface.h> | 9 #include <sanitizer/asan_interface.h> |
10 #endif // V8_USE_ADDRESS_SANITIZER | 10 #endif // V8_USE_ADDRESS_SANITIZER |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 } | 406 } |
407 | 407 |
408 | 408 |
409 void RegisteredExtension::UnregisterAll() { | 409 void RegisteredExtension::UnregisterAll() { |
410 RegisteredExtension* re = first_extension_; | 410 RegisteredExtension* re = first_extension_; |
411 while (re != NULL) { | 411 while (re != NULL) { |
412 RegisteredExtension* next = re->next(); | 412 RegisteredExtension* next = re->next(); |
413 delete re; | 413 delete re; |
414 re = next; | 414 re = next; |
415 } | 415 } |
| 416 first_extension_ = NULL; |
416 } | 417 } |
417 | 418 |
418 | 419 |
419 void RegisterExtension(Extension* that) { | 420 void RegisterExtension(Extension* that) { |
420 RegisteredExtension* extension = new RegisteredExtension(that); | 421 RegisteredExtension* extension = new RegisteredExtension(that); |
421 RegisteredExtension::Register(extension); | 422 RegisteredExtension::Register(extension); |
422 } | 423 } |
423 | 424 |
424 | 425 |
425 Extension::Extension(const char* name, | 426 Extension::Extension(const char* name, |
(...skipping 7251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7677 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7678 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
7678 Address callback_address = | 7679 Address callback_address = |
7679 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7680 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
7680 VMState<EXTERNAL> state(isolate); | 7681 VMState<EXTERNAL> state(isolate); |
7681 ExternalCallbackScope call_scope(isolate, callback_address); | 7682 ExternalCallbackScope call_scope(isolate, callback_address); |
7682 callback(info); | 7683 callback(info); |
7683 } | 7684 } |
7684 | 7685 |
7685 | 7686 |
7686 } } // namespace v8::internal | 7687 } } // namespace v8::internal |
OLD | NEW |