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

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

Issue 686763002: Fix Runtime.executionContextCreated for crafted iframes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Do not force context initialization 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
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
220 WindowProxy* ScriptController::existingWindowProxy(DOMWrapperWorld& world) 225 WindowProxy* ScriptController::existingWindowProxy(DOMWrapperWorld& world)
221 { 226 {
222 if (world.isMainWorld()) 227 if (world.isMainWorld())
223 return m_windowProxy->isContextInitialized() ? m_windowProxy.get() : 0; 228 return m_windowProxy->isContextInitialized() ? m_windowProxy.get() : 0;
224 229
225 IsolatedWorldMap::iterator iter = m_isolatedWorlds.find(world.worldId()); 230 IsolatedWorldMap::iterator iter = m_isolatedWorlds.find(world.worldId());
226 if (iter == m_isolatedWorlds.end()) 231 if (iter == m_isolatedWorlds.end())
227 return 0; 232 return 0;
228 return iter->value->isContextInitialized() ? iter->value.get() : 0; 233 return iter->value->isContextInitialized() ? iter->value.get() : 0;
229 } 234 }
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 resultArray->Set(i, evaluationResult); 649 resultArray->Set(i, evaluationResult);
645 } 650 }
646 651
647 if (results) { 652 if (results) {
648 for (size_t i = 0; i < resultArray->Length(); ++i) 653 for (size_t i = 0; i < resultArray->Length(); ++i)
649 results->append(handleScope.Escape(resultArray->Get(i))); 654 results->append(handleScope.Escape(resultArray->Get(i)));
650 } 655 }
651 } 656 }
652 657
653 } // namespace blink 658 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698