New issue
Advanced search Search tips

Issue 678737 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Feature



Sign in to add a comment

Break up networkingPrivate API into smaller APIs in networking namespace

Project Member Reported by tbarzic@chromium.org, Jan 5 2017

Issue description

Consider breaking out some parts of networkingPrivate API into separate APIs under networking namespace.

As part of opening up networking API to kiosk apps, the API is being renamed to networking.onc.
The API contains some API methods that are not strictly related to ONC, and for which a better suited API name could be used. We should consider moving such methods into their own namespace. Additional benefit would be ability to control access to these APIs in more granular fashion.

Some possibilities:

networkingPrivate.startActivate
networkingPrivate.unlockCellularSim
networkingPrivate.setCellularSimState
- used to activate/set state of sim cards
- networking.cellular or networking.settings might be better namespaces

networkingPrivate.getCaptivePortalStatus
networkingPrivate.onPortalDetectionCompleted
- primary use case seems to be for Chrome OS automated testing, so networking.telemetry might be a suitable namespace (one that could be extended with other test methods)

networkingPrivate.verifyDestination
networkingPrivate.verifyAndEncryptCredentials
networkingPrivate.verifyAndEncryptData
- used primarily by Chromecast setup app to verify Chromecast certs
- networking.cast / networking.chromecast might be a good namespace

networkingPrivate.setWifiTDLSEnabledState
networkingPrivate.getWifiTDLSStatus
- used by cast extension - again maybe networking.cast/networking.chromecast, or networking.tdls, or networking.wifi

networkingPrivate.getDeviceStates
networkingPrivate.enableNetworkType
networkingPrivate.disableNetworkType
networkingPrivate.onDeviceStateListChanged
- maybe networking.device (as it primarily deals with networking devices)
- also, seems to be used primarily by settings, so networking.settings might be appropriate


 
Because chrome.networking.onc is just an alias to chrome.networkingPrivate, and networkingPrivate is used by existing extensions, moving these would be problematic.

However, we could create some new APIs that overlap, and plan to deprecate them from networking.onc over time.

In particular, networking.cast makes sense for the verify and TDLS methods.

I would suggest that the cellular and device methods remain part of networking.onc; they are as related to network configuration as any of the other methods. The captive portal methods seem reasonable to leave in also, even if they are not currently used (I forget the history of those).


Yeah, if we go that route, the idea would be to create APIs with overlapping functionality - potentially restricting functionality in networking.onc to apps with networkingPrivate permission.

The parts I'd primarily want to get out are the same ones you mentioned - methods used by cast extension only.

Note that cellular methods would be less problematic to move, as they only seem to be used from settings (so the usages could be updated together with the API). As for captive portal methods, the only usage I can see is from Chrome OS telemetry.
I don't object to leaving these in networking.onc, though.

Comment 3 by st...@chromium.org, Mar 3 2017

Cc: r...@chromium.org

Comment 4 by st...@chromium.org, Mar 3 2017

Cc: -st...@chromium.org
Project Member

Comment 5 by bugdroid1@chromium.org, Mar 16 2017

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

commit d2ff1ae2c1175126133ec36bc400b3aaed08092b
Author: tbarzic <tbarzic@chromium.org>
Date: Thu Mar 16 18:04:42 2017

Introduce networking.cast API

The new API will be private to cast extension, and will contain
networkingPrivate methods only used/needed by cast extension and setup
app.
Method implementations are not changed, they are just copied from
networkingPrivate API to networking.cast API. The goal is to
eventually remove networkingPrivate implementation - when extensions
white-listed for the API move to the networking.cast API.

List of methods that are being moved to networking.cast API:
verifyDestination
verifyDestinationAndEncryptCredentials
verifyDestinationAndEncryptData
setWifiTDLSEnabledState
getWifiTDLSStatus

For now, the ChromeNetworkingCast just calls into the networking
private API's crypto verification delegate - the next step will be to
move this logic into ChromeNetworkingCastDelegate.

BUG=678737

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

