New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 693366 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Email to this user bounced
Closed: Nov 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Task



Sign in to add a comment

Push-Messaging mojofication follow-up tasks.

Project Member Reported by ke...@intel.com, Feb 17 2017

Issue description

The Push-Messaging IPC interfaces are converted into mojofication by Issue 2690203003 (https://codereview.chromium.org/2690203003/), while we have some TODO tasks in next step.


 

Comment 1 by ke...@intel.com, Feb 17 2017

1) In push_messaging_manager.cc, try to store |callback| in |data| (RegisterData) instead of passing it everywhere needs it. one example: when PushMessagingManager::Subscribe() calls SendSubscriptionError(), the callback is passed as paremeter.

2) Considering to re-design the mojo callback interface. Example: adding a blink::WebPushError::ErrorTypeNone would make the success boolean redundant in GetPermissionStatusCallback.

3)Naming the functions like DidFoo as opposed to FooCallback in Push_Provider{.h|.cc}. which conveys information about the fact that something happened.

4)Extract {endpoint, options, p256dh, auth} in a separate Mojo structure to avoid these four optional arguments set both for subscribing and getting the active subscription. see function "Push_provider::GetSubscriptionCallback(...)".

5)In PushProvider::SubscribeCallback(), to replace "if (!callbacks) return;" by DCHECK(callbacks).

6)In PushMessaging.mojom, there is a TODO:
"TODO(heke): The type-mapping brings the struct and enums are duplicated defined. Need to remove/replace those defined in content or blink namespace."

Comment 2 by ke...@intel.com, Feb 19 2017

I'll use one "code clean" patch to resolve 1) 3) and 5) first.  After that I will use a "re-design mojo-interface" patch to resolve 2) and 4).

After above done, we can continue the "Content Modularization Project of push-messaging"(612312), and find a right time to resolve 6).

Comment 3 by peter@chromium.org, Feb 20 2017

Components: Blink>PushAPI
Status: Started (was: Untriaged)
I'm happy to pick up (6) for now :) Thank you for putting together a plan!

Comment 4 by ke...@intel.com, Feb 21 2017

Hi, Peter, About the 4th task above:
I guess you want to create a new struct in mojo like:
    struct PushSubscriptionInfo {
      url.mojom.Url endpoint;
      PushSubscriptionOptions options;
      array<uint8> p256dh;
      array<uint8> auth;                                                                                                
    };
and change the mojo inteface into:
    Subscribe(...) => (..., PushSubscriptionInfo? info);

If we do this, I found we have to construct PushSubscriptionInfo which will introduce some memory copy.
Besides, I guess we also need to add a new content::PushSubscriptionInfo struct definition, add traits to typemap it with mojo::PushSubscriptionInfo.

I prefer leave it(the 4th task) alone. Any comments? Thanks.

Project Member

Comment 5 by bugdroid1@chromium.org, Feb 24 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f667030fb4c6bb84a55332a5335d451e541d2c02

commit f667030fb4c6bb84a55332a5335d451e541d2c02
Author: ke.he <ke.he@intel.com>
Date: Fri Feb 24 05:40:41 2017

Implement some follow-ups after mojofiction of Push-messaging.

- In push_messaging_manager.cc, store |callback| in |data| (RegisterData)
  instead of passing it everywhere needs it.
- Naming the functions like DidFoo as opposed to FooCallback in
  Push_Provider{.h|.cc}. which conveys information about the fact that something
  happened.
- In PushProvider::SubscribeCallback(), to replace "if (!callbacks) return;" by
  DCHECK(callbacks).

BUG= 693366 

