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 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 |
OLD | NEW |