[modify] https://crrev.com/d2ff1ae2c1175126133ec36bc400b3aaed08092b/chrome/browser/extensions/BUILD.gn
[modify] https://crrev.com/d2ff1ae2c1175126133ec36bc400b3aaed08092b/chrome/browser/extensions/api/chrome_extensions_api_client.cc
[modify] https://crrev.com/d2ff1ae2c1175126133ec36bc400b3aaed08092b/chrome/browser/extensions/api/chrome_extensions_api_client.h
[add] https://crrev.com/d2ff1ae2c1175126133ec36bc400b3aaed08092b/chrome/browser/extensions/api/networking_cast_private/OWNERS
[add] https://crrev.com/d2ff1ae2c1175126133ec36bc400b3aaed08092b/chrome/browser/extensions/api/networking_cast_private/chrome_networking_cast_private_delegate.cc
[add] https://crrev.com/d2ff1ae2c1175126133ec36bc400b3aaed08092b/chrome/browser/extensions/api/networking_cast_private/chrome_networking_cast_private_delegate.h
[add] https://crrev.com/d2ff1ae2c1175126133ec36bc400b3aaed08092b/chrome/browser/extensions/api/networking_cast_private/networking_cast_private_api.cc
[add] https://crrev.com/d2ff1ae2c1175126133ec36bc400b3aaed08092b/chrome/browser/extensions/api/networking_cast_private/networking_cast_private_api.h
[add] https://crrev.com/d2ff1ae2c1175126133ec36bc400b3aaed08092b/chrome/browser/extensions/api/networking_cast_private/networking_cast_private_apitest.cc
[modify] https://crrev.com/d2ff1ae2c1175126133ec36bc400b3aaed08092b/chrome/common/extensions/api/BUILD.gn
[modify] https://crrev.com/d2ff1ae2c1175126133ec36bc400b3aaed08092b/chrome/common/extensions/api/_api_features.json
[modify] https://crrev.com/d2ff1ae2c1175126133ec36bc400b3aaed08092b/chrome/common/extensions/api/_permission_features.json
[add] https://crrev.com/d2ff1ae2c1175126133ec36bc400b3aaed08092b/chrome/common/extensions/api/networking_cast_private.idl
[modify] https://crrev.com/d2ff1ae2c1175126133ec36bc400b3aaed08092b/chrome/common/extensions/permissions/chrome_api_permissions.cc
[modify] https://crrev.com/d2ff1ae2c1175126133ec36bc400b3aaed08092b/chrome/common/extensions/permissions/permission_set_unittest.cc
[modify] https://crrev.com/d2ff1ae2c1175126133ec36bc400b3aaed08092b/chrome/test/BUILD.gn
[add] https://crrev.com/d2ff1ae2c1175126133ec36bc400b3aaed08092b/chrome/test/data/extensions/api_test/networking_cast_private/manifest.json
[add] https://crrev.com/d2ff1ae2c1175126133ec36bc400b3aaed08092b/chrome/test/data/extensions/api_test/networking_cast_private/test.js
[modify] https://crrev.com/d2ff1ae2c1175126133ec36bc400b3aaed08092b/extensions/browser/api/extensions_api_client.cc
[modify] https://crrev.com/d2ff1ae2c1175126133ec36bc400b3aaed08092b/extensions/browser/api/extensions_api_client.h
[modify] https://crrev.com/d2ff1ae2c1175126133ec36bc400b3aaed08092b/extensions/browser/api/networking_private/BUILD.gn
[add] https://crrev.com/d2ff1ae2c1175126133ec36bc400b3aaed08092b/extensions/browser/api/networking_private/networking_cast_private_delegate.h
[modify] https://crrev.com/d2ff1ae2c1175126133ec36bc400b3aaed08092b/extensions/browser/api/networking_private/networking_private_delegate.h
[modify] https://crrev.com/d2ff1ae2c1175126133ec36bc400b3aaed08092b/extensions/browser/extension_function_histogram_value.h
[modify] https://crrev.com/d2ff1ae2c1175126133ec36bc400b3aaed08092b/extensions/common/api/networking_private.idl
[modify] https://crrev.com/d2ff1ae2c1175126133ec36bc400b3aaed08092b/extensions/common/permissions/api_permission.h
[modify] https://crrev.com/d2ff1ae2c1175126133ec36bc400b3aaed08092b/tools/metrics/histograms/histograms.xml

Project Member

Comment 6 by bugdroid1@chromium.org, Mar 23 2017

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

commit a0d155d336a59388f84140f7b4c4f79cb1f36e40
Author: tbarzic <tbarzic@chromium.org>
Date: Thu Mar 23 19:35:45 2017

Move NetworkingPrivateDelegate::CryptoVerify to networking_cast_private

Retires NetworkingPrivateDelegate::CryptoVerify and moves verification
logic to ChromeNetworkingCastPrivateDelegate. Moves networkingPrivate
API to use the NetworkingCastPrivateDelegate interface to delegate
verification methods to chrome.

Along the way, done some minor cleanup:
- Make NetworkingCastPrivateDelegate take API agnostic argument for
  verification properties - Credentials, which used to be part of the
  //chrome CryptoVerify implementation, this CL moves the declaration
  to the interface - the object is now created by the delegate users
  before calling verification methods (it can be created from both
  networkingPrivate and networking.castPrivate API verification
  properties)
- Make Credentials non-copyable - instead of copying the whole class.
  the credentials are now passed to a worker thread using a unique_ptr
- Clean up the way DecodeAndVerifyCredentials helperr method returns
  results - instead of combination of bool return value and bool ptr
  argument, it now returns a 3-value enum.

Next: move networking_private credentials getters and crypto util
to networking_cast_private

BUG=678737

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

