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 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
780 result.setSmall(storage, length); | 780 result.setSmall(storage, length); |
781 } | 781 } |
782 | 782 |
783 v8::Local<v8::Context> toV8Context(ExecutionContext* context, DOMWrapperWorld& w
orld) | 783 v8::Local<v8::Context> toV8Context(ExecutionContext* context, DOMWrapperWorld& w
orld) |
784 { | 784 { |
785 ASSERT(context); | 785 ASSERT(context); |
786 if (context->isDocument()) { | 786 if (context->isDocument()) { |
787 if (LocalFrame* frame = toDocument(context)->frame()) | 787 if (LocalFrame* frame = toDocument(context)->frame()) |
788 return toV8Context(frame, world); | 788 return toV8Context(frame, world); |
789 } else if (context->isWorkerGlobalScope()) { | 789 } else if (context->isWorkerGlobalScope()) { |
790 if (WorkerOrWorkletScriptController* script = toWorkerOrWorkletGlobalSco
pe(context)->script()) { | 790 if (WorkerOrWorkletScriptController* script = toWorkerOrWorkletGlobalSco
pe(context)->scriptController()) { |
791 if (script->scriptState()->contextIsValid()) | 791 if (script->scriptState()->contextIsValid()) |
792 return script->scriptState()->context(); | 792 return script->scriptState()->context(); |
793 } | 793 } |
794 } | 794 } |
795 return v8::Local<v8::Context>(); | 795 return v8::Local<v8::Context>(); |
796 } | 796 } |
797 | 797 |
798 v8::Local<v8::Context> toV8Context(Frame* frame, DOMWrapperWorld& world) | 798 v8::Local<v8::Context> toV8Context(Frame* frame, DOMWrapperWorld& world) |
799 { | 799 { |
800 if (!frame) | 800 if (!frame) |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
959 { | 959 { |
960 v8::Local<v8::Value> data = info.Data(); | 960 v8::Local<v8::Value> data = info.Data(); |
961 ASSERT(data->IsExternal()); | 961 ASSERT(data->IsExternal()); |
962 V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->Cre
ationContext()); | 962 V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->Cre
ationContext()); |
963 if (!perContextData) | 963 if (!perContextData) |
964 return; | 964 return; |
965 v8SetReturnValue(info, perContextData->constructorForType(WrapperTypeInfo::u
nwrap(data))); | 965 v8SetReturnValue(info, perContextData->constructorForType(WrapperTypeInfo::u
nwrap(data))); |
966 } | 966 } |
967 | 967 |
968 } // namespace blink | 968 } // namespace blink |
OLD | NEW |