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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp

Issue 2064133002: [DevTools] Explicitly reset context group when clearing ScriptController. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clear Created 4 years, 6 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 * 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 #include "core/events/Event.h" 49 #include "core/events/Event.h"
50 #include "core/events/EventListener.h" 50 #include "core/events/EventListener.h"
51 #include "core/frame/LocalDOMWindow.h" 51 #include "core/frame/LocalDOMWindow.h"
52 #include "core/frame/Settings.h" 52 #include "core/frame/Settings.h"
53 #include "core/frame/UseCounter.h" 53 #include "core/frame/UseCounter.h"
54 #include "core/frame/csp/ContentSecurityPolicy.h" 54 #include "core/frame/csp/ContentSecurityPolicy.h"
55 #include "core/html/HTMLPlugInElement.h" 55 #include "core/html/HTMLPlugInElement.h"
56 #include "core/inspector/ConsoleMessage.h" 56 #include "core/inspector/ConsoleMessage.h"
57 #include "core/inspector/InspectorInstrumentation.h" 57 #include "core/inspector/InspectorInstrumentation.h"
58 #include "core/inspector/InspectorTraceEvents.h" 58 #include "core/inspector/InspectorTraceEvents.h"
59 #include "core/inspector/MainThreadDebugger.h"
59 #include "core/loader/DocumentLoader.h" 60 #include "core/loader/DocumentLoader.h"
60 #include "core/loader/FrameLoader.h" 61 #include "core/loader/FrameLoader.h"
61 #include "core/loader/FrameLoaderClient.h" 62 #include "core/loader/FrameLoaderClient.h"
62 #include "core/loader/NavigationScheduler.h" 63 #include "core/loader/NavigationScheduler.h"
63 #include "core/loader/ProgressTracker.h" 64 #include "core/loader/ProgressTracker.h"
64 #include "core/plugins/PluginView.h" 65 #include "core/plugins/PluginView.h"
65 #include "platform/Histogram.h" 66 #include "platform/Histogram.h"
66 #include "platform/TraceEvent.h" 67 #include "platform/TraceEvent.h"
67 #include "platform/UserGestureIndicator.h" 68 #include "platform/UserGestureIndicator.h"
68 #include "platform/Widget.h" 69 #include "platform/Widget.h"
(...skipping 22 matching lines...) Expand all
91 } 92 }
92 93
93 DEFINE_TRACE(ScriptController) 94 DEFINE_TRACE(ScriptController)
94 { 95 {
95 visitor->trace(m_windowProxyManager); 96 visitor->trace(m_windowProxyManager);
96 } 97 }
97 98
98 void ScriptController::clearForClose() 99 void ScriptController::clearForClose()
99 { 100 {
100 m_windowProxyManager->clearForClose(); 101 m_windowProxyManager->clearForClose();
102 MainThreadDebugger::instance()->didClearContextsForFrame(frame());
101 } 103 }
102 104
103 void ScriptController::updateSecurityOrigin(SecurityOrigin* origin) 105 void ScriptController::updateSecurityOrigin(SecurityOrigin* origin)
104 { 106 {
105 m_windowProxyManager->mainWorldProxy()->updateSecurityOrigin(origin); 107 m_windowProxyManager->mainWorldProxy()->updateSecurityOrigin(origin);
106 Vector<std::pair<ScriptState*, SecurityOrigin*>> isolatedContexts; 108 Vector<std::pair<ScriptState*, SecurityOrigin*>> isolatedContexts;
107 m_windowProxyManager->collectIsolatedContexts(isolatedContexts); 109 m_windowProxyManager->collectIsolatedContexts(isolatedContexts);
108 for (auto isolatedContext : isolatedContexts) 110 for (auto isolatedContext : isolatedContexts)
109 m_windowProxyManager->windowProxy(isolatedContext.first->world())->updat eSecurityOrigin(isolatedContext.second); 111 m_windowProxyManager->windowProxy(isolatedContext.first->world())->updat eSecurityOrigin(isolatedContext.second);
110 } 112 }
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 } 260 }
259 v8::RegisterExtension(extension); 261 v8::RegisterExtension(extension);
260 registeredExtensions().append(extension); 262 registeredExtensions().append(extension);
261 } 263 }
262 264
263 void ScriptController::clearWindowProxy() 265 void ScriptController::clearWindowProxy()
264 { 266 {
265 // V8 binding expects ScriptController::clearWindowProxy only be called 267 // V8 binding expects ScriptController::clearWindowProxy only be called
266 // when a frame is loading a new page. This creates a new context for the ne w page. 268 // when a frame is loading a new page. This creates a new context for the ne w page.
267 m_windowProxyManager->clearForNavigation(); 269 m_windowProxyManager->clearForNavigation();
270 MainThreadDebugger::instance()->didClearContextsForFrame(frame());
268 } 271 }
269 272
270 void ScriptController::setCaptureCallStackForUncaughtExceptions(v8::Isolate* iso late, bool value) 273 void ScriptController::setCaptureCallStackForUncaughtExceptions(v8::Isolate* iso late, bool value)
271 { 274 {
272 isolate->SetCaptureStackTraceForUncaughtExceptions(value, V8StackTrace::maxC allStackSizeToCapture, stackTraceOptions); 275 isolate->SetCaptureStackTraceForUncaughtExceptions(value, V8StackTrace::maxC allStackSizeToCapture, stackTraceOptions);
273 } 276 }
274 277
275 void ScriptController::collectIsolatedContexts(Vector<std::pair<ScriptState*, Se curityOrigin*>>& result) 278 void ScriptController::collectIsolatedContexts(Vector<std::pair<ScriptState*, Se curityOrigin*>>& result)
276 { 279 {
277 m_windowProxyManager->collectIsolatedContexts(result); 280 m_windowProxyManager->collectIsolatedContexts(result);
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 for (size_t i = 0; i < resultArray->Length(); ++i) { 445 for (size_t i = 0; i < resultArray->Length(); ++i) {
443 v8::Local<v8::Value> value; 446 v8::Local<v8::Value> value;
444 if (!resultArray->Get(scriptState->context(), i).ToLocal(&value)) 447 if (!resultArray->Get(scriptState->context(), i).ToLocal(&value))
445 return; 448 return;
446 results->append(value); 449 results->append(value);
447 } 450 }
448 } 451 }
449 } 452 }
450 453
451 } // namespace blink 454 } // namespace blink
OLDNEW
« no previous file with comments | « content/renderer/render_view_browsertest.cc ('k') | third_party/WebKit/Source/core/inspector/MainThreadDebugger.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698