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 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 | 642 |
643 String scriptResult; | 643 String scriptResult; |
644 if (!result.getString(scriptResult)) | 644 if (!result.getString(scriptResult)) |
645 return true; | 645 return true; |
646 | 646 |
647 // We're still in a frame, so there should be a DocumentLoader. | 647 // We're still in a frame, so there should be a DocumentLoader. |
648 ASSERT(m_frame->document()->loader()); | 648 ASSERT(m_frame->document()->loader()); |
649 | 649 |
650 if (!locationChangeBefore && m_frame->navigationScheduler()->locationChangeP
ending()) | 650 if (!locationChangeBefore && m_frame->navigationScheduler()->locationChangeP
ending()) |
651 return true; | 651 return true; |
652 | 652 |
653 // DocumentWriter::replaceDocument can cause the DocumentLoader to get deref
'ed and possible destroyed, | 653 // DocumentWriter::replaceDocument can cause the DocumentLoader to get deref
'ed and possible destroyed, |
654 // so protect it with a RefPtr. | 654 // so protect it with a RefPtr. |
655 if (RefPtr<DocumentLoader> loader = m_frame->document()->loader()) | 655 if (RefPtr<DocumentLoader> loader = m_frame->document()->loader()) |
656 loader->replaceDocument(scriptResult, ownerDocument.get()); | 656 loader->replaceDocument(scriptResult, ownerDocument.get()); |
657 return true; | 657 return true; |
658 } | 658 } |
659 | 659 |
660 ScriptValue ScriptController::executeScriptInMainWorld(const ScriptSourceCode& s
ourceCode) | 660 ScriptValue ScriptController::executeScriptInMainWorld(const ScriptSourceCode& s
ourceCode) |
661 { | 661 { |
662 String sourceURL = sourceCode.url(); | 662 String sourceURL = sourceCode.url(); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
708 v8Results = evaluateHandleScope.Close(resultArray); | 708 v8Results = evaluateHandleScope.Close(resultArray); |
709 } | 709 } |
710 | 710 |
711 if (results && !v8Results.IsEmpty()) { | 711 if (results && !v8Results.IsEmpty()) { |
712 for (size_t i = 0; i < v8Results->Length(); ++i) | 712 for (size_t i = 0; i < v8Results->Length(); ++i) |
713 results->append(ScriptValue(v8Results->Get(i))); | 713 results->append(ScriptValue(v8Results->Get(i))); |
714 } | 714 } |
715 } | 715 } |
716 | 716 |
717 } // namespace WebCore | 717 } // namespace WebCore |
OLD | NEW |