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

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

Issue 1431963002: Don't allow main world initialization while creating the initial empty document Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 | « chrome/test/data/extensions/api_test/bindings/chromei18nrepro/window.js ('k') | no next file » | 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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 return result; 191 return result;
192 } 192 }
193 193
194 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Update Counters", TRACE_EVENT_SCOPE_THREAD, "data", InspectorUpdateCountersEvent::data( )); 194 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Update Counters", TRACE_EVENT_SCOPE_THREAD, "data", InspectorUpdateCountersEvent::data( ));
195 195
196 return result; 196 return result;
197 } 197 }
198 198
199 bool ScriptController::initializeMainWorld() 199 bool ScriptController::initializeMainWorld()
200 { 200 {
201 if (m_windowProxyManager->mainWorldProxy()->isContextInitialized()) 201 if (m_windowProxyManager->mainWorldProxy()->isContextInitialized() || frame( )->loader().stateMachine()->creatingInitialEmptyDocument())
202 return false; 202 return false;
203 return windowProxy(DOMWrapperWorld::mainWorld())->isContextInitialized(); 203 return windowProxy(DOMWrapperWorld::mainWorld())->isContextInitialized();
204 } 204 }
205 205
206 WindowProxy* ScriptController::existingWindowProxy(DOMWrapperWorld& world) 206 WindowProxy* ScriptController::existingWindowProxy(DOMWrapperWorld& world)
207 { 207 {
208 return m_windowProxyManager->existingWindowProxy(world); 208 return m_windowProxyManager->existingWindowProxy(world);
209 } 209 }
210 210
211 WindowProxy* ScriptController::windowProxy(DOMWrapperWorld& world) 211 WindowProxy* ScriptController::windowProxy(DOMWrapperWorld& world)
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 for (size_t i = 0; i < resultArray->Length(); ++i) { 597 for (size_t i = 0; i < resultArray->Length(); ++i) {
598 v8::Local<v8::Value> value; 598 v8::Local<v8::Value> value;
599 if (!resultArray->Get(scriptState->context(), i).ToLocal(&value)) 599 if (!resultArray->Get(scriptState->context(), i).ToLocal(&value))
600 return; 600 return;
601 results->append(value); 601 results->append(value);
602 } 602 }
603 } 603 }
604 } 604 }
605 605
606 } // namespace blink 606 } // namespace blink
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/api_test/bindings/chromei18nrepro/window.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698