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

Side by Side Diff: Source/bindings/core/v8/ScriptController.cpp

Issue 711853002: Revert of Fix Runtime.executionContextCreated for crafted iframes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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 | « Source/bindings/core/v8/ScriptController.h ('k') | Source/bindings/core/v8/WindowProxy.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) 2008, 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2008, 2009 Google Inc. All rights reserved.
3 * Copyright (C) 2009 Apple Inc. All rights reserved. 3 * Copyright (C) 2009 Apple Inc. All rights reserved.
4 * Copyright (C) 2014 Opera Software ASA. All rights reserved. 4 * Copyright (C) 2014 Opera Software ASA. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are 7 * modification, are permitted provided that the following conditions are
8 * met: 8 * met:
9 * 9 *
10 * * Redistributions of source code must retain the above copyright 10 * * Redistributions of source code must retain the above copyright
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 return result; 210 return result;
211 } 211 }
212 212
213 bool ScriptController::initializeMainWorld() 213 bool ScriptController::initializeMainWorld()
214 { 214 {
215 if (m_windowProxy->isContextInitialized()) 215 if (m_windowProxy->isContextInitialized())
216 return false; 216 return false;
217 return windowProxy(DOMWrapperWorld::mainWorld())->isContextInitialized(); 217 return windowProxy(DOMWrapperWorld::mainWorld())->isContextInitialized();
218 } 218 }
219 219
220 bool ScriptController::isMainWorldInitialized()
221 {
222 return m_windowProxy->isContextInitialized();
223 }
224
225 WindowProxy* ScriptController::existingWindowProxy(DOMWrapperWorld& world) 220 WindowProxy* ScriptController::existingWindowProxy(DOMWrapperWorld& world)
226 { 221 {
227 if (world.isMainWorld()) 222 if (world.isMainWorld())
228 return m_windowProxy->isContextInitialized() ? m_windowProxy.get() : 0; 223 return m_windowProxy->isContextInitialized() ? m_windowProxy.get() : 0;
229 224
230 IsolatedWorldMap::iterator iter = m_isolatedWorlds.find(world.worldId()); 225 IsolatedWorldMap::iterator iter = m_isolatedWorlds.find(world.worldId());
231 if (iter == m_isolatedWorlds.end()) 226 if (iter == m_isolatedWorlds.end())
232 return 0; 227 return 0;
233 return iter->value->isContextInitialized() ? iter->value.get() : 0; 228 return iter->value->isContextInitialized() ? iter->value.get() : 0;
234 } 229 }
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 resultArray->Set(i, evaluationResult); 644 resultArray->Set(i, evaluationResult);
650 } 645 }
651 646
652 if (results) { 647 if (results) {
653 for (size_t i = 0; i < resultArray->Length(); ++i) 648 for (size_t i = 0; i < resultArray->Length(); ++i)
654 results->append(handleScope.Escape(resultArray->Get(i))); 649 results->append(handleScope.Escape(resultArray->Get(i)));
655 } 650 }
656 } 651 }
657 652
658 } // namespace blink 653 } // namespace blink
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/ScriptController.h ('k') | Source/bindings/core/v8/WindowProxy.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698