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

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

Issue 14362015: WIP enum / V8PerContextData solution (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Crash during GC Created 7 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
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 660 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 } 671 }
672 } 672 }
673 673
674 bool ScriptController::setContextDebugId(int debugId) 674 bool ScriptController::setContextDebugId(int debugId)
675 { 675 {
676 ASSERT(debugId > 0); 676 ASSERT(debugId > 0);
677 if (!m_windowShell->isContextInitialized()) 677 if (!m_windowShell->isContextInitialized())
678 return false; 678 return false;
679 v8::HandleScope scope; 679 v8::HandleScope scope;
680 v8::Handle<v8::Context> context = m_windowShell->context(); 680 v8::Handle<v8::Context> context = m_windowShell->context();
681 return V8PerContextDebugData::setContextDebugData(context, "page", debugId); 681 V8PerContextDebugData::setDebugDataForPage(context, debugId);
682 return true;
682 } 683 }
683 684
684 int ScriptController::contextDebugId(v8::Handle<v8::Context> context) 685 int ScriptController::contextDebugId(v8::Handle<v8::Context> context)
685 { 686 {
686 return V8PerContextDebugData::contextDebugId(context); 687 return V8PerContextDebugData::debugId(context);
687 } 688 }
688 689
689 void ScriptController::updateDocument() 690 void ScriptController::updateDocument()
690 { 691 {
691 // For an uninitialized main window shell, do not incur the cost of context initialization during FrameLoader::init(). 692 // For an uninitialized main window shell, do not incur the cost of context initialization during FrameLoader::init().
692 if ((!m_windowShell->isContextInitialized() || !m_windowShell->isGlobalIniti alized()) && m_frame->loader()->stateMachine()->creatingInitialEmptyDocument()) 693 if ((!m_windowShell->isContextInitialized() || !m_windowShell->isGlobalIniti alized()) && m_frame->loader()->stateMachine()->creatingInitialEmptyDocument())
693 return; 694 return;
694 695
695 if (!initializeMainWorld()) 696 if (!initializeMainWorld())
696 windowShell(mainThreadNormalWorld())->updateDocument(); 697 windowShell(mainThreadNormalWorld())->updateDocument();
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
780 781
781 // DocumentWriter::replaceDocument can cause the DocumentLoader to get d eref'ed and possible destroyed, 782 // DocumentWriter::replaceDocument can cause the DocumentLoader to get d eref'ed and possible destroyed,
782 // so protect it with a RefPtr. 783 // so protect it with a RefPtr.
783 if (RefPtr<DocumentLoader> loader = m_frame->document()->loader()) 784 if (RefPtr<DocumentLoader> loader = m_frame->document()->loader())
784 loader->writer()->replaceDocument(scriptResult, ownerDocument.get()) ; 785 loader->writer()->replaceDocument(scriptResult, ownerDocument.get()) ;
785 } 786 }
786 return true; 787 return true;
787 } 788 }
788 789
789 } // namespace WebCore 790 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/v8/ScriptDebugServer.h » ('j') | Source/bindings/v8/V8DOMWindowShell.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698