LocalBrowserDB needlessly computes URI + profile

RESOLVED FIXED in Firefox 13

Status

()

RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: rnewman, Assigned: rnewman)

Tracking

11 Branch
Firefox 13
ARM
Android
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

7 years ago
The profile is private, and only set in the constructor.

Every call to appendProfile can turn into a member access. This will save a pile of garbage and a method call in almost every DB access.
(Assignee)

Updated

7 years ago
Depends on: 724745
(Assignee)

Comment 1

7 years ago
Created attachment 597257 [details] [diff] [review]
WIP. v1

This hasn't finished building yet, but otherwise shows my intent :)
Attachment #597257 - Flags: feedback?(lucasr.at.mozilla)
Comment on attachment 597257 [details] [diff] [review]
WIP. v1

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

Makes sense.

::: mobile/android/base/db/LocalBrowserDB.java
@@ +79,5 @@
>  
>      private final String mProfile;
>      private long mMobileFolderId;
>  
> +    private final Uri bookmarksUriWithProfile;

Prefix all those members with 'm' for consistency.
Attachment #597257 - Flags: feedback?(lucasr.at.mozilla) → feedback+
(Assignee)

Comment 3

7 years ago
Created attachment 597451 [details] [diff] [review]
Proposed patch. v1

Rebased on top of current inbound. Nit addressed. One more method (introduced in the last day!) eliminated :)
Attachment #597257 - Attachment is obsolete: true
Attachment #597451 - Flags: review?(lucasr.at.mozilla)
Comment on attachment 597451 [details] [diff] [review]
Proposed patch. v1

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

Good.

::: mobile/android/base/db/LocalBrowserDB.java
@@ +92,5 @@
> +
> +        mBookmarksUriWithProfile = appendProfile(Bookmarks.CONTENT_URI);
> +        mParentsUriWithProfile   = appendProfile(Bookmarks.PARENTS_CONTENT_URI);
> +        mHistoryUriWithProfile   = appendProfile(History.CONTENT_URI);
> +        mImagesUriWithProfile    = appendProfile(Images.CONTENT_URI);

nit: we don't align assignments like this in Fennec :-) No alignment needed here.
Attachment #597451 - Flags: review?(lucasr.at.mozilla) → review+
https://hg.mozilla.org/mozilla-central/rev/4a2b70586e00
Status: ASSIGNED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
Whiteboard: [inbound]
Target Milestone: --- → Firefox 13
You need to log in before you can comment on or make changes to this bug.