Changeset 57301 in webkit


Ignore:
Timestamp:
Apr 8, 2010 3:55:12 PM (14 years ago)
Author:
dumi@chromium.org
Message:

WebCore: Create the creation callback is the current world.
https://bugs.webkit.org/show_bug.cgi?id=37290

Reviewed by Geoffrey Garen.

  • bindings/js/JSDatabaseCallback.cpp:

(WebCore::JSDatabaseCallback::JSDatabaseCallback):

LayoutTests: Test that the creation callback is executed in the world where it
was created.
https://bugs.webkit.org/show_bug.cgi?id=37290

Reviewed by Geoffrey Garen.

  • storage/open-database-creation-callback-isolated-world-expected.txt:
  • storage/open-database-creation-callback-isolated-world.html:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r57300 r57301  
     12010-04-08  Dumitru Daniliuc  <dumi@chromium.org>
     2
     3        Reviewed by Geoffrey Garen.
     4
     5        Test that the creation callback is executed in the world where it
     6        was created.
     7        https://bugs.webkit.org/show_bug.cgi?id=37290
     8
     9        * storage/open-database-creation-callback-isolated-world-expected.txt:
     10        * storage/open-database-creation-callback-isolated-world.html:
     11
    1122010-04-08  Csaba Osztrogonác  <ossy@webkit.org>
    213
  • trunk/LayoutTests/storage/open-database-creation-callback-isolated-world-expected.txt

    r55823 r57301  
    11ALERT: undefined
     2ALERT: PASS: document.body.bar visible in a callback created in this world.
    23This test tests that the openDatabase() creation callback is called in the right world.
    34
  • trunk/LayoutTests/storage/open-database-creation-callback-isolated-world.html

    r55823 r57301  
    55<div id="console"></div>
    66<script>
     7var creationCallbacksExecuted = 0;
    78function done()
    89{
    9     if (window.layoutTestController)
     10    if ((++creationCallbacksExecuted == 2) && (window.layoutTestController))
    1011        layoutTestController.notifyDone();
    1112}
    1213
    13 function creationCallback(db)
     14function creationCallback1(db)
    1415{
    1516    alert("FAIL: Visible in isolated world.");
     
    1718}
    1819
     20function creationCallback2(db)
     21{
     22    alert(document.body.bar);
     23    done();
     24}
     25
    1926document.body.foo = "FAIL: document.body.foo visible in isolated world.";
     27document.body.bar = "PASS: document.body.bar visible in a callback created in this world.";
    2028
    2129if (window.layoutTestController) {
     
    2533    layoutTestController.evaluateScriptInIsolatedWorld(
    2634        0,
    27         "function creationCallback(db)\n" +
     35        "function creationCallback1(db)\n" +
    2836        "{\n" +
    2937        "    alert(document.body.foo);\n" +
    3038        "    window.location='javascript:done()';\n" +
    3139        "}\n" +
    32         "var db = openDatabase('OpenDatabaseCreationCallbackIsolatedWorld', '1.0', '', 1, creationCallback);");
     40        "var db1 = openDatabase('OpenDatabaseCreationCallbackIsolatedWorld', '1.0', '', 1, creationCallback1);");
     41
     42    var db2 = openDatabase('OpenDatabaseCreationCallbackIsolatedWorld2', '1.0', '', 1, creationCallback2);
    3343}
    3444</script>
  • trunk/WebCore/ChangeLog

    r57299 r57301  
     12010-04-08  Dumitru Daniliuc  <dumi@chromium.org>
     2
     3        Reviewed by Geoffrey Garen.
     4
     5        Create the creation callback is the current world.
     6        https://bugs.webkit.org/show_bug.cgi?id=37290
     7
     8        * bindings/js/JSDatabaseCallback.cpp:
     9        (WebCore::JSDatabaseCallback::JSDatabaseCallback):
     10
    1112010-04-08  David Hyatt  <hyatt@apple.com>
    212
  • trunk/WebCore/bindings/js/JSDatabaseCallback.cpp

    r55823 r57301  
    3636#include "Frame.h"
    3737#include "JSDatabase.h"
    38 #include "ScriptController.h"
    3938#include "ScriptExecutionContext.h"
    4039#include <runtime/JSLock.h>
     
    4746JSDatabaseCallback::JSDatabaseCallback(JSObject* callback, JSDOMGlobalObject* globalObject)
    4847    : m_data(new JSCallbackData(callback, globalObject))
    49     , m_isolatedWorld(DOMWrapperWorld::create(globalObject->globalData(), true))
     48    , m_isolatedWorld(globalObject->world())
    5049{
    5150}
Note: See TracChangeset for help on using the changeset viewer.