New issue
Advanced search Search tips

Issue 590873 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Feature



Sign in to add a comment

Make Origin Trial Token verification code available in browser process.

Project Member Reported by mek@chromium.org, Feb 29 2016

Issue description

Some features wanting to use the experimental framework (in particular support for "Link: rel=serviceworker") will need to be able to validate trial tokens from the browser process. To enable this trial_token.* will need to move to content/common, and similarly the public keys will need to be exposed through ContentClient rather than ContentRendererClient.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Mar 11 2016

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

commit 6cad14e7709b9578100415a641ec1ea3f0268e27
Author: mek <mek@chromium.org>
Date: Fri Mar 11 05:36:27 2016

Cleanup TrialToken in preparation of moving it to content/common.

This includes the following cleanups:

- Pass StringPiece by value rather than const ref, as its documentation
  suggests.
- Represent origins as url::Origin/blink::WebSecurityOrigin.
- Pass feature_name to TrialToken::IsAppropriate and related methods as
  StringPiece. Currently doesn't make a difference yet as TrialTokenValidator
  still converts through std::string, but that can be fixed, and new content
  side code can avoid having to construct strings for feature names this way.
- Store expiry time as base::Time instead of raw int64. Under the hood a
  base::Time is an int64 anyway, so this just moves the conversion from int64
  to base::Time earlier, making the code more accurately reflect what it
  represents.
- C-style cast in passing int64 to base::Time::FromDoubleT is against the
  style guide, and unnecessary since this is done implicitly by the compiler.
- Fix order of methods in trial_token.cc to match that in trial_token.h
- Use correct style for argument names in trial_token.h (featureName =>
  feature_name).

BUG= 590873 

Review URL: https://codereview.chromium.org/1752463002

