Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(126)

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp

Issue 1864623004: messageHandlerInMainThread should return immediately if there is no entered window (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698