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

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

Issue 263583002: Reland: Do not initialize v8::Context on |ScriptController::updateDocument|. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: simplify Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/testing/v8/WebCoreTestSupport.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 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 return V8PerContextDebugData::setContextDebugData(context, "page", debugId); 466 return V8PerContextDebugData::setContextDebugData(context, "page", debugId);
467 } 467 }
468 468
469 int ScriptController::contextDebugId(v8::Handle<v8::Context> context) 469 int ScriptController::contextDebugId(v8::Handle<v8::Context> context)
470 { 470 {
471 return V8PerContextDebugData::contextDebugId(context); 471 return V8PerContextDebugData::contextDebugId(context);
472 } 472 }
473 473
474 void ScriptController::updateDocument() 474 void ScriptController::updateDocument()
475 { 475 {
476 // For an uninitialized main window shell, do not incur the cost of context initialization during FrameLoader::init(). 476 // For an uninitialized main window shell, do not incur the cost of context initialization.
477 if ((!m_windowShell->isContextInitialized() || !m_windowShell->isGlobalIniti alized()) && m_frame->loader().stateMachine()->creatingInitialEmptyDocument()) 477 if (!m_windowShell->isGlobalInitialized())
478 return; 478 return;
479 479
480 if (!initializeMainWorld()) 480 if (!initializeMainWorld())
481 windowShell(DOMWrapperWorld::mainWorld())->updateDocument(); 481 windowShell(DOMWrapperWorld::mainWorld())->updateDocument();
482 } 482 }
483 483
484 void ScriptController::namedItemAdded(HTMLDocument* doc, const AtomicString& nam e) 484 void ScriptController::namedItemAdded(HTMLDocument* doc, const AtomicString& nam e)
485 { 485 {
486 windowShell(DOMWrapperWorld::mainWorld())->namedItemAdded(doc, name); 486 windowShell(DOMWrapperWorld::mainWorld())->namedItemAdded(doc, name);
487 } 487 }
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 v8Results = evaluateHandleScope.Escape(resultArray); 630 v8Results = evaluateHandleScope.Escape(resultArray);
631 } 631 }
632 632
633 if (results && !v8Results.IsEmpty()) { 633 if (results && !v8Results.IsEmpty()) {
634 for (size_t i = 0; i < v8Results->Length(); ++i) 634 for (size_t i = 0; i < v8Results->Length(); ++i)
635 results->append(ScriptValue(v8Results->Get(i), m_isolate)); 635 results->append(ScriptValue(v8Results->Get(i), m_isolate));
636 } 636 }
637 } 637 }
638 638
639 } // namespace WebCore 639 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/core/testing/v8/WebCoreTestSupport.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698