| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 #include "weborigin/SecurityOrigin.h" | 77 #include "weborigin/SecurityOrigin.h" |
| 78 #include "wtf/CurrentTime.h" | 78 #include "wtf/CurrentTime.h" |
| 79 #include "wtf/StdLibExtras.h" | 79 #include "wtf/StdLibExtras.h" |
| 80 #include "wtf/StringExtras.h" | 80 #include "wtf/StringExtras.h" |
| 81 #include "wtf/text/CString.h" | 81 #include "wtf/text/CString.h" |
| 82 #include "wtf/text/StringBuilder.h" | 82 #include "wtf/text/StringBuilder.h" |
| 83 #include "wtf/text/TextPosition.h" | 83 #include "wtf/text/TextPosition.h" |
| 84 | 84 |
| 85 namespace WebCore { | 85 namespace WebCore { |
| 86 | 86 |
| 87 void ScriptController::initializeThreading() | |
| 88 { | |
| 89 static bool initializedThreading = false; | |
| 90 if (!initializedThreading) { | |
| 91 WTF::initializeThreading(); | |
| 92 WTF::initializeMainThread(); | |
| 93 initializedThreading = true; | |
| 94 } | |
| 95 } | |
| 96 | |
| 97 bool ScriptController::canAccessFromCurrentOrigin(Frame *frame) | 87 bool ScriptController::canAccessFromCurrentOrigin(Frame *frame) |
| 98 { | 88 { |
| 99 return !v8::Context::InContext() || BindingSecurity::shouldAllowAccessToFram
e(frame); | 89 return !v8::Context::InContext() || BindingSecurity::shouldAllowAccessToFram
e(frame); |
| 100 } | 90 } |
| 101 | 91 |
| 102 ScriptController::ScriptController(Frame* frame) | 92 ScriptController::ScriptController(Frame* frame) |
| 103 : m_frame(frame) | 93 : m_frame(frame) |
| 104 , m_sourceURL(0) | 94 , m_sourceURL(0) |
| 105 , m_isolate(v8::Isolate::GetCurrent()) | 95 , m_isolate(v8::Isolate::GetCurrent()) |
| 106 , m_windowShell(V8DOMWindowShell::create(frame, mainThreadNormalWorld(), m_i
solate)) | 96 , m_windowShell(V8DOMWindowShell::create(frame, mainThreadNormalWorld(), m_i
solate)) |
| (...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 724 v8Results = evaluateHandleScope.Close(resultArray); | 714 v8Results = evaluateHandleScope.Close(resultArray); |
| 725 } | 715 } |
| 726 | 716 |
| 727 if (results && !v8Results.IsEmpty()) { | 717 if (results && !v8Results.IsEmpty()) { |
| 728 for (size_t i = 0; i < v8Results->Length(); ++i) | 718 for (size_t i = 0; i < v8Results->Length(); ++i) |
| 729 results->append(ScriptValue(v8Results->Get(i))); | 719 results->append(ScriptValue(v8Results->Get(i))); |
| 730 } | 720 } |
| 731 } | 721 } |
| 732 | 722 |
| 733 } // namespace WebCore | 723 } // namespace WebCore |
| OLD | NEW |