Closed Bug 769400 Opened 12 years ago Closed 12 years ago

Don't allow suspending the browser when downloading a file

Categories

(Core :: Widget: Win32, defect)

x86_64
Windows 8.1
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bbondy, Assigned: bbondy)

References

Details

(Whiteboard: [metro-mvp][LOE:1][metro-it2][completed-elm])

Attachments

(1 file, 1 obsolete file)

Downloads currently fail if you navigate away from the Metro browser.

Leverage either the background tasks API or the PowerCreateRequest, PowerSetRequest, and PowerClearRequest functions (as documented in the Power Availability Requests whitepaper) in order to allow downloads.
Blocks: 769401
Blocks: 753826
Assignee: netzen → nobody
Assignee: nobody → netzen
Whiteboard: [metro-mvp][LOE:1][metro-it2]
Attached patch Patch v1 (obsolete) — Splinter Review
Works nicely, once downloads are done it allows the process suspend to happen
Attachment #693981 - Flags: review?(jmathies)
Attached patch Patch v2.Splinter Review
if (!powerCreateRequest)
-   return FALSE;
+   return INVALID_HANDLE_VALUE;
Attachment #693981 - Attachment is obsolete: true
Attachment #693981 - Flags: review?(jmathies)
Attachment #693985 - Flags: review?(jmathies)
Comment on attachment 693981 [details] [diff] [review]
Patch v1

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

Looks good to me!

::: widget/windows/winrt/MetroAppShell.cpp
@@ +210,5 @@
> +  static HMODULE kernel32 = GetModuleHandleW(L"kernel32.dll");
> +  static PowerCreateRequestPtr powerCreateRequest =
> +    (PowerCreateRequestPtr)GetProcAddress(kernel32, "PowerCreateRequest");
> +  if (!powerCreateRequest)
> +    return FALSE;

nit - NULL seems more appropriate here.
Attachment #693985 - Flags: review?(jmathies) → review+
(In reply to Brian R. Bondy [:bbondy] from comment #3)
> Created attachment 693985 [details] [diff] [review]
> Patch v2.
> 
>   if (!powerCreateRequest)
> -   return FALSE;
> +   return INVALID_HANDLE_VALUE;

That's even better!
https://hg.mozilla.org/projects/elm/rev/4d6ab9b15ca7
Whiteboard: [metro-mvp][LOE:1][metro-it2] → [metro-mvp][LOE:1][metro-it2][completed-elm]
Blocks: 801199
No longer blocks: 687219
This will be migrated in the elm -> m-c migration. Resolving.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
OS: Windows 8 Metro → Windows 8.1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: