Bug 151481 - Modern IDB: In the VersionChangeEvent for delete database calls, newVersion should be null instead of 0
Summary: Modern IDB: In the VersionChangeEvent for delete database calls, newVersion s...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Brady Eidson
URL:
Keywords:
Depends on: 151456
Blocks: 149117
  Show dependency treegraph
 
Reported: 2015-11-19 21:53 PST by Brady Eidson
Modified: 2015-11-20 14:15 PST (History)
7 users (show)

See Also:


Attachments
Patch v1 (10.77 KB, patch)
2015-11-20 11:16 PST, Brady Eidson
no flags Details | Formatted Diff | Diff
Patch v2 - Shot in the dark... (10.78 KB, patch)
2015-11-20 12:18 PST, Brady Eidson
no flags Details | Formatted Diff | Diff
Patch v3 (10.70 KB, patch)
2015-11-20 13:08 PST, Brady Eidson
sam: review-
Details | Formatted Diff | Diff
Patch v4 (7.78 KB, patch)
2015-11-20 13:37 PST, Brady Eidson
no flags Details | Formatted Diff | Diff
Patch v5 (7.78 KB, patch)
2015-11-20 13:41 PST, Brady Eidson
sam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brady Eidson 2015-11-19 21:53:59 PST
Modern IDB: In the VersionChangeEvent for delete database calls, oldVersion should be null instead of 0
Comment 1 Brady Eidson 2015-11-19 21:54:53 PST
This will require a custom binding.
Comment 2 Brady Eidson 2015-11-20 11:16:11 PST
Created attachment 265973 [details]
Patch v1
Comment 3 Brady Eidson 2015-11-20 11:32:40 PST
These build failures are linker errors on finding stuff for jsNull().

From the mac build:
Undefined symbols for architecture x86_64:
  "__ZN3JSC7JSValueC1ENS0_9JSNullTagE", referenced from:
      __ZNK7WebCore23JSIDBVersionChangeEvent10newVersionERN3JSC9ExecStateE in JSIDBVersionChangeEventCustom.o
  "__ZN3JSC7JSValueC1Ey", referenced from:
      __ZNK7WebCore23JSIDBVersionChangeEvent10oldVersionERN3JSC9ExecStateE in JSIDBVersionChangeEventCustom.o
      __ZNK7WebCore23JSIDBVersionChangeEvent10newVersionERN3JSC9ExecStateE in JSIDBVersionChangeEventCustom.o
ld: symbol(s) not found for architecture x86_64

From EFL:
WebCore::JSIDBVersionChangeEvent::newVersion(JSC::ExecState&) const: error: undefined reference to 'JSC::JSValue::JSValue(JSC::JSValue::JSNullTag)'

I'm confused by these because:
1 - This patch builds fine for me locally on Mac.
2 - Plenty of other custom bindings use "jsNull()" directly.
Comment 4 Brady Eidson 2015-11-20 11:37:36 PST
mac-debug built fine.

The others didn't.

How is this a release vs debug issue?  =/
Comment 5 Brady Eidson 2015-11-20 12:18:03 PST
Created attachment 265978 [details]
Patch v2 - Shot in the dark...
Comment 6 WebKit Commit Bot 2015-11-20 12:19:59 PST
Attachment 265978 [details] did not pass style-queue:


ERROR: Source/WebCore/bindings/js/JSIDBVersionChangeEventCustom.cpp:30:  You should not add a blank line before implementation file's own header.  [build/include_order] [4]
Total errors found: 1 in 8 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 7 Brady Eidson 2015-11-20 13:01:46 PST
This is definitely a debug vs release issue, as I can reproduce the linker error with a local release build.

*WHY*?

No friggin' clue.
Comment 8 Brady Eidson 2015-11-20 13:08:30 PST
Created attachment 265982 [details]
Patch v3
Comment 9 Brady Eidson 2015-11-20 13:08:51 PST
Some debug-vs-release build difference in which JSValue functions come inlined or not.  *sigh*

Fixed!
Comment 10 Sam Weinig 2015-11-20 13:22:00 PST
Comment on attachment 265982 [details]
Patch v3

View in context: https://bugs.webkit.org/attachment.cgi?id=265982&action=review

> Source/WebCore/ChangeLog:4
> +        Modern IDB: In the VersionChangeEvent for delete database calls, oldVersion should be null instead of 0.
> +        https://bugs.webkit.org/show_bug.cgi?id=151481

This title does not match what the patch does.  The patch changes the behavior of newVersion, not oldVersion.

> Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.idl:30
> +    [Custom] readonly attribute unsigned long long oldVersion;

No need for this to be custom.

> Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.idl:31
> +    [Custom] readonly attribute unsigned long long newVersion;

Can this use the ? syntax instead of using a custom binding?
Comment 11 Brady Eidson 2015-11-20 13:23:44 PST
Patch was right, title was wrong.

Trying the optional attribute in bindings right now.
Comment 12 Brady Eidson 2015-11-20 13:37:27 PST
Created attachment 265991 [details]
Patch v4
Comment 13 Brady Eidson 2015-11-20 13:41:22 PST
Created attachment 265992 [details]
Patch v5
Comment 14 Brady Eidson 2015-11-20 14:15:47 PST
https://trac.webkit.org/changeset/192698