Commit 5c7359f5 authored by iclelland's avatar iclelland Committed by Commit bot

[Experimental Framework] Move trial token code to renderer

In order to make the code changes easier to reason about, this is now part 1
of a two-part commit. In this commit, the existing code is moved from
content/common and content/child into content/renderer (it isn't used anywhere
else). In part 2, the keys are moved out of content into the embedder.

Part 2: https://codereview.chromium.org/1653263005/

BUG=543220

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

Cr-Commit-Position: refs/heads/master@{#374763}
parent 37e8e740
...@@ -980,10 +980,6 @@ blink::WebSyncProvider* BlinkPlatformImpl::backgroundSyncProvider() { ...@@ -980,10 +980,6 @@ blink::WebSyncProvider* BlinkPlatformImpl::backgroundSyncProvider() {
main_thread_task_runner_.get()); main_thread_task_runner_.get());
} }
blink::WebTrialTokenValidator* BlinkPlatformImpl::trialTokenValidator() {
return &trial_token_validator_;
}
WebThemeEngine* BlinkPlatformImpl::themeEngine() { WebThemeEngine* BlinkPlatformImpl::themeEngine() {
return &native_theme_engine_; return &native_theme_engine_;
} }
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include "base/trace_event/trace_event.h" #include "base/trace_event/trace_event.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "components/webcrypto/webcrypto_impl.h" #include "components/webcrypto/webcrypto_impl.h"
#include "content/child/origin_trials/trial_token_validator.h"
#include "content/child/webfallbackthemeengine_impl.h" #include "content/child/webfallbackthemeengine_impl.h"
#include "content/common/content_export.h" #include "content/common/content_export.h"
#include "third_party/WebKit/public/platform/Platform.h" #include "third_party/WebKit/public/platform/Platform.h"
...@@ -147,7 +146,6 @@ class CONTENT_EXPORT BlinkPlatformImpl ...@@ -147,7 +146,6 @@ class CONTENT_EXPORT BlinkPlatformImpl
blink::WebServicePortProviderClient*) override; blink::WebServicePortProviderClient*) override;
blink::WebPermissionClient* permissionClient() override; blink::WebPermissionClient* permissionClient() override;
blink::WebSyncProvider* backgroundSyncProvider() override; blink::WebSyncProvider* backgroundSyncProvider() override;
blink::WebTrialTokenValidator* trialTokenValidator() override;
blink::WebString domCodeStringFromEnum(int dom_code) override; blink::WebString domCodeStringFromEnum(int dom_code) override;
int domEnumFromCodeString(const blink::WebString& codeString) override; int domEnumFromCodeString(const blink::WebString& codeString) override;
...@@ -185,8 +183,6 @@ class CONTENT_EXPORT BlinkPlatformImpl ...@@ -185,8 +183,6 @@ class CONTENT_EXPORT BlinkPlatformImpl
scoped_ptr<PermissionDispatcher> permission_client_; scoped_ptr<PermissionDispatcher> permission_client_;
scoped_ptr<BackgroundSyncProvider> main_thread_sync_provider_; scoped_ptr<BackgroundSyncProvider> main_thread_sync_provider_;
TrialTokenValidator trial_token_validator_;
scheduler::WebThreadBase* compositor_thread_; scheduler::WebThreadBase* compositor_thread_;
}; };
......
...@@ -173,8 +173,6 @@ ...@@ -173,8 +173,6 @@
'child/npapi/webplugin_ime_win.cc', 'child/npapi/webplugin_ime_win.cc',
'child/npapi/webplugin_ime_win.h', 'child/npapi/webplugin_ime_win.h',
'child/npapi/webplugin_resource_client.h', 'child/npapi/webplugin_resource_client.h',
'child/origin_trials/trial_token_validator.cc',
'child/origin_trials/trial_token_validator.h',
'child/permissions/permission_dispatcher.cc', 'child/permissions/permission_dispatcher.cc',
'child/permissions/permission_dispatcher.h', 'child/permissions/permission_dispatcher.h',
'child/permissions/permission_dispatcher_thread_proxy.cc', 'child/permissions/permission_dispatcher_thread_proxy.cc',
......
...@@ -465,8 +465,6 @@ ...@@ -465,8 +465,6 @@
'common/notification_constants.h', 'common/notification_constants.h',
'common/one_writer_seqlock.cc', 'common/one_writer_seqlock.cc',
'common/one_writer_seqlock.h', 'common/one_writer_seqlock.h',
'common/origin_trials/trial_token.cc',
'common/origin_trials/trial_token.h',
'common/origin_util.cc', 'common/origin_util.cc',
'common/p2p_messages.h', 'common/p2p_messages.h',
'common/page_state_serialization.cc', 'common/page_state_serialization.cc',
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
'../skia/skia.gyp:skia_mojo', '../skia/skia.gyp:skia_mojo',
'../storage/storage_common.gyp:storage_common', '../storage/storage_common.gyp:storage_common',
'../third_party/WebKit/public/blink.gyp:blink', '../third_party/WebKit/public/blink.gyp:blink',
'../third_party/boringssl/boringssl.gyp:boringssl',
'../third_party/icu/icu.gyp:icui18n', '../third_party/icu/icu.gyp:icui18n',
'../third_party/icu/icu.gyp:icuuc', '../third_party/icu/icu.gyp:icuuc',
'../third_party/libjingle/libjingle.gyp:libjingle', '../third_party/libjingle/libjingle.gyp:libjingle',
...@@ -354,6 +355,10 @@ ...@@ -354,6 +355,10 @@
'renderer/net_info_helper.h', 'renderer/net_info_helper.h',
'renderer/notification_permission_dispatcher.cc', 'renderer/notification_permission_dispatcher.cc',
'renderer/notification_permission_dispatcher.h', 'renderer/notification_permission_dispatcher.h',
'renderer/origin_trials/trial_token.cc',
'renderer/origin_trials/trial_token.h',
'renderer/origin_trials/trial_token_validator.cc',
'renderer/origin_trials/trial_token_validator.h',
'renderer/peripheral_content_heuristic.cc', 'renderer/peripheral_content_heuristic.cc',
'renderer/peripheral_content_heuristic.h', 'renderer/peripheral_content_heuristic.h',
'renderer/presentation/presentation_connection_client.cc', 'renderer/presentation/presentation_connection_client.cc',
......
...@@ -677,7 +677,6 @@ ...@@ -677,7 +677,6 @@
'common/mac/attributed_string_coder_unittest.mm', 'common/mac/attributed_string_coder_unittest.mm',
'common/mac/font_descriptor_unittest.mm', 'common/mac/font_descriptor_unittest.mm',
'common/one_writer_seqlock_unittest.cc', 'common/one_writer_seqlock_unittest.cc',
'common/origin_trials/trial_token_unittest.cc',
'common/origin_util_unittest.cc', 'common/origin_util_unittest.cc',
'common/page_state_serialization_unittest.cc', 'common/page_state_serialization_unittest.cc',
'common/page_zoom_unittest.cc', 'common/page_zoom_unittest.cc',
...@@ -717,6 +716,7 @@ ...@@ -717,6 +716,7 @@
'renderer/media/video_capture_impl_unittest.cc', 'renderer/media/video_capture_impl_unittest.cc',
'renderer/media/video_capture_message_filter_unittest.cc', 'renderer/media/video_capture_message_filter_unittest.cc',
'renderer/media/webmediaplayer_ms_unittest.cc', 'renderer/media/webmediaplayer_ms_unittest.cc',
'renderer/origin_trials/trial_token_unittest.cc',
'renderer/peripheral_content_heuristic_unittest.cc', 'renderer/peripheral_content_heuristic_unittest.cc',
'renderer/raster_worker_pool_unittest.cc', 'renderer/raster_worker_pool_unittest.cc',
'renderer/render_thread_impl_unittest.cc', 'renderer/render_thread_impl_unittest.cc',
......
...@@ -70,6 +70,7 @@ source_set("renderer") { ...@@ -70,6 +70,7 @@ source_set("renderer") {
"//skia/public", "//skia/public",
"//storage/common", "//storage/common",
"//third_party/WebKit/public:blink", "//third_party/WebKit/public:blink",
"//third_party/boringssl",
"//third_party/icu", "//third_party/icu",
"//third_party/libjingle", "//third_party/libjingle",
"//third_party/libyuv", "//third_party/libyuv",
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "content/common/origin_trials/trial_token.h" #include "content/renderer/origin_trials/trial_token.h"
#include <openssl/curve25519.h> #include <openssl/curve25519.h>
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef CONTENT_COMMON_ORIGIN_TRIALS_TRIAL_TOKEN_H_ #ifndef CONTENT_RENDERER_ORIGIN_TRIALS_TRIAL_TOKEN_H_
#define CONTENT_COMMON_ORIGIN_TRIALS_TRIAL_TOKEN_H_ #define CONTENT_RENDERER_ORIGIN_TRIALS_TRIAL_TOKEN_H_
#include <string> #include <string>
...@@ -93,4 +93,4 @@ class CONTENT_EXPORT TrialToken { ...@@ -93,4 +93,4 @@ class CONTENT_EXPORT TrialToken {
} // namespace content } // namespace content
#endif // CONTENT_COMMON_ORIGIN_TRIALS_TRIAL_TOKEN_H_ #endif // CONTENT_RENDERER_ORIGIN_TRIALS_TRIAL_TOKEN_H_
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "content/common/origin_trials/trial_token.h" #include "content/renderer/origin_trials/trial_token.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_ptr.h"
......
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "content/child/origin_trials/trial_token_validator.h" #include "content/renderer/origin_trials/trial_token_validator.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "content/common/origin_trials/trial_token.h" #include "content/renderer/origin_trials/trial_token.h"
namespace content { namespace content {
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef CONTENT_CHILD_ORIGIN_TRIALS_TRIAL_TOKEN_VALIDATOR_H_ #ifndef CONTENT_RENDERER_ORIGIN_TRIALS_TRIAL_TOKEN_VALIDATOR_H_
#define CONTENT_CHILD_ORIGIN_TRIALS_TRIAL_TOKEN_VALIDATOR_H_ #define CONTENT_RENDERER_ORIGIN_TRIALS_TRIAL_TOKEN_VALIDATOR_H_
#include <string> #include <string>
#include "third_party/WebKit/public/platform/WebTrialTokenValidator.h" #include "third_party/WebKit/public/platform/WebTrialTokenValidator.h"
...@@ -30,4 +30,4 @@ class TrialTokenValidator : public blink::WebTrialTokenValidator { ...@@ -30,4 +30,4 @@ class TrialTokenValidator : public blink::WebTrialTokenValidator {
} // namespace content } // namespace content
#endif // CONTENT_CHILD_ORIGIN_TRIALS_TRIAL_TOKEN_VALIDATOR_H_ #endif // CONTENT_RENDERER_ORIGIN_TRIALS_TRIAL_TOKEN_VALIDATOR_H_
...@@ -1293,4 +1293,11 @@ void RendererBlinkPlatformImpl::MockBatteryStatusChangedForTesting( ...@@ -1293,4 +1293,11 @@ void RendererBlinkPlatformImpl::MockBatteryStatusChangedForTesting(
g_test_battery_status_listener->updateBatteryStatus(status); g_test_battery_status_listener->updateBatteryStatus(status);
} }
//------------------------------------------------------------------------------
blink::WebTrialTokenValidator*
RendererBlinkPlatformImpl::trialTokenValidator() {
return &trial_token_validator_;
}
} // namespace content } // namespace content
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include "cc/blink/web_compositor_support_impl.h" #include "cc/blink/web_compositor_support_impl.h"
#include "content/child/blink_platform_impl.h" #include "content/child/blink_platform_impl.h"
#include "content/common/content_export.h" #include "content/common/content_export.h"
#include "content/renderer/origin_trials/trial_token_validator.h"
#include "content/renderer/webpublicsuffixlist_impl.h" #include "content/renderer/webpublicsuffixlist_impl.h"
#include "device/vibration/vibration_manager.mojom.h" #include "device/vibration/vibration_manager.mojom.h"
#include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h"
...@@ -190,6 +191,8 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { ...@@ -190,6 +191,8 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
const blink::WebString& sample) override; const blink::WebString& sample) override;
void recordRapporURL(const char* metric, const blink::WebURL& url) override; void recordRapporURL(const char* metric, const blink::WebURL& url) override;
blink::WebTrialTokenValidator* trialTokenValidator() override;
// Set the PlatformEventObserverBase in |platform_event_observers_| associated // Set the PlatformEventObserverBase in |platform_event_observers_| associated
// with |type| to |observer|. If there was already an observer associated to // with |type| to |observer|. If there was already an observer associated to
// the given |type|, it will be replaced. // the given |type|, it will be replaced.
...@@ -296,6 +299,8 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { ...@@ -296,6 +299,8 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
scheduler::RendererScheduler* renderer_scheduler_; // NOT OWNED scheduler::RendererScheduler* renderer_scheduler_; // NOT OWNED
TrialTokenValidator trial_token_validator_;
DISALLOW_COPY_AND_ASSIGN(RendererBlinkPlatformImpl); DISALLOW_COPY_AND_ASSIGN(RendererBlinkPlatformImpl);
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment