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

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

Issue 13646003: DevTools: Remove ENABLE(INSPECTOR) and ENABLE(JAVASCRIPT_DEBUGGER) from the code. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 | Annotate | Revision Log
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 double start = currentTime(); 671 double start = currentTime();
672 // V8 binding expects ScriptController::clearWindowShell only be called 672 // V8 binding expects ScriptController::clearWindowShell only be called
673 // when a frame is loading a new page. This creates a new context for the ne w page. 673 // when a frame is loading a new page. This creates a new context for the ne w page.
674 m_windowShell->clearForNavigation(); 674 m_windowShell->clearForNavigation();
675 for (IsolatedWorldMap::iterator iter = m_isolatedWorlds.begin(); iter != m_i solatedWorlds.end(); ++iter) 675 for (IsolatedWorldMap::iterator iter = m_isolatedWorlds.begin(); iter != m_i solatedWorlds.end(); ++iter)
676 iter->value->clearForNavigation(); 676 iter->value->clearForNavigation();
677 V8GCController::hintForCollectGarbage(); 677 V8GCController::hintForCollectGarbage();
678 HistogramSupport::histogramCustomCounts("WebCore.ScriptController.clearWindo wShell", (currentTime() - start) * 1000, 0, 10000, 50); 678 HistogramSupport::histogramCustomCounts("WebCore.ScriptController.clearWindo wShell", (currentTime() - start) * 1000, 0, 10000, 50);
679 } 679 }
680 680
681 #if ENABLE(INSPECTOR)
682 void ScriptController::setCaptureCallStackForUncaughtExceptions(bool value) 681 void ScriptController::setCaptureCallStackForUncaughtExceptions(bool value)
683 { 682 {
684 v8::V8::SetCaptureStackTraceForUncaughtExceptions(value, ScriptCallStack::ma xCallStackSizeToCapture, stackTraceOptions); 683 v8::V8::SetCaptureStackTraceForUncaughtExceptions(value, ScriptCallStack::ma xCallStackSizeToCapture, stackTraceOptions);
685 } 684 }
686 685
687 void ScriptController::collectIsolatedContexts(Vector<std::pair<ScriptState*, Se curityOrigin*> >& result) 686 void ScriptController::collectIsolatedContexts(Vector<std::pair<ScriptState*, Se curityOrigin*> >& result)
688 { 687 {
689 v8::HandleScope handleScope; 688 v8::HandleScope handleScope;
690 for (IsolatedWorldMap::iterator it = m_isolatedWorlds.begin(); it != m_isola tedWorlds.end(); ++it) { 689 for (IsolatedWorldMap::iterator it = m_isolatedWorlds.begin(); it != m_isola tedWorlds.end(); ++it) {
691 V8DOMWindowShell* isolatedWorldShell = it->value.get(); 690 V8DOMWindowShell* isolatedWorldShell = it->value.get();
692 SecurityOrigin* origin = isolatedWorldShell->world()->isolatedWorldSecur ityOrigin(); 691 SecurityOrigin* origin = isolatedWorldShell->world()->isolatedWorldSecur ityOrigin();
693 if (!origin) 692 if (!origin)
694 continue; 693 continue;
695 v8::Handle<v8::Context> v8Context = isolatedWorldShell->context(); 694 v8::Handle<v8::Context> v8Context = isolatedWorldShell->context();
696 if (v8Context.IsEmpty()) 695 if (v8Context.IsEmpty())
697 continue; 696 continue;
698 ScriptState* scriptState = ScriptState::forContext(v8::Local<v8::Context >::New(v8Context)); 697 ScriptState* scriptState = ScriptState::forContext(v8::Local<v8::Context >::New(v8Context));
699 result.append(std::pair<ScriptState*, SecurityOrigin*>(scriptState, orig in)); 698 result.append(std::pair<ScriptState*, SecurityOrigin*>(scriptState, orig in));
700 } 699 }
701 } 700 }
702 #endif
703 701
704 bool ScriptController::setContextDebugId(int debugId) 702 bool ScriptController::setContextDebugId(int debugId)
705 { 703 {
706 ASSERT(debugId > 0); 704 ASSERT(debugId > 0);
707 if (!m_windowShell->isContextInitialized()) 705 if (!m_windowShell->isContextInitialized())
708 return false; 706 return false;
709 v8::HandleScope scope; 707 v8::HandleScope scope;
710 v8::Handle<v8::Context> context = m_windowShell->context(); 708 v8::Handle<v8::Context> context = m_windowShell->context();
711 return V8PerContextDebugData::setContextDebugData(context, "page", debugId); 709 return V8PerContextDebugData::setContextDebugData(context, "page", debugId);
712 } 710 }
(...skipping 17 matching lines...) Expand all
730 { 728 {
731 windowShell(mainThreadNormalWorld())->namedItemAdded(doc, name); 729 windowShell(mainThreadNormalWorld())->namedItemAdded(doc, name);
732 } 730 }
733 731
734 void ScriptController::namedItemRemoved(HTMLDocument* doc, const AtomicString& n ame) 732 void ScriptController::namedItemRemoved(HTMLDocument* doc, const AtomicString& n ame)
735 { 733 {
736 windowShell(mainThreadNormalWorld())->namedItemRemoved(doc, name); 734 windowShell(mainThreadNormalWorld())->namedItemRemoved(doc, name);
737 } 735 }
738 736
739 } // namespace WebCore 737 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698