Cr-Commit-Position: refs/heads/master@{#380537}

[modify] https://crrev.com/6cad14e7709b9578100415a641ec1ea3f0268e27/content/renderer/origin_trials/trial_token.cc
[modify] https://crrev.com/6cad14e7709b9578100415a641ec1ea3f0268e27/content/renderer/origin_trials/trial_token.h
[modify] https://crrev.com/6cad14e7709b9578100415a641ec1ea3f0268e27/content/renderer/origin_trials/trial_token_unittest.cc
[modify] https://crrev.com/6cad14e7709b9578100415a641ec1ea3f0268e27/content/renderer/origin_trials/trial_token_validator.cc
[modify] https://crrev.com/6cad14e7709b9578100415a641ec1ea3f0268e27/content/renderer/origin_trials/trial_token_validator.h
[modify] https://crrev.com/6cad14e7709b9578100415a641ec1ea3f0268e27/content/renderer/origin_trials/trial_token_validator_unittest.cc
[modify] https://crrev.com/6cad14e7709b9578100415a641ec1ea3f0268e27/third_party/WebKit/Source/core/origin_trials/OriginTrialContext.cpp
[modify] https://crrev.com/6cad14e7709b9578100415a641ec1ea3f0268e27/third_party/WebKit/Source/core/origin_trials/OriginTrialContextTest.cpp
[modify] https://crrev.com/6cad14e7709b9578100415a641ec1ea3f0268e27/third_party/WebKit/public/platform/WebTrialTokenValidator.h

Project Member

Comment 2 by bugdroid1@chromium.org, Mar 12 2016

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

commit 67f486d991d883a5b3438f8ca820860e9979170d
Author: mek <mek@chromium.org>
Date: Sat Mar 12 01:34:18 2016

Move trial token code to content/common.

Moves content/renderer/origin_trials/trial_token.* to content/common, and
moves ContentRendererClient::GetOriginTrialPublicKey to ContentClient, to
enable verification of trial tokens from the browser process.

BUG= 590873 

Review URL: https://codereview.chromium.org/1742053002

Cr-Commit-Position: refs/heads/master@{#380823}

[modify] https://crrev.com/67f486d991d883a5b3438f8ca820860e9979170d/chrome/chrome_common.gypi
[modify] https://crrev.com/67f486d991d883a5b3438f8ca820860e9979170d/chrome/chrome_renderer.gypi
[modify] https://crrev.com/67f486d991d883a5b3438f8ca820860e9979170d/chrome/common/chrome_content_client.cc
[modify] https://crrev.com/67f486d991d883a5b3438f8ca820860e9979170d/chrome/common/chrome_content_client.h
[rename] https://crrev.com/67f486d991d883a5b3438f8ca820860e9979170d/chrome/common/origin_trials/origin_trial_key_manager.cc
[add] https://crrev.com/67f486d991d883a5b3438f8ca820860e9979170d/chrome/common/origin_trials/origin_trial_key_manager.h
[modify] https://crrev.com/67f486d991d883a5b3438f8ca820860e9979170d/chrome/renderer/chrome_content_renderer_client.cc
[modify] https://crrev.com/67f486d991d883a5b3438f8ca820860e9979170d/chrome/renderer/chrome_content_renderer_client.h
[delete] https://crrev.com/9d9031149e43577cdd886068403ebb5817152531/chrome/renderer/origin_trials/origin_trial_key_manager.h
[rename] https://crrev.com/67f486d991d883a5b3438f8ca820860e9979170d/content/common/origin_trials/trial_token.cc
[rename] https://crrev.com/67f486d991d883a5b3438f8ca820860e9979170d/content/common/origin_trials/trial_token.h
[rename] https://crrev.com/67f486d991d883a5b3438f8ca820860e9979170d/content/common/origin_trials/trial_token_unittest.cc
[add] https://crrev.com/67f486d991d883a5b3438f8ca820860e9979170d/content/common/origin_trials/trial_token_validator.cc
[add] https://crrev.com/67f486d991d883a5b3438f8ca820860e9979170d/content/common/origin_trials/trial_token_validator.h
[rename] https://crrev.com/67f486d991d883a5b3438f8ca820860e9979170d/content/common/origin_trials/trial_token_validator_unittest.cc
[modify] https://crrev.com/67f486d991d883a5b3438f8ca820860e9979170d/content/content_common.gypi
[modify] https://crrev.com/67f486d991d883a5b3438f8ca820860e9979170d/content/content_renderer.gypi
[modify] https://crrev.com/67f486d991d883a5b3438f8ca820860e9979170d/content/content_tests.gypi
[modify] https://crrev.com/67f486d991d883a5b3438f8ca820860e9979170d/content/public/common/content_client.cc
[modify] https://crrev.com/67f486d991d883a5b3438f8ca820860e9979170d/content/public/common/content_client.h
[modify] https://crrev.com/67f486d991d883a5b3438f8ca820860e9979170d/content/public/renderer/content_renderer_client.cc
[modify] https://crrev.com/67f486d991d883a5b3438f8ca820860e9979170d/content/public/renderer/content_renderer_client.h
[delete] https://crrev.com/9d9031149e43577cdd886068403ebb5817152531/content/renderer/origin_trials/trial_token_validator.cc
[add] https://crrev.com/67f486d991d883a5b3438f8ca820860e9979170d/content/renderer/origin_trials/web_trial_token_validator_impl.cc
[rename] https://crrev.com/67f486d991d883a5b3438f8ca820860e9979170d/content/renderer/origin_trials/web_trial_token_validator_impl.h
[modify] https://crrev.com/67f486d991d883a5b3438f8ca820860e9979170d/content/renderer/renderer_blink_platform_impl.h
[modify] https://crrev.com/67f486d991d883a5b3438f8ca820860e9979170d/content/shell/common/shell_content_client.cc
[modify] https://crrev.com/67f486d991d883a5b3438f8ca820860e9979170d/content/shell/common/shell_content_client.h
[modify] https://crrev.com/67f486d991d883a5b3438f8ca820860e9979170d/content/shell/renderer/shell_content_renderer_client.cc
[modify] https://crrev.com/67f486d991d883a5b3438f8ca820860e9979170d/content/shell/renderer/shell_content_renderer_client.h

Components: Internals>OriginTrials
Project Member

Comment 4 by bugdroid1@chromium.org, Aug 12 2016

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

commit 33bf998f2e0bc85a90016744f77c5a01d448cefe
Author: mek <mek@chromium.org>
Date: Fri Aug 12 20:42:10 2016

Make Foreign Fetch an origin trial.

This makes both Foreign Fetch and Link rel=serviceworker available behind
the ForeignFetch origin trial.

For foreign fetch only the service worker registering for and handling
foreign fetch events needs to opt in to the origin trial. It can then
intercept requests made from any website, including websites that haven't
opted in to the origin trial.

BUG= 540509 , 582310 , 590873 

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

[modify] https://crrev.com/33bf998f2e0bc85a90016744f77c5a01d448cefe/content/browser/loader/resource_dispatcher_host_impl.cc
[modify] https://crrev.com/33bf998f2e0bc85a90016744f77c5a01d448cefe/content/browser/service_worker/foreign_fetch_request_handler.cc
[modify] https://crrev.com/33bf998f2e0bc85a90016744f77c5a01d448cefe/content/browser/service_worker/foreign_fetch_request_handler.h
[modify] https://crrev.com/33bf998f2e0bc85a90016744f77c5a01d448cefe/content/browser/service_worker/link_header_support.cc
[modify] https://crrev.com/33bf998f2e0bc85a90016744f77c5a01d448cefe/content/browser/storage_partition_impl_map.cc
[modify] https://crrev.com/33bf998f2e0bc85a90016744f77c5a01d448cefe/content/common/origin_trials/trial_token_validator.cc
[modify] https://crrev.com/33bf998f2e0bc85a90016744f77c5a01d448cefe/content/common/origin_trials/trial_token_validator.h
[modify] https://crrev.com/33bf998f2e0bc85a90016744f77c5a01d448cefe/content/common/origin_trials/trial_token_validator_unittest.cc
[modify] https://crrev.com/33bf998f2e0bc85a90016744f77c5a01d448cefe/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp
[modify] https://crrev.com/33bf998f2e0bc85a90016744f77c5a01d448cefe/third_party/WebKit/Source/bindings/modules/v8/V8BindingForModules.cpp
[modify] https://crrev.com/33bf998f2e0bc85a90016744f77c5a01d448cefe/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
[modify] https://crrev.com/33bf998f2e0bc85a90016744f77c5a01d448cefe/third_party/WebKit/Source/core/html/HTMLLinkElement.idl
[modify] https://crrev.com/33bf998f2e0bc85a90016744f77c5a01d448cefe/third_party/WebKit/Source/core/html/RelList.cpp
[modify] https://crrev.com/33bf998f2e0bc85a90016744f77c5a01d448cefe/third_party/WebKit/Source/modules/serviceworkers/ForeignFetchEvent.idl
[modify] https://crrev.com/33bf998f2e0bc85a90016744f77c5a01d448cefe/third_party/WebKit/Source/modules/serviceworkers/ForeignFetchOptions.idl
[modify] https://crrev.com/33bf998f2e0bc85a90016744f77c5a01d448cefe/third_party/WebKit/Source/modules/serviceworkers/InstallEvent.idl
[modify] https://crrev.com/33bf998f2e0bc85a90016744f77c5a01d448cefe/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.idl
[modify] https://crrev.com/33bf998f2e0bc85a90016744f77c5a01d448cefe/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in
[modify] https://crrev.com/33bf998f2e0bc85a90016744f77c5a01d448cefe/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp

Comment 5 by mek@chromium.org, Aug 12 2016

Labels: -M-51 M-54
Status: Fixed (was: Started)

Sign in to add a comment