Summary: | WKKeyValueStorageManagerGetKeyValueStorageOrigins should get origins from the UI process | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Anders Carlsson <andersca> | ||||
Component: | New Bugs | Assignee: | Anders Carlsson <andersca> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | benjamin, cmarcelo, commit-queue | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
Anders Carlsson
2013-05-17 13:17:45 PDT
Created attachment 202144 [details]
Patch
Attachment 202144 [details] did not pass style-queue:
Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WTF/ChangeLog', u'Source/WTF/wtf/Forward.h', u'Source/WebCore/ChangeLog', u'Source/WebCore/WebCore.exp.in', u'Source/WebKit2/ChangeLog', u'Source/WebKit2/UIProcess/Storage/LocalStorageDatabaseTracker.cpp', u'Source/WebKit2/UIProcess/Storage/LocalStorageDatabaseTracker.h', u'Source/WebKit2/UIProcess/Storage/StorageManager.cpp', u'Source/WebKit2/UIProcess/Storage/StorageManager.h', u'Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.cpp']" exit_code: 1
Source/WebKit2/UIProcess/Storage/StorageManager.h:64: Missing spaces around >> [whitespace/operators] [3]
Source/WebKit2/UIProcess/Storage/StorageManager.h:96: Missing spaces around >> [whitespace/operators] [3]
Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.cpp:86: Missing spaces around >> [whitespace/operators] [3]
Source/WebKit2/UIProcess/Storage/StorageManager.cpp:384: Missing spaces around >> [whitespace/operators] [3]
Source/WebKit2/UIProcess/Storage/StorageManager.cpp:569: Missing spaces around >> [whitespace/operators] [3]
Source/WebKit2/UIProcess/Storage/StorageManager.cpp:575: Missing spaces around >> [whitespace/operators] [3]
Source/WebKit2/UIProcess/Storage/StorageManager.cpp:577: Missing spaces around >> [whitespace/operators] [3]
Total errors found: 7 in 10 files
If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 202144 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=202144&action=review r=me with some itches.. > Source/WebKit2/UIProcess/Storage/LocalStorageDatabaseTracker.h:56 > + Vector<RefPtr<WebCore::SecurityOrigin>> origins(); This method should be const. > Source/WebKit2/UIProcess/Storage/StorageManager.cpp:340 > + // Make sure the encoding is initialized before we start dispatching things to the queue. > + UTF8Encoding(); This looks somewhat arbitrary. Are we sure this is the only encoding that will ever be needed? > Source/WebKit2/UIProcess/Storage/StorageManager.cpp:571 > +static void callCallbackFunction(void* context, void (*callbackFunction)(const Vector<RefPtr<WebCore::SecurityOrigin>>& securityOrigins, void* context), Vector<RefPtr<WebCore::SecurityOrigin>>* securityOriginsPtr) > +{ > + OwnPtr<Vector<RefPtr<WebCore::SecurityOrigin>>> securityOrigins = adoptPtr(securityOriginsPtr); I wish we could pass securityOriginsPtr as a PassOwnPtr instead here. > Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.cpp:93 > + for (size_t i = 0; i < securityOrigins.size(); ++i) I prefer to use 'unsigned' to iterate over Vectors in new code, as we're planning to move away from size_t there eventually. Committed r150295: <http://trac.webkit.org/changeset/150295> Comment on attachment 202144 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=202144&action=review >> Source/WebKit2/UIProcess/Storage/StorageManager.cpp:340 >> + UTF8Encoding(); > > This looks somewhat arbitrary. Are we sure this is the only encoding that will ever be needed? It's a nice catch. Shouldn't we have ASSERT(isMainThread()) in all those functions? Or better yet, have a dispatch_once? I agree with Andreas that this looks a bit troubling even if it's 100% correct. |