[modify] https://crrev.com/a0d155d336a59388f84140f7b4c4f79cb1f36e40/chrome/browser/extensions/BUILD.gn
[modify] https://crrev.com/a0d155d336a59388f84140f7b4c4f79cb1f36e40/chrome/browser/extensions/api/networking_cast_private/chrome_networking_cast_private_delegate.cc
[modify] https://crrev.com/a0d155d336a59388f84140f7b4c4f79cb1f36e40/chrome/browser/extensions/api/networking_cast_private/chrome_networking_cast_private_delegate.h
[modify] https://crrev.com/a0d155d336a59388f84140f7b4c4f79cb1f36e40/chrome/browser/extensions/api/networking_cast_private/networking_cast_private_api.cc
[modify] https://crrev.com/a0d155d336a59388f84140f7b4c4f79cb1f36e40/chrome/browser/extensions/api/networking_cast_private/networking_cast_private_apitest.cc
[delete] https://crrev.com/53a9a9ad5cc4d43822d530eab0aa951b1a12a503/chrome/browser/extensions/api/networking_private/crypto_verify_impl.cc
[delete] https://crrev.com/53a9a9ad5cc4d43822d530eab0aa951b1a12a503/chrome/browser/extensions/api/networking_private/crypto_verify_impl.h
[modify] https://crrev.com/a0d155d336a59388f84140f7b4c4f79cb1f36e40/chrome/browser/extensions/api/networking_private/networking_private_apitest.cc
[modify] https://crrev.com/a0d155d336a59388f84140f7b4c4f79cb1f36e40/chrome/browser/extensions/api/networking_private/networking_private_chromeos_apitest.cc
[modify] https://crrev.com/a0d155d336a59388f84140f7b4c4f79cb1f36e40/chrome/browser/extensions/api/networking_private/networking_private_service_client_apitest.cc
[delete] https://crrev.com/53a9a9ad5cc4d43822d530eab0aa951b1a12a503/chrome/browser/extensions/api/networking_private/networking_private_verify_delegate_factory_impl.cc
[delete] https://crrev.com/53a9a9ad5cc4d43822d530eab0aa951b1a12a503/chrome/browser/extensions/api/networking_private/networking_private_verify_delegate_factory_impl.h
[modify] https://crrev.com/a0d155d336a59388f84140f7b4c4f79cb1f36e40/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc
[modify] https://crrev.com/a0d155d336a59388f84140f7b4c4f79cb1f36e40/extensions/browser/api/networking_private/BUILD.gn
[add] https://crrev.com/a0d155d336a59388f84140f7b4c4f79cb1f36e40/extensions/browser/api/networking_private/networking_cast_private_delegate.cc
[modify] https://crrev.com/a0d155d336a59388f84140f7b4c4f79cb1f36e40/extensions/browser/api/networking_private/networking_cast_private_delegate.h
[modify] https://crrev.com/a0d155d336a59388f84140f7b4c4f79cb1f36e40/extensions/browser/api/networking_private/networking_private_api.cc
[modify] https://crrev.com/a0d155d336a59388f84140f7b4c4f79cb1f36e40/extensions/browser/api/networking_private/networking_private_api.h
[modify] https://crrev.com/a0d155d336a59388f84140f7b4c4f79cb1f36e40/extensions/browser/api/networking_private/networking_private_chromeos.cc
[modify] https://crrev.com/a0d155d336a59388f84140f7b4c4f79cb1f36e40/extensions/browser/api/networking_private/networking_private_chromeos.h
[modify] https://crrev.com/a0d155d336a59388f84140f7b4c4f79cb1f36e40/extensions/browser/api/networking_private/networking_private_delegate.cc
[modify] https://crrev.com/a0d155d336a59388f84140f7b4c4f79cb1f36e40/extensions/browser/api/networking_private/networking_private_delegate.h
[modify] https://crrev.com/a0d155d336a59388f84140f7b4c4f79cb1f36e40/extensions/browser/api/networking_private/networking_private_delegate_factory.cc
[modify] https://crrev.com/a0d155d336a59388f84140f7b4c4f79cb1f36e40/extensions/browser/api/networking_private/networking_private_delegate_factory.h
[modify] https://crrev.com/a0d155d336a59388f84140f7b4c4f79cb1f36e40/extensions/browser/api/networking_private/networking_private_linux.cc
[modify] https://crrev.com/a0d155d336a59388f84140f7b4c4f79cb1f36e40/extensions/browser/api/networking_private/networking_private_linux.h
[modify] https://crrev.com/a0d155d336a59388f84140f7b4c4f79cb1f36e40/extensions/browser/api/networking_private/networking_private_service_client.cc
[modify] https://crrev.com/a0d155d336a59388f84140f7b4c4f79cb1f36e40/extensions/browser/api/networking_private/networking_private_service_client.h

Sign in to add a comment