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

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

Issue 460053002: Add a comment about calling clearScriptObjects before clearForNavigation. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 return createNoScriptObject(); 414 return createNoScriptObject();
415 415
416 return npCreateV8ScriptObject(0, v8::Handle<v8::Object>::Cast(v8plugin), win dow, scriptState->isolate()); 416 return npCreateV8ScriptObject(0, v8::Handle<v8::Object>::Cast(v8plugin), win dow, scriptState->isolate());
417 } 417 }
418 418
419 void ScriptController::clearWindowShell() 419 void ScriptController::clearWindowShell()
420 { 420 {
421 double start = currentTime(); 421 double start = currentTime();
422 // V8 binding expects ScriptController::clearWindowShell only be called 422 // V8 binding expects ScriptController::clearWindowShell only be called
423 // when a frame is loading a new page. This creates a new context for the ne w page. 423 // when a frame is loading a new page. This creates a new context for the ne w page.
424
425 // The V8 context must be available for |clearScriptObjects()|.
426 // The below call must be before |clearForNavigation()| which disposes the V 8 context.
424 clearScriptObjects(); 427 clearScriptObjects();
425 m_windowShell->clearForNavigation(); 428 m_windowShell->clearForNavigation();
426 for (IsolatedWorldMap::iterator iter = m_isolatedWorlds.begin(); iter != m_i solatedWorlds.end(); ++iter) 429 for (IsolatedWorldMap::iterator iter = m_isolatedWorlds.begin(); iter != m_i solatedWorlds.end(); ++iter)
427 iter->value->clearForNavigation(); 430 iter->value->clearForNavigation();
428 blink::Platform::current()->histogramCustomCounts("WebCore.ScriptController. clearWindowShell", (currentTime() - start) * 1000, 0, 10000, 50); 431 blink::Platform::current()->histogramCustomCounts("WebCore.ScriptController. clearWindowShell", (currentTime() - start) * 1000, 0, 10000, 50);
429 } 432 }
430 433
431 void ScriptController::setCaptureCallStackForUncaughtExceptions(bool value) 434 void ScriptController::setCaptureCallStackForUncaughtExceptions(bool value)
432 { 435 {
433 v8::V8::SetCaptureStackTraceForUncaughtExceptions(value, ScriptCallStack::ma xCallStackSizeToCapture, stackTraceOptions); 436 v8::V8::SetCaptureStackTraceForUncaughtExceptions(value, ScriptCallStack::ma xCallStackSizeToCapture, stackTraceOptions);
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 resultArray->Set(i, evaluationResult); 638 resultArray->Set(i, evaluationResult);
636 } 639 }
637 640
638 if (results) { 641 if (results) {
639 for (size_t i = 0; i < resultArray->Length(); ++i) 642 for (size_t i = 0; i < resultArray->Length(); ++i)
640 results->append(handleScope.Escape(resultArray->Get(i))); 643 results->append(handleScope.Escape(resultArray->Get(i)));
641 } 644 }
642 } 645 }
643 646
644 } // namespace blink 647 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698