Commit 1f00a8e1 authored by Caitlin Fischer's avatar Caitlin Fischer Committed by Commit Bot

Remove InstanceID experiment.

Added in https://codereview.chromium.org/1128123003 by jianli.

Bug: 1126640
Change-Id: Ia2a3f8312942b5b9c638f0023c03949bfa1fcc4c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2424667Reviewed-by: default avatarPeter Beverloo <peter@chromium.org>
Reviewed-by: default avatarIlya Sherman <isherman@chromium.org>
Commit-Queue: Caitlin Fischer <caitlinfischer@google.com>
Cr-Commit-Position: refs/heads/master@{#812090}
parent 70cc5275
...@@ -61,19 +61,9 @@ ExtensionFunction::ResponseAction InstanceIDApiFunction::Run() { ...@@ -61,19 +61,9 @@ ExtensionFunction::ResponseAction InstanceIDApiFunction::Run() {
return RespondNow(Error( return RespondNow(Error(
"chrome.instanceID not supported in incognito mode")); "chrome.instanceID not supported in incognito mode"));
} }
if (!IsEnabled()) {
return RespondNow(Error(
InstanceIDResultToError(instance_id::InstanceID::DISABLED)));
}
return DoWork(); return DoWork();
} }
bool InstanceIDApiFunction::IsEnabled() const {
return instance_id::InstanceIDProfileService::IsInstanceIDEnabled();
}
instance_id::InstanceID* InstanceIDApiFunction::GetInstanceID() const { instance_id::InstanceID* InstanceIDApiFunction::GetInstanceID() const {
return instance_id::InstanceIDProfileServiceFactory::GetForProfile( return instance_id::InstanceIDProfileServiceFactory::GetForProfile(
Profile::FromBrowserContext(browser_context()))->driver()-> Profile::FromBrowserContext(browser_context()))->driver()->
......
...@@ -32,12 +32,6 @@ PushMessagingServiceImpl* PushMessagingServiceFactory::GetForProfile( ...@@ -32,12 +32,6 @@ PushMessagingServiceImpl* PushMessagingServiceFactory::GetForProfile(
if (context->IsOffTheRecord()) if (context->IsOffTheRecord())
return nullptr; return nullptr;
if (!instance_id::InstanceIDProfileService::IsInstanceIDEnabled()) {
LOG(WARNING) << "PushMessagingService could not be built because "
"InstanceID is unexpectedly disabled";
return nullptr;
}
return static_cast<PushMessagingServiceImpl*>( return static_cast<PushMessagingServiceImpl*>(
GetInstance()->GetServiceForBrowserContext(context, true)); GetInstance()->GetServiceForBrowserContext(context, true));
} }
......
...@@ -4,27 +4,12 @@ ...@@ -4,27 +4,12 @@
#include "components/gcm_driver/instance_id/instance_id_driver.h" #include "components/gcm_driver/instance_id/instance_id_driver.h"
#include "base/metrics/field_trial.h"
#include "base/strings/string_util.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "components/gcm_driver/gcm_driver.h" #include "components/gcm_driver/gcm_driver.h"
#include "components/gcm_driver/instance_id/instance_id.h" #include "components/gcm_driver/instance_id/instance_id.h"
namespace instance_id { namespace instance_id {
namespace {
const char kInstanceIDFieldTrialName[] = "InstanceID";
const char kInstanceIDFieldTrialDisabledGroupPrefix[] = "Disabled";
} // namespace
// static
bool InstanceIDDriver::IsInstanceIDEnabled() {
std::string group_name =
base::FieldTrialList::FindFullName(kInstanceIDFieldTrialName);
return !base::StartsWith(group_name, kInstanceIDFieldTrialDisabledGroupPrefix,
base::CompareCase::INSENSITIVE_ASCII);
}
InstanceIDDriver::InstanceIDDriver(gcm::GCMDriver* gcm_driver) InstanceIDDriver::InstanceIDDriver(gcm::GCMDriver* gcm_driver)
: gcm_driver_(gcm_driver) { : gcm_driver_(gcm_driver) {
} }
......
...@@ -25,9 +25,6 @@ class InstanceID; ...@@ -25,9 +25,6 @@ class InstanceID;
// Create instances of this class with |InstanceIDProfileServiceFactory|. // Create instances of this class with |InstanceIDProfileServiceFactory|.
class InstanceIDDriver { class InstanceIDDriver {
public: public:
// Returns whether InstanceID is enabled.
static bool IsInstanceIDEnabled();
explicit InstanceIDDriver(gcm::GCMDriver* gcm_driver); explicit InstanceIDDriver(gcm::GCMDriver* gcm_driver);
virtual ~InstanceIDDriver(); virtual ~InstanceIDDriver();
......
...@@ -11,11 +11,6 @@ ...@@ -11,11 +11,6 @@
namespace instance_id { namespace instance_id {
// static
bool InstanceIDProfileService::IsInstanceIDEnabled() {
return InstanceIDDriver::IsInstanceIDEnabled();
}
InstanceIDProfileService::InstanceIDProfileService(gcm::GCMDriver* driver, InstanceIDProfileService::InstanceIDProfileService(gcm::GCMDriver* driver,
bool is_off_the_record) { bool is_off_the_record) {
DCHECK(!is_off_the_record); DCHECK(!is_off_the_record);
......
...@@ -21,9 +21,6 @@ class InstanceIDDriver; ...@@ -21,9 +21,6 @@ class InstanceIDDriver;
// Providing Instance ID support, via InstanceIDDriver, to a profile. // Providing Instance ID support, via InstanceIDDriver, to a profile.
class InstanceIDProfileService : public KeyedService { class InstanceIDProfileService : public KeyedService {
public: public:
// Returns whether InstanceID is enabled for |profile|.
static bool IsInstanceIDEnabled();
InstanceIDProfileService(gcm::GCMDriver* driver, bool is_off_the_record); InstanceIDProfileService(gcm::GCMDriver* driver, bool is_off_the_record);
~InstanceIDProfileService() override; ~InstanceIDProfileService() override;
......
...@@ -3623,20 +3623,6 @@ ...@@ -3623,20 +3623,6 @@
] ]
} }
], ],
"InstanceID": [
{
"platforms": [
"linux",
"mac",
"windows"
],
"experiments": [
{
"name": "Enabled"
}
]
}
],
"InstantApps": [ "InstantApps": [
{ {
"platforms": [ "platforms": [
......
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