Review-Url: https://codereview.chromium.org/2712693002
Cr-Commit-Position: refs/heads/master@{#452765}

[modify] https://crrev.com/f667030fb4c6bb84a55332a5335d451e541d2c02/content/browser/push_messaging/push_messaging_manager.cc
[modify] https://crrev.com/f667030fb4c6bb84a55332a5335d451e541d2c02/content/browser/push_messaging/push_messaging_manager.h
[modify] https://crrev.com/f667030fb4c6bb84a55332a5335d451e541d2c02/content/child/push_messaging/push_provider.cc
[modify] https://crrev.com/f667030fb4c6bb84a55332a5335d451e541d2c02/content/child/push_messaging/push_provider.h
[modify] https://crrev.com/f667030fb4c6bb84a55332a5335d451e541d2c02/content/renderer/push_messaging/push_messaging_client.cc
[modify] https://crrev.com/f667030fb4c6bb84a55332a5335d451e541d2c02/content/renderer/push_messaging/push_messaging_client.h

Project Member

Comment 6 by bugdroid1@chromium.org, Feb 28 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/dc9d2cfd2402fe7c6e8e4b18a6cab2e03940bcb4

commit dc9d2cfd2402fe7c6e8e4b18a6cab2e03940bcb4
Author: ke.he <ke.he@intel.com>
Date: Tue Feb 28 05:07:33 2017

Re-design Unsubscribe and getPermissionStatus mojo interfaces.

We use the ErrorType as flag to indicate the calling of unsubscribe and
getPermissionStatus are success or error. So the |is_success| flag is redundant
and can be removed.

The ErrorType::UNKNOWN is changed into ErrorType::NONE to have a better meaning.

BUG= 693366 

Review-Url: https://codereview.chromium.org/2715903002
Cr-Commit-Position: refs/heads/master@{#453507}

[modify] https://crrev.com/dc9d2cfd2402fe7c6e8e4b18a6cab2e03940bcb4/content/browser/push_messaging/push_messaging_manager.cc
[modify] https://crrev.com/dc9d2cfd2402fe7c6e8e4b18a6cab2e03940bcb4/content/child/push_messaging/push_provider.cc
[modify] https://crrev.com/dc9d2cfd2402fe7c6e8e4b18a6cab2e03940bcb4/content/child/push_messaging/push_provider.h
[modify] https://crrev.com/dc9d2cfd2402fe7c6e8e4b18a6cab2e03940bcb4/content/common/push_messaging.mojom
[modify] https://crrev.com/dc9d2cfd2402fe7c6e8e4b18a6cab2e03940bcb4/content/common/push_messaging_param_traits.cc
[modify] https://crrev.com/dc9d2cfd2402fe7c6e8e4b18a6cab2e03940bcb4/third_party/WebKit/Source/modules/push_messaging/PushError.cpp
[modify] https://crrev.com/dc9d2cfd2402fe7c6e8e4b18a6cab2e03940bcb4/third_party/WebKit/public/platform/modules/push_messaging/WebPushError.h

Comment 7 by ke...@intel.com, May 19 2017

Status: Available (was: Started)
Project Member

Comment 8 by bugdroid1@chromium.org, Jul 12 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7815db1e0e5084f7ebcde87d521811096579cd10

commit 7815db1e0e5084f7ebcde87d521811096579cd10
Author: Peter Beverloo <peter@chromium.org>
Date: Wed Jul 12 19:03:21 2017

Remove duplication in the Push Messaging enumerations

Remove the native enumeration types in favor of the generated mojom
ones, and, in consequence, the type conversions.

BUG= 693366 

Change-Id: I7745608d0ed8c02f2b6d8c184be20cc091f9d077
Reviewed-on: https://chromium-review.googlesource.com/568151
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Reviewed-by: John Mellor <johnme@chromium.org>
Commit-Queue: Peter Beverloo <peter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#486043}
[modify] https://crrev.com/7815db1e0e5084f7ebcde87d521811096579cd10/chrome/browser/push_messaging/push_messaging_browsertest.cc
[modify] https://crrev.com/7815db1e0e5084f7ebcde87d521811096579cd10/chrome/browser/push_messaging/push_messaging_notification_manager.cc
[modify] https://crrev.com/7815db1e0e5084f7ebcde87d521811096579cd10/chrome/browser/push_messaging/push_messaging_service_impl.cc
[modify] https://crrev.com/7815db1e0e5084f7ebcde87d521811096579cd10/chrome/browser/push_messaging/push_messaging_service_impl.h
[modify] https://crrev.com/7815db1e0e5084f7ebcde87d521811096579cd10/chrome/browser/push_messaging/push_messaging_service_unittest.cc
[modify] https://crrev.com/7815db1e0e5084f7ebcde87d521811096579cd10/content/browser/browser_context.cc
[modify] https://crrev.com/7815db1e0e5084f7ebcde87d521811096579cd10/content/browser/devtools/protocol/service_worker_handler.cc
[modify] https://crrev.com/7815db1e0e5084f7ebcde87d521811096579cd10/content/browser/push_messaging/push_messaging_manager.cc
[modify] https://crrev.com/7815db1e0e5084f7ebcde87d521811096579cd10/content/browser/push_messaging/push_messaging_manager.h
[modify] https://crrev.com/7815db1e0e5084f7ebcde87d521811096579cd10/content/browser/push_messaging/push_messaging_router.cc
[modify] https://crrev.com/7815db1e0e5084f7ebcde87d521811096579cd10/content/browser/push_messaging/push_messaging_router.h
[modify] https://crrev.com/7815db1e0e5084f7ebcde87d521811096579cd10/content/child/push_messaging/push_provider.cc
[modify] https://crrev.com/7815db1e0e5084f7ebcde87d521811096579cd10/content/child/push_messaging/push_provider.h
[modify] https://crrev.com/7815db1e0e5084f7ebcde87d521811096579cd10/content/common/push_messaging.mojom
[modify] https://crrev.com/7815db1e0e5084f7ebcde87d521811096579cd10/content/common/push_messaging.typemap
[modify] https://crrev.com/7815db1e0e5084f7ebcde87d521811096579cd10/content/common/push_messaging_param_traits.cc
[modify] https://crrev.com/7815db1e0e5084f7ebcde87d521811096579cd10/content/common/push_messaging_param_traits.h
[modify] https://crrev.com/7815db1e0e5084f7ebcde87d521811096579cd10/content/public/browser/browser_context.h
[modify] https://crrev.com/7815db1e0e5084f7ebcde87d521811096579cd10/content/public/browser/push_messaging_service.h
[modify] https://crrev.com/7815db1e0e5084f7ebcde87d521811096579cd10/content/public/common/BUILD.gn
[delete] https://crrev.com/0e3594c49d69bd94a4227032f1c5ad299739e5c6/content/public/common/push_messaging_status.cc
[rename] https://crrev.com/7815db1e0e5084f7ebcde87d521811096579cd10/content/public/common/push_messaging_status.mojom
[modify] https://crrev.com/7815db1e0e5084f7ebcde87d521811096579cd10/content/renderer/push_messaging/push_messaging_client.cc
[modify] https://crrev.com/7815db1e0e5084f7ebcde87d521811096579cd10/content/renderer/push_messaging/push_messaging_client.h
[modify] https://crrev.com/7815db1e0e5084f7ebcde87d521811096579cd10/content/shell/browser/layout_test/layout_test_push_messaging_service.cc
[modify] https://crrev.com/7815db1e0e5084f7ebcde87d521811096579cd10/content/shell/browser/layout_test/layout_test_push_messaging_service.h

Comment 9 by ke...@intel.com, Oct 27 2017

Hi, Peter, I think we can change this issue status to "fixed" now, right?
Thanks!

Comment 10 by ke...@intel.com, Nov 2 2017

Status: Fixed (was: Available)
Components: Internals>Services
Labels: Type-Task
Appending component Internals>Services to S13N projects and changing the Type (for tracking sake) to Type=Task.

Sign in to add a comment