Closed
Bug 687755
Opened 13 years ago
Closed 13 years ago
Make it easy to forward methods from the DOM storage wrapper to the right implementation class
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
mozilla9
People
(Reporter: bzbarsky, Assigned: bzbarsky)
References
Details
Attachments
(1 file)
This is a spinoff bug to track landing the first (already reviewed) patch in bug 686049.
Assignee | ||
Comment 1•13 years ago
|
||
Assignee | ||
Comment 2•13 years ago
|
||
Flags: in-testsuite-
Target Milestone: --- → mozilla9
Comment 3•13 years ago
|
||
According bug 683316 comment 4, could we update this to also support methods that has |void| return type somehow?
Maybe:
+#define IMPL_FORWARDER(_return, _code) \
+ PR_BEGIN_MACRO \
+ if (aStorage->CanUseChromePersist()) \
+ _return mChromePersistentDB._code; \
+ if (nsDOMStorageManager::gStorageManager->InPrivateBrowsingMode()) \
+ _return mPrivateBrowsingDB._code; \
+ if (aStorage->SessionOnly()) \
+ _return mSessionOnlyDB._code; \
+ _return mPersistentDB._code; \
+ PR_END_MACRO
+
And then:
nsresult
nsDOMStorageDBWrapper::GetAllKeys(DOMStorageImpl* aStorage,
nsTHashtable<nsSessionStorageEntry>* aKeys)
{
IMPL_FORWARDER(return, GetAllKeys(aStorage, aKeys));
}
void
nsDOMStorageDBWrapper::Whatever(...)
{
IMPL_FORWARDER((void), Whatever(...));
}
Comment 4•13 years ago
|
||
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 5•13 years ago
|
||
I was assuming you'd add a macro for that in bug 683316. I'd prefer a IMPL_FORWARDER_GUTS macro with two arguments and an IMPL_FORWARDER and IMPL_VOID_FORWARDER that invoke it the right way.
Updated•12 years ago
|
Component: DOM: Mozilla Extensions → DOM
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•