[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373
steveblock at google.com
steveblock at google.com
Wed Apr 7 23:12:06 UTC 2010
The following commit has been merged in the webkit-1.2 branch:
commit c163927656864793f058e9ea3f161fef2858ebff
Author: steveblock at google.com <steveblock at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Oct 28 13:54:28 2009 +0000
Adds ScriptController::intializeThreading(), with both JSC and V8 implementations.
https://bugs.webkit.org/show_bug.cgi?id=30678
Reviewed by Eric Seidel.
This new method is used from common code, rather than calling JSC::initializeThreading() (or the V8 equivalent) directly.
Build fix, no new tests required.
* bindings/js/ScriptController.cpp: Modified.
(WebCore::ScriptController::initializeThreading): Added.
* bindings/js/ScriptController.h: Modified. Adds ScriptController::initializeThreading().
* bindings/v8/ScriptController.cpp: Modified.
(WebCore::ScriptController::initializeThreading): Added.
* bindings/v8/ScriptController.h: Modified. Adds ScriptController::initializeThreading().
* loader/icon/IconDatabase.cpp: Modified.
(WebCore::iconDatabase): Call ScriptController::initializeThreading(), rather than JSC::initializeThreading().
* storage/Database.cpp: Modified.
(WebCore::Database::Database): Call ScriptController::initializeThreading(), rather than JSC::initializeThreading().
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50215 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 66a9e10..a4ae497 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,25 @@
+2009-10-28 Steve Block <steveblock at google.com>
+
+ Reviewed by Eric Seidel.
+
+ Adds ScriptController::intializeThreading(), with both JSC and V8 implementations.
+ https://bugs.webkit.org/show_bug.cgi?id=30678
+
+ This new method is used from common code, rather than calling JSC::initializeThreading() (or the V8 equivalent) directly.
+
+ Build fix, no new tests required.
+
+ * bindings/js/ScriptController.cpp: Modified.
+ (WebCore::ScriptController::initializeThreading): Added.
+ * bindings/js/ScriptController.h: Modified. Adds ScriptController::initializeThreading().
+ * bindings/v8/ScriptController.cpp: Modified.
+ (WebCore::ScriptController::initializeThreading): Added.
+ * bindings/v8/ScriptController.h: Modified. Adds ScriptController::initializeThreading().
+ * loader/icon/IconDatabase.cpp: Modified.
+ (WebCore::iconDatabase): Call ScriptController::initializeThreading(), rather than JSC::initializeThreading().
+ * storage/Database.cpp: Modified.
+ (WebCore::Database::Database): Call ScriptController::initializeThreading(), rather than JSC::initializeThreading().
+
2009-10-26 Holger Hans Peter Freyther <zecke at selfish.org>
Reviewed by Darin Adler.
diff --git a/WebCore/bindings/js/ScriptController.cpp b/WebCore/bindings/js/ScriptController.cpp
index 98b1603..4a1d413 100644
--- a/WebCore/bindings/js/ScriptController.cpp
+++ b/WebCore/bindings/js/ScriptController.cpp
@@ -39,12 +39,18 @@
#include "npruntime_impl.h"
#include "runtime_root.h"
#include <debugger/Debugger.h>
+#include <runtime/InitializeThreading.h>
#include <runtime/JSLock.h>
using namespace JSC;
namespace WebCore {
+void ScriptController::initializeThreading()
+{
+ JSC::initializeThreading();
+}
+
ScriptController::ScriptController(Frame* frame)
: m_frame(frame)
, m_handlerLineNumber(0)
diff --git a/WebCore/bindings/js/ScriptController.h b/WebCore/bindings/js/ScriptController.h
index d631498..f2a497d 100644
--- a/WebCore/bindings/js/ScriptController.h
+++ b/WebCore/bindings/js/ScriptController.h
@@ -98,6 +98,10 @@ public:
// Returns true if argument is a JavaScript URL.
bool executeIfJavaScriptURL(const KURL&, bool userGesture = false, bool replaceDocument = true);
+ // This function must be called from the main thread. It is safe to call it repeatedly.
+ // Darwin is an exception to this rule: it is OK to call this function from any thread, even reentrantly.
+ static void initializeThreading();
+
ScriptValue evaluate(const ScriptSourceCode&);
ScriptValue evaluateInWorld(const ScriptSourceCode&, DOMWrapperWorld*);
ScriptValue evaluateInIsolatedWorld(unsigned /*worldID*/, const ScriptSourceCode&);
diff --git a/WebCore/bindings/v8/ScriptController.cpp b/WebCore/bindings/v8/ScriptController.cpp
index 5e6b312..f816bd0 100644
--- a/WebCore/bindings/v8/ScriptController.cpp
+++ b/WebCore/bindings/v8/ScriptController.cpp
@@ -55,6 +55,15 @@
namespace WebCore {
+void ScriptController::initializeThreading()
+{
+ static bool initializedThreading = false;
+ if (!initializedThreading) {
+ WTF::initializeThreading();
+ initializedThreading = true;
+ }
+}
+
void ScriptController::setFlags(const char* string, int length)
{
v8::V8::SetFlagsFromString(string, length);
diff --git a/WebCore/bindings/v8/ScriptController.h b/WebCore/bindings/v8/ScriptController.h
index c56d507..a958ead 100644
--- a/WebCore/bindings/v8/ScriptController.h
+++ b/WebCore/bindings/v8/ScriptController.h
@@ -66,6 +66,9 @@ namespace WebCore {
// Returns true if argument is a JavaScript URL.
bool executeIfJavaScriptURL(const KURL&, bool userGesture = false, bool replaceDocument = true);
+ // This function must be called from the main thread. It is safe to call it repeatedly.
+ static void initializeThreading();
+
// Evaluate a script file in the environment of this proxy.
// If succeeded, 'succ' is set to true and result is returned
// as a string.
diff --git a/WebCore/loader/icon/IconDatabase.cpp b/WebCore/loader/icon/IconDatabase.cpp
index 78ca0a5..4be3684 100644
--- a/WebCore/loader/icon/IconDatabase.cpp
+++ b/WebCore/loader/icon/IconDatabase.cpp
@@ -36,10 +36,10 @@
#include "IconRecord.h"
#include "IntSize.h"
#include "Logging.h"
+#include "ScriptController.h"
#include "SQLiteStatement.h"
#include "SQLiteTransaction.h"
#include "SuddenTermination.h"
-#include <runtime/InitializeThreading.h>
#include <wtf/CurrentTime.h>
#include <wtf/MainThread.h>
#include <wtf/StdLibExtras.h>
@@ -93,7 +93,7 @@ static IconDatabaseClient* defaultClient()
IconDatabase* iconDatabase()
{
if (!sharedIconDatabase) {
- JSC::initializeThreading();
+ ScriptController::initializeThreading();
sharedIconDatabase = new IconDatabase;
}
return sharedIconDatabase;
diff --git a/WebCore/storage/Database.cpp b/WebCore/storage/Database.cpp
index dabb416..5aaa26f 100644
--- a/WebCore/storage/Database.cpp
+++ b/WebCore/storage/Database.cpp
@@ -46,6 +46,7 @@
#include "NotImplemented.h"
#include "Page.h"
#include "OriginQuotaManager.h"
+#include "ScriptController.h"
#include "SQLiteDatabase.h"
#include "SQLiteFileSystem.h"
#include "SQLiteStatement.h"
@@ -57,7 +58,6 @@
#if USE(JSC)
#include "JSDOMWindow.h"
-#include <runtime/InitializeThreading.h>
#endif
namespace WebCore {
@@ -166,9 +166,7 @@ Database::Database(Document* document, const String& name, const String& expecte
if (m_name.isNull())
m_name = "";
-#if USE(JSC)
- JSC::initializeThreading();
-#endif
+ ScriptController::initializeThreading();
m_guid = guidForOriginAndName(m_mainThreadSecurityOrigin->toString(), name);
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list