Bug 115493 - Implement LocalStorageDatabase::importItems
Summary: Implement LocalStorageDatabase::importItems
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Anders Carlsson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-01 16:00 PDT by Anders Carlsson
Modified: 2013-05-01 16:16 PDT (History)
0 users

See Also:


Attachments
Patch (5.43 KB, patch)
2013-05-01 16:01 PDT, Anders Carlsson
kling: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anders Carlsson 2013-05-01 16:00:40 PDT
Implement LocalStorageDatabase::importItems
Comment 1 Anders Carlsson 2013-05-01 16:01:41 PDT
Created attachment 200249 [details]
Patch
Comment 2 Andreas Kling 2013-05-01 16:11:04 PDT
Comment on attachment 200249 [details]
Patch

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

> Source/WebKit2/UIProcess/Storage/LocalStorageDatabase.cpp:139
> +void LocalStorageDatabase::importItems(StorageMap& storageMap)

Why doesn't this method return something to indicate success/failure?

> Source/WebKit2/UIProcess/Storage/LocalStorageDatabase.cpp:158
> +        items.set(query.getColumnText(0), query.getColumnBlobAsString(1));

You're not gonna sanity-check the column types?
Comment 3 Anders Carlsson 2013-05-01 16:12:58 PDT
(In reply to comment #2)
> (From update of attachment 200249 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=200249&action=review
> 
> > Source/WebKit2/UIProcess/Storage/LocalStorageDatabase.cpp:139
> > +void LocalStorageDatabase::importItems(StorageMap& storageMap)
> 
> Why doesn't this method return something to indicate success/failure?

It indicates success by adding the items to the map.

> 
> > Source/WebKit2/UIProcess/Storage/LocalStorageDatabase.cpp:158
> > +        items.set(query.getColumnText(0), query.getColumnBlobAsString(1));
> 
> You're not gonna sanity-check the column types?

We already know that column 1 is a blob (taken care of by migrateItemTableIfNeeded()), and column 0 will always be coerced to a string.
Comment 4 Andreas Kling 2013-05-01 16:13:45 PDT
Comment on attachment 200249 [details]
Patch

Okay, r=me.
Comment 5 Anders Carlsson 2013-05-01 16:16:32 PDT
Committed r149460: <http://trac.webkit.org/changeset/149460>