| 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 * 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 #include "core/events/Event.h" | 50 #include "core/events/Event.h" |
| 51 #include "core/events/EventListener.h" | 51 #include "core/events/EventListener.h" |
| 52 #include "core/frame/LocalDOMWindow.h" | 52 #include "core/frame/LocalDOMWindow.h" |
| 53 #include "core/frame/Settings.h" | 53 #include "core/frame/Settings.h" |
| 54 #include "core/frame/UseCounter.h" | 54 #include "core/frame/UseCounter.h" |
| 55 #include "core/frame/csp/ContentSecurityPolicy.h" | 55 #include "core/frame/csp/ContentSecurityPolicy.h" |
| 56 #include "core/html/HTMLPlugInElement.h" | 56 #include "core/html/HTMLPlugInElement.h" |
| 57 #include "core/inspector/ConsoleMessage.h" | 57 #include "core/inspector/ConsoleMessage.h" |
| 58 #include "core/inspector/InspectorInstrumentation.h" | 58 #include "core/inspector/InspectorInstrumentation.h" |
| 59 #include "core/inspector/InspectorTraceEvents.h" | 59 #include "core/inspector/InspectorTraceEvents.h" |
| 60 #include "core/inspector/MainThreadDebugger.h" |
| 60 #include "core/loader/DocumentLoader.h" | 61 #include "core/loader/DocumentLoader.h" |
| 61 #include "core/loader/FrameLoader.h" | 62 #include "core/loader/FrameLoader.h" |
| 62 #include "core/loader/FrameLoaderClient.h" | 63 #include "core/loader/FrameLoaderClient.h" |
| 63 #include "core/loader/NavigationScheduler.h" | 64 #include "core/loader/NavigationScheduler.h" |
| 64 #include "core/loader/ProgressTracker.h" | 65 #include "core/loader/ProgressTracker.h" |
| 65 #include "core/plugins/PluginView.h" | 66 #include "core/plugins/PluginView.h" |
| 66 #include "platform/Histogram.h" | 67 #include "platform/Histogram.h" |
| 67 #include "platform/TraceEvent.h" | 68 #include "platform/TraceEvent.h" |
| 68 #include "platform/UserGestureIndicator.h" | 69 #include "platform/UserGestureIndicator.h" |
| 69 #include "platform/Widget.h" | 70 #include "platform/Widget.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 92 } | 93 } |
| 93 | 94 |
| 94 DEFINE_TRACE(ScriptController) | 95 DEFINE_TRACE(ScriptController) |
| 95 { | 96 { |
| 96 visitor->trace(m_windowProxyManager); | 97 visitor->trace(m_windowProxyManager); |
| 97 } | 98 } |
| 98 | 99 |
| 99 void ScriptController::clearForClose() | 100 void ScriptController::clearForClose() |
| 100 { | 101 { |
| 101 m_windowProxyManager->clearForClose(); | 102 m_windowProxyManager->clearForClose(); |
| 103 MainThreadDebugger::instance()->didClearContextsForFrame(frame()); |
| 102 } | 104 } |
| 103 | 105 |
| 104 void ScriptController::updateSecurityOrigin(SecurityOrigin* origin) | 106 void ScriptController::updateSecurityOrigin(SecurityOrigin* origin) |
| 105 { | 107 { |
| 106 m_windowProxyManager->mainWorldProxy()->updateSecurityOrigin(origin); | 108 m_windowProxyManager->mainWorldProxy()->updateSecurityOrigin(origin); |
| 107 Vector<std::pair<ScriptState*, SecurityOrigin*>> isolatedContexts; | 109 Vector<std::pair<ScriptState*, SecurityOrigin*>> isolatedContexts; |
| 108 m_windowProxyManager->collectIsolatedContexts(isolatedContexts); | 110 m_windowProxyManager->collectIsolatedContexts(isolatedContexts); |
| 109 for (auto isolatedContext : isolatedContexts) | 111 for (auto isolatedContext : isolatedContexts) |
| 110 m_windowProxyManager->windowProxy(isolatedContext.first->world())->updat
eSecurityOrigin(isolatedContext.second); | 112 m_windowProxyManager->windowProxy(isolatedContext.first->world())->updat
eSecurityOrigin(isolatedContext.second); |
| 111 } | 113 } |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 } | 261 } |
| 260 v8::RegisterExtension(extension); | 262 v8::RegisterExtension(extension); |
| 261 registeredExtensions().append(extension); | 263 registeredExtensions().append(extension); |
| 262 } | 264 } |
| 263 | 265 |
| 264 void ScriptController::clearWindowProxy() | 266 void ScriptController::clearWindowProxy() |
| 265 { | 267 { |
| 266 // V8 binding expects ScriptController::clearWindowProxy only be called | 268 // V8 binding expects ScriptController::clearWindowProxy only be called |
| 267 // when a frame is loading a new page. This creates a new context for the ne
w page. | 269 // when a frame is loading a new page. This creates a new context for the ne
w page. |
| 268 m_windowProxyManager->clearForNavigation(); | 270 m_windowProxyManager->clearForNavigation(); |
| 271 MainThreadDebugger::instance()->didClearContextsForFrame(frame()); |
| 269 } | 272 } |
| 270 | 273 |
| 271 void ScriptController::setCaptureCallStackForUncaughtExceptions(v8::Isolate* iso
late, bool value) | 274 void ScriptController::setCaptureCallStackForUncaughtExceptions(v8::Isolate* iso
late, bool value) |
| 272 { | 275 { |
| 273 isolate->SetCaptureStackTraceForUncaughtExceptions(value, V8StackTrace::maxC
allStackSizeToCapture, stackTraceOptions); | 276 isolate->SetCaptureStackTraceForUncaughtExceptions(value, V8StackTrace::maxC
allStackSizeToCapture, stackTraceOptions); |
| 274 } | 277 } |
| 275 | 278 |
| 276 void ScriptController::collectIsolatedContexts(Vector<std::pair<ScriptState*, Se
curityOrigin*>>& result) | 279 void ScriptController::collectIsolatedContexts(Vector<std::pair<ScriptState*, Se
curityOrigin*>>& result) |
| 277 { | 280 { |
| 278 m_windowProxyManager->collectIsolatedContexts(result); | 281 m_windowProxyManager->collectIsolatedContexts(result); |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 for (size_t i = 0; i < resultArray->Length(); ++i) { | 446 for (size_t i = 0; i < resultArray->Length(); ++i) { |
| 444 v8::Local<v8::Value> value; | 447 v8::Local<v8::Value> value; |
| 445 if (!resultArray->Get(scriptState->context(), i).ToLocal(&value)) | 448 if (!resultArray->Get(scriptState->context(), i).ToLocal(&value)) |
| 446 return; | 449 return; |
| 447 results->append(value); | 450 results->append(value); |
| 448 } | 451 } |
| 449 } | 452 } |
| 450 } | 453 } |
| 451 | 454 |
| 452 } // namespace blink | 455 } // namespace blink |
| OLD | NEW |