| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 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 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 { | 642 { |
| 643 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 643 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
| 644 if (data->workerDOMDataStore()) | 644 if (data->workerDOMDataStore()) |
| 645 return 0; | 645 return 0; |
| 646 if (!DOMWrapperWorld::isolatedWorldsExist()) | 646 if (!DOMWrapperWorld::isolatedWorldsExist()) |
| 647 return 0; | 647 return 0; |
| 648 ASSERT(isolate->InContext()); | 648 ASSERT(isolate->InContext()); |
| 649 return DOMWrapperWorld::isolatedWorld(isolate->GetCurrentContext()); | 649 return DOMWrapperWorld::isolatedWorld(isolate->GetCurrentContext()); |
| 650 } | 650 } |
| 651 | 651 |
| 652 v8::Local<v8::Value> getHiddenValue(v8::Isolate* isolate, v8::Handle<v8::Object>
object, const char* key) |
| 653 { |
| 654 return getHiddenValue(isolate, object, v8AtomicString(isolate, key)); |
| 655 } |
| 656 |
| 657 v8::Local<v8::Value> getHiddenValue(v8::Isolate* isolate, v8::Handle<v8::Object>
object, v8::Handle<v8::String> key) |
| 658 { |
| 659 return object->GetHiddenValue(key); |
| 660 } |
| 661 |
| 662 bool setHiddenValue(v8::Isolate* isolate, v8::Handle<v8::Object> object, const c
har* key, v8::Handle<v8::Value> value) |
| 663 { |
| 664 return setHiddenValue(isolate, object, v8AtomicString(isolate, key), value); |
| 665 } |
| 666 |
| 667 bool setHiddenValue(v8::Isolate* isolate, v8::Handle<v8::Object> object, v8::Han
dle<v8::String> key, v8::Handle<v8::Value> value) |
| 668 { |
| 669 return object->SetHiddenValue(key, value); |
| 670 } |
| 671 |
| 672 bool deleteHiddenValue(v8::Isolate* isolate, v8::Handle<v8::Object> object, cons
t char* key) |
| 673 { |
| 674 return deleteHiddenValue(isolate, object, v8AtomicString(isolate, key)); |
| 675 } |
| 676 |
| 677 bool deleteHiddenValue(v8::Isolate* isolate, v8::Handle<v8::Object> object, v8::
Handle<v8::String> key) |
| 678 { |
| 679 return object->DeleteHiddenValue(key); |
| 680 } |
| 681 |
| 682 v8::Local<v8::Value> getHiddenValueFromMainWorldWrapper(v8::Isolate* isolate, Sc
riptWrappable* wrappable, const char* key) |
| 683 { |
| 684 return getHiddenValueFromMainWorldWrapper(isolate, wrappable, v8AtomicString
(isolate, key)); |
| 685 } |
| 686 |
| 652 v8::Local<v8::Value> getHiddenValueFromMainWorldWrapper(v8::Isolate* isolate, Sc
riptWrappable* wrappable, v8::Handle<v8::String> key) | 687 v8::Local<v8::Value> getHiddenValueFromMainWorldWrapper(v8::Isolate* isolate, Sc
riptWrappable* wrappable, v8::Handle<v8::String> key) |
| 653 { | 688 { |
| 654 v8::Local<v8::Object> wrapper = wrappable->newLocalWrapper(isolate); | 689 v8::Local<v8::Object> wrapper = wrappable->newLocalWrapper(isolate); |
| 655 return wrapper.IsEmpty() ? v8::Local<v8::Value>() : wrapper->GetHiddenValue(
key); | 690 return wrapper.IsEmpty() ? v8::Local<v8::Value>() : getHiddenValue(isolate,
wrapper, key); |
| 656 } | 691 } |
| 657 | 692 |
| 658 static gin::IsolateHolder* mainIsolateHolder = 0; | 693 static gin::IsolateHolder* mainIsolateHolder = 0; |
| 659 | 694 |
| 660 v8::Isolate* mainThreadIsolate() | 695 v8::Isolate* mainThreadIsolate() |
| 661 { | 696 { |
| 662 ASSERT(mainIsolateHolder); | 697 ASSERT(mainIsolateHolder); |
| 663 ASSERT(isMainThread()); | 698 ASSERT(isMainThread()); |
| 664 return mainIsolateHolder->isolate(); | 699 return mainIsolateHolder->isolate(); |
| 665 } | 700 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 682 return mainThreadIsolate(); | 717 return mainThreadIsolate(); |
| 683 return v8::Isolate::GetCurrent(); | 718 return v8::Isolate::GetCurrent(); |
| 684 } | 719 } |
| 685 | 720 |
| 686 v8::Isolate* toIsolate(Frame* frame) | 721 v8::Isolate* toIsolate(Frame* frame) |
| 687 { | 722 { |
| 688 return frame->script().isolate(); | 723 return frame->script().isolate(); |
| 689 } | 724 } |
| 690 | 725 |
| 691 } // namespace WebCore | 726 } // namespace WebCore |
| OLD | NEW |