| 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 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 669 return toDOMWindow(context->GetIsolate(), context->Global()); | 669 return toDOMWindow(context->GetIsolate(), context->Global()); |
| 670 } | 670 } |
| 671 | 671 |
| 672 LocalDOMWindow* enteredDOMWindow(v8::Isolate* isolate) | 672 LocalDOMWindow* enteredDOMWindow(v8::Isolate* isolate) |
| 673 { | 673 { |
| 674 LocalDOMWindow* window = toLocalDOMWindow(toDOMWindow(isolate->GetEnteredCon
text())); | 674 LocalDOMWindow* window = toLocalDOMWindow(toDOMWindow(isolate->GetEnteredCon
text())); |
| 675 if (!window) { | 675 if (!window) { |
| 676 // We don't always have an entered DOM window, for example during microt
ask callbacks from V8 | 676 // We don't always have an entered DOM window, for example during microt
ask callbacks from V8 |
| 677 // (where the entered context may be the DOM-in-JS context). In that cas
e, we fall back | 677 // (where the entered context may be the DOM-in-JS context). In that cas
e, we fall back |
| 678 // to the current context. | 678 // to the current context. |
| 679 // |
| 680 // TODO(haraken): It's nasty to return a current window from enteredDOMW
indow. |
| 681 // All call sites should be updated so that it works even if it doesn't
have |
| 682 // an entered window. |
| 679 window = currentDOMWindow(isolate); | 683 window = currentDOMWindow(isolate); |
| 680 ASSERT(window); | 684 ASSERT(window); |
| 681 } | 685 } |
| 682 return window; | 686 return window; |
| 683 } | 687 } |
| 684 | 688 |
| 685 LocalDOMWindow* currentDOMWindow(v8::Isolate* isolate) | 689 LocalDOMWindow* currentDOMWindow(v8::Isolate* isolate) |
| 686 { | 690 { |
| 687 return toLocalDOMWindow(toDOMWindow(isolate->GetCurrentContext())); | 691 return toLocalDOMWindow(toDOMWindow(isolate->GetCurrentContext())); |
| 688 } | 692 } |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 910 { | 914 { |
| 911 v8::Local<v8::Value> data = info.Data(); | 915 v8::Local<v8::Value> data = info.Data(); |
| 912 ASSERT(data->IsExternal()); | 916 ASSERT(data->IsExternal()); |
| 913 V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->Cre
ationContext()); | 917 V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->Cre
ationContext()); |
| 914 if (!perContextData) | 918 if (!perContextData) |
| 915 return; | 919 return; |
| 916 v8SetReturnValue(info, perContextData->constructorForType(WrapperTypeInfo::u
nwrap(data))); | 920 v8SetReturnValue(info, perContextData->constructorForType(WrapperTypeInfo::u
nwrap(data))); |
| 917 } | 921 } |
| 918 | 922 |
| 919 } // namespace blink | 923 } // namespace blink |
| OLD | NEW |