Bug 129356 - Forward application suspend resume notifications to the web process.
Summary: Forward application suspend resume notifications to the web process.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: iPhone / iPad Unspecified
: P2 Normal
Assignee: Jeremy Jones
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-25 18:44 PST by Jeremy Jones
Modified: 2014-03-27 14:39 PDT (History)
9 users (show)

See Also:


Attachments
Patch (7.92 KB, patch)
2014-02-25 19:03 PST, Jeremy Jones
no flags Details | Formatted Diff | Diff
Patch (8.07 KB, patch)
2014-02-26 20:41 PST, Jeremy Jones
no flags Details | Formatted Diff | Diff
Patch (7.78 KB, patch)
2014-02-26 20:51 PST, Jeremy Jones
no flags Details | Formatted Diff | Diff
Patch (12.21 KB, patch)
2014-02-26 21:58 PST, Jeremy Jones
no flags Details | Formatted Diff | Diff
Patch (16.40 KB, patch)
2014-02-28 20:33 PST, Jeremy Jones
no flags Details | Formatted Diff | Diff
Patch (16.31 KB, patch)
2014-03-03 13:27 PST, Jeremy Jones
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremy Jones 2014-02-25 18:44:04 PST
Forward application suspend resume notifications to the web process.
Comment 1 Jeremy Jones 2014-02-25 19:03:46 PST
Created attachment 225212 [details]
Patch
Comment 2 Jeremy Jones 2014-02-25 19:06:25 PST
These notifications are observed in MedisSessionManagerIOS.mm
Comment 3 Simon Fraser (smfr) 2014-02-25 20:15:58 PST
Comment on attachment 225212 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=225212&action=review

I would like Gavin to look this over; we may want to propagate this info along with the other visibility-related data.

> Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm:72
> +SOFT_LINK_FRAMEWORK(UIKit)
> +SOFT_LINK_POINTER(UIKit, UIApplicationWillResignActiveNotification, NSString *)
> +SOFT_LINK_POINTER(UIKit, UIApplicationWillEnterForegroundNotification, NSString *)
> +
> +#define UIApplicationWillResignActiveNotification getUIApplicationWillResignActiveNotification()
> +#define UIApplicationWillEnterForegroundNotification getUIApplicationWillEnterForegroundNotification()

Why do these need to be soft-linked?
Comment 4 Jeremy Jones 2014-02-26 20:41:20 PST
Created attachment 225340 [details]
Patch
Comment 5 Jeremy Jones 2014-02-26 20:42:54 PST
This is just a rebase.
Comment 6 Jeremy Jones 2014-02-26 20:50:22 PST
(In reply to comment #3)
> (From update of attachment 225212 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=225212&action=review
> 
> I would like Gavin to look this over; we may want to propagate this info along with the other visibility-related data.
> 
> > Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm:72
> > +SOFT_LINK_FRAMEWORK(UIKit)
> > +SOFT_LINK_POINTER(UIKit, UIApplicationWillResignActiveNotification, NSString *)
> > +SOFT_LINK_POINTER(UIKit, UIApplicationWillEnterForegroundNotification, NSString *)
> > +
> > +#define UIApplicationWillResignActiveNotification getUIApplicationWillResignActiveNotification()
> > +#define UIApplicationWillEnterForegroundNotification getUIApplicationWillEnterForegroundNotification()
> 
> Why do these need to be soft-linked?

Oh right. It is just WebCore not WebProcess that doesn't link against UIKit.

Next patch will have this change.
Comment 7 Jeremy Jones 2014-02-26 20:51:26 PST
Created attachment 225341 [details]
Patch
Comment 8 Jeremy Jones 2014-02-26 21:53:37 PST
Also forward UIApplicationDidBecomeActiveNotification.
Comment 9 Jeremy Jones 2014-02-26 21:58:24 PST
Created attachment 225343 [details]
Patch
Comment 10 Gavin Barraclough 2014-02-28 14:55:44 PST
Comment on attachment 225343 [details]
Patch

Looks good to me.
Comment 11 Eric Carlson 2014-02-28 15:14:54 PST
This looks good to me as well, but I am not a WK2 owner so someone else will have to give it an r+.
Comment 12 Jeremy Jones 2014-02-28 20:33:23 PST
Created attachment 225530 [details]
Patch
Comment 13 Jeremy Jones 2014-02-28 20:34:17 PST
Removed #include <UIKit/UIKit.h> And instead have WebCore specific versions of the Notifications.
Comment 14 WebKit Commit Bot 2014-03-03 10:37:56 PST
Comment on attachment 225530 [details]
Patch

Rejecting attachment 225530 [details] from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.appspot.com', '--bot-id=webkit-cq-02', 'apply-attachment', '--no-update', '--non-interactive', 225530, '--port=mac']" exit_code: 2 cwd: /Volumes/Data/EWS/WebKit

Last 500 characters of output:
urce/WebKit2/WebProcess/WebPage/WebPage.messages.in
Hunk #1 FAILED at 65.
1 out of 1 hunk FAILED -- saving rejects to file Source/WebKit2/WebProcess/WebPage/WebPage.messages.in.rej
patching file Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm
Hunk #1 succeeded at 58 (offset 2 lines).
Hunk #2 succeeded at 1670 with fuzz 1 (offset 29 lines).

Failed to run "[u'/Volumes/Data/EWS/WebKit/Tools/Scripts/svn-apply', '--force', '--reviewer', u'Sam Weinig']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

Full output: http://webkit-queues.appspot.com/results/6551233372356608
Comment 15 Jeremy Jones 2014-03-03 13:27:55 PST
Created attachment 225688 [details]
Patch
Comment 16 Jeremy Jones 2014-03-03 13:28:17 PST
(In reply to comment #15)
> Created an attachment (id=225688) [details]
> Patch

Rebased patch.
Comment 17 WebKit Commit Bot 2014-03-03 17:24:03 PST
Comment on attachment 225688 [details]
Patch

Clearing flags on attachment: 225688

Committed r165028: <http://trac.webkit.org/changeset/165028>
Comment 18 WebKit Commit Bot 2014-03-03 17:24:07 PST
All reviewed patches have been landed.  Closing bug.
Comment 19 Benjamin Poulain 2014-03-27 14:39:18 PDT
Comment on attachment 225688 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=225688&action=review

> Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm:1686
> +void WebPage::applicationWillResignActive()
> +{
> +    [[NSNotificationCenter defaultCenter] postNotificationName:WebUIApplicationWillResignActiveNotification object:nil];
> +}
> +
> +void WebPage::applicationWillEnterForeground()
> +{
> +    [[NSNotificationCenter defaultCenter] postNotificationName:WebUIApplicationWillEnterForegroundNotification object:nil];
> +}
> +
> +void WebPage::applicationDidBecomeActive()
> +{
> +    [[NSNotificationCenter defaultCenter] postNotificationName:WebUIApplicationDidBecomeActiveNotification object:nil];
> +}

This is not okay.

Can you please add clean messaging from the WebKit layer to the WebCore layer?