Close connection in nsPermissionManager

RESOLVED FIXED in mozilla12

Status

()

Core
Networking: Cookies
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: espindola, Assigned: espindola)

Tracking

(Blocks: 1 bug)

Trunk
mozilla12
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [Snappy:p1])

Attachments

(1 attachment, 2 obsolete attachments)

Comment hidden (empty)
Created attachment 582267 [details] [diff] [review]
Close connection in nsPermissionManager

https://tbpl.mozilla.org/?tree=Try&rev=06d000ca95bf
Assignee: nobody → respindola
Status: NEW → ASSIGNED
Attachment #582267 - Flags: review?(mak77)
Comment on attachment 582267 [details] [diff] [review]
Close connection in nsPermissionManager

Review of attachment 582267 [details] [diff] [review]:
-----------------------------------------------------------------

looks ok
Attachment #582267 - Flags: review?(mak77) → review+
Comment on attachment 582267 [details] [diff] [review]
Close connection in nsPermissionManager

Review of attachment 582267 [details] [diff] [review]:
-----------------------------------------------------------------

::: extensions/cookie/nsPermissionManager.cpp
@@ +797,5 @@
>        mStmtInsert = nsnull;
>        mStmtDelete = nsnull;
>        mStmtUpdate = nsnull;
> +      mozilla::DebugOnly<nsresult> rv = mDBConn->Close();
> +      MOZ_ASSERT(NS_SUCCEEDED(rv));

You should add a helper method to this and make this and `RemoveAllInternal` call the helper.  We were doing it right in one place, but not the other.
Attachment #582267 - Flags: review-

Updated

6 years ago
Component: Storage → Networking: Cookies
Product: Toolkit → Core
QA Contact: storage → networking.cookies
Version: unspecified → Trunk
Created attachment 582835 [details] [diff] [review]
Close connection in nsPermissionManager

https://tbpl.mozilla.org/?tree=Try&rev=6601609921ae
Attachment #582267 - Attachment is obsolete: true
Attachment #582835 - Flags: review?(sdwilsh)
Attachment #582835 - Flags: review?(mak77)
Comment on attachment 582835 [details] [diff] [review]
Close connection in nsPermissionManager

Review of attachment 582835 [details] [diff] [review]:
-----------------------------------------------------------------

::: extensions/cookie/nsPermissionManager.cpp
@@ +620,5 @@
>    return rv;
>  }
>  
> +void
> +nsPermissionManager::CloseDBInternal()

I don't like the Internal suffix here, we usually use it when there's another exposed method with the same name, that's not this case, just CloseDB() will be fine afaict.

@@ +646,1 @@
>        mDBConn = nsnull;

you can move this inside the helper "if (mDBConn)" scope

::: extensions/cookie/nsPermissionManager.h
@@ +221,5 @@
>                                           PRUint32          aExpireType,
>                                           PRInt64           aExpireTime,
>                                           const PRUnichar  *aData);
>    void     NotifyObservers(nsIPermission *aPermission, const PRUnichar *aData);
> +  void     CloseDBInternal();

this may like a nice but simple javadoc explaining what it does.
Created attachment 582972 [details] [diff] [review]
Close connection in nsPermissionManager

This implement all the comments, except for the javadoc, since the file had no javadoc I just added a plain comment.

https://tbpl.mozilla.org/?tree=Try&rev=8e4a8b9a5073
Attachment #582835 - Attachment is obsolete: true
Attachment #582835 - Flags: review?(sdwilsh)
Attachment #582835 - Flags: review?(mak77)
Attachment #582972 - Flags: review?(mak77)
Comment on attachment 582972 [details] [diff] [review]
Close connection in nsPermissionManager

Review of attachment 582972 [details] [diff] [review]:
-----------------------------------------------------------------

I don't have further comments, I'm forwarding final review to either swilsh or dwitte, on a first come first serve handling, since sdwilsh appears to be on vacation
Attachment #582972 - Flags: review?(sdwilsh)
Attachment #582972 - Flags: review?(mak77)
Attachment #582972 - Flags: review?(dwitte)
Attachment #582972 - Flags: feedback+
Blocks: 662444
Whiteboard: [Snappy:p1]
Comment on attachment 582972 [details] [diff] [review]
Close connection in nsPermissionManager

Review of attachment 582972 [details] [diff] [review]:
-----------------------------------------------------------------

Looks fine to me too.  I can't technically r+ this, so f+ at taras's request.
Attachment #582972 - Flags: feedback+

Comment 9

6 years ago
Comment on attachment 582972 [details] [diff] [review]
Close connection in nsPermissionManager

Looks good, thanks. r=dwitte
Attachment #582972 - Flags: review?(sdwilsh)
Attachment #582972 - Flags: review?(dwitte)
Attachment #582972 - Flags: review+
https://tbpl.mozilla.org/?tree=Mozilla-Inbound&rev=ed120f1a9dea
https://hg.mozilla.org/mozilla-central/rev/ed120f1a9dea
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla12
You need to log in before you can comment on or make changes to this bug.