| OLD | NEW |
| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 #include "core/inspector/InspectorInstrumentation.h" | 59 #include "core/inspector/InspectorInstrumentation.h" |
| 60 #include "core/inspector/ScriptCallStack.h" | 60 #include "core/inspector/ScriptCallStack.h" |
| 61 #include "core/loader/DocumentLoader.h" | 61 #include "core/loader/DocumentLoader.h" |
| 62 #include "core/loader/FrameLoader.h" | 62 #include "core/loader/FrameLoader.h" |
| 63 #include "core/loader/FrameLoaderClient.h" | 63 #include "core/loader/FrameLoaderClient.h" |
| 64 #include "core/frame/ContentSecurityPolicy.h" | 64 #include "core/frame/ContentSecurityPolicy.h" |
| 65 #include "core/frame/DOMWindow.h" | 65 #include "core/frame/DOMWindow.h" |
| 66 #include "core/frame/Frame.h" | 66 #include "core/frame/Frame.h" |
| 67 #include "core/page/Page.h" | 67 #include "core/page/Page.h" |
| 68 #include "core/page/Settings.h" | 68 #include "core/page/Settings.h" |
| 69 #include "core/platform/HistogramSupport.h" | |
| 70 #include "core/plugins/PluginView.h" | 69 #include "core/plugins/PluginView.h" |
| 71 #include "platform/NotImplemented.h" | 70 #include "platform/NotImplemented.h" |
| 72 #include "platform/TraceEvent.h" | 71 #include "platform/TraceEvent.h" |
| 73 #include "platform/UserGestureIndicator.h" | 72 #include "platform/UserGestureIndicator.h" |
| 74 #include "platform/Widget.h" | 73 #include "platform/Widget.h" |
| 74 #include "public/platform/Platform.h" |
| 75 #include "weborigin/SecurityOrigin.h" | 75 #include "weborigin/SecurityOrigin.h" |
| 76 #include "wtf/CurrentTime.h" | 76 #include "wtf/CurrentTime.h" |
| 77 #include "wtf/StdLibExtras.h" | 77 #include "wtf/StdLibExtras.h" |
| 78 #include "wtf/StringExtras.h" | 78 #include "wtf/StringExtras.h" |
| 79 #include "wtf/text/CString.h" | 79 #include "wtf/text/CString.h" |
| 80 #include "wtf/text/StringBuilder.h" | 80 #include "wtf/text/StringBuilder.h" |
| 81 #include "wtf/text/TextPosition.h" | 81 #include "wtf/text/TextPosition.h" |
| 82 | 82 |
| 83 namespace WebCore { | 83 namespace WebCore { |
| 84 | 84 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 m_windowShell->clearForClose(destroyGlobal); | 131 m_windowShell->clearForClose(destroyGlobal); |
| 132 for (IsolatedWorldMap::iterator iter = m_isolatedWorlds.begin(); iter != m_i
solatedWorlds.end(); ++iter) | 132 for (IsolatedWorldMap::iterator iter = m_isolatedWorlds.begin(); iter != m_i
solatedWorlds.end(); ++iter) |
| 133 iter->value->clearForClose(destroyGlobal); | 133 iter->value->clearForClose(destroyGlobal); |
| 134 V8GCController::hintForCollectGarbage(); | 134 V8GCController::hintForCollectGarbage(); |
| 135 } | 135 } |
| 136 | 136 |
| 137 void ScriptController::clearForClose() | 137 void ScriptController::clearForClose() |
| 138 { | 138 { |
| 139 double start = currentTime(); | 139 double start = currentTime(); |
| 140 clearForClose(false); | 140 clearForClose(false); |
| 141 HistogramSupport::histogramCustomCounts("WebCore.ScriptController.clearForCl
ose", (currentTime() - start) * 1000, 0, 10000, 50); | 141 WebKit::Platform::current()->histogramCustomCounts("WebCore.ScriptController
.clearForClose", (currentTime() - start) * 1000, 0, 10000, 50); |
| 142 } | 142 } |
| 143 | 143 |
| 144 void ScriptController::updateSecurityOrigin() | 144 void ScriptController::updateSecurityOrigin() |
| 145 { | 145 { |
| 146 m_windowShell->updateSecurityOrigin(); | 146 m_windowShell->updateSecurityOrigin(); |
| 147 } | 147 } |
| 148 | 148 |
| 149 v8::Local<v8::Value> ScriptController::callFunction(v8::Handle<v8::Function> fun
ction, v8::Handle<v8::Object> receiver, int argc, v8::Handle<v8::Value> args[]) | 149 v8::Local<v8::Value> ScriptController::callFunction(v8::Handle<v8::Function> fun
ction, v8::Handle<v8::Object> receiver, int argc, v8::Handle<v8::Value> args[]) |
| 150 { | 150 { |
| 151 // Keep Frame (and therefore ScriptController) alive. | 151 // Keep Frame (and therefore ScriptController) alive. |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 | 497 |
| 498 void ScriptController::clearWindowShell() | 498 void ScriptController::clearWindowShell() |
| 499 { | 499 { |
| 500 double start = currentTime(); | 500 double start = currentTime(); |
| 501 // V8 binding expects ScriptController::clearWindowShell only be called | 501 // V8 binding expects ScriptController::clearWindowShell only be called |
| 502 // when a frame is loading a new page. This creates a new context for the ne
w page. | 502 // when a frame is loading a new page. This creates a new context for the ne
w page. |
| 503 m_windowShell->clearForNavigation(); | 503 m_windowShell->clearForNavigation(); |
| 504 for (IsolatedWorldMap::iterator iter = m_isolatedWorlds.begin(); iter != m_i
solatedWorlds.end(); ++iter) | 504 for (IsolatedWorldMap::iterator iter = m_isolatedWorlds.begin(); iter != m_i
solatedWorlds.end(); ++iter) |
| 505 iter->value->clearForNavigation(); | 505 iter->value->clearForNavigation(); |
| 506 V8GCController::hintForCollectGarbage(); | 506 V8GCController::hintForCollectGarbage(); |
| 507 HistogramSupport::histogramCustomCounts("WebCore.ScriptController.clearWindo
wShell", (currentTime() - start) * 1000, 0, 10000, 50); | 507 WebKit::Platform::current()->histogramCustomCounts("WebCore.ScriptController
.clearWindowShell", (currentTime() - start) * 1000, 0, 10000, 50); |
| 508 } | 508 } |
| 509 | 509 |
| 510 void ScriptController::setCaptureCallStackForUncaughtExceptions(bool value) | 510 void ScriptController::setCaptureCallStackForUncaughtExceptions(bool value) |
| 511 { | 511 { |
| 512 v8::V8::SetCaptureStackTraceForUncaughtExceptions(value, ScriptCallStack::ma
xCallStackSizeToCapture, stackTraceOptions); | 512 v8::V8::SetCaptureStackTraceForUncaughtExceptions(value, ScriptCallStack::ma
xCallStackSizeToCapture, stackTraceOptions); |
| 513 } | 513 } |
| 514 | 514 |
| 515 void ScriptController::collectIsolatedContexts(Vector<std::pair<ScriptState*, Se
curityOrigin*> >& result) | 515 void ScriptController::collectIsolatedContexts(Vector<std::pair<ScriptState*, Se
curityOrigin*> >& result) |
| 516 { | 516 { |
| 517 v8::HandleScope handleScope(m_isolate); | 517 v8::HandleScope handleScope(m_isolate); |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 700 v8Results = evaluateHandleScope.Close(resultArray); | 700 v8Results = evaluateHandleScope.Close(resultArray); |
| 701 } | 701 } |
| 702 | 702 |
| 703 if (results && !v8Results.IsEmpty()) { | 703 if (results && !v8Results.IsEmpty()) { |
| 704 for (size_t i = 0; i < v8Results->Length(); ++i) | 704 for (size_t i = 0; i < v8Results->Length(); ++i) |
| 705 results->append(ScriptValue(v8Results->Get(i), m_isolate)); | 705 results->append(ScriptValue(v8Results->Get(i), m_isolate)); |
| 706 } | 706 } |
| 707 } | 707 } |
| 708 | 708 |
| 709 } // namespace WebCore | 709 } // namespace WebCore |
| OLD | NEW |