From 83ff0e9fc08bf489c3b733b9aea10f6e2cecfac2 Mon Sep 17 00:00:00 2001 From: "thakis@chromium.org" Date: Wed, 5 Mar 2014 19:39:24 +0000 Subject: Revert r255069 "Add ExtensionsApiClient interface, use it in the storage API SettingsFrontend" Likely broke GCMProfileServiceSingleProfileTest.Unregister Android. BUG=348058 Review URL: https://codereview.chromium.org/184343007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@255112 0039d316-1c4b-4281-b951-d872f2087c98 --- extensions/browser/api/extensions_api_client.cc | 27 ----------- extensions/browser/api/extensions_api_client.h | 56 ---------------------- .../browser/api/storage/settings_namespace.cc | 46 ------------------ .../browser/api/storage/settings_namespace.h | 34 ------------- 4 files changed, 163 deletions(-) delete mode 100644 extensions/browser/api/extensions_api_client.cc delete mode 100644 extensions/browser/api/extensions_api_client.h delete mode 100644 extensions/browser/api/storage/settings_namespace.cc delete mode 100644 extensions/browser/api/storage/settings_namespace.h (limited to 'extensions/browser/api') diff --git a/extensions/browser/api/extensions_api_client.cc b/extensions/browser/api/extensions_api_client.cc deleted file mode 100644 index c4f8013..0000000 --- a/extensions/browser/api/extensions_api_client.cc +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "extensions/browser/api/extensions_api_client.h" - -namespace extensions { -namespace { - -ExtensionsAPIClient* g_instance = NULL; - -} // namespace - -ExtensionsAPIClient::ExtensionsAPIClient() { g_instance = this; } - -ExtensionsAPIClient::~ExtensionsAPIClient() { g_instance = NULL; } - -// static -ExtensionsAPIClient* ExtensionsAPIClient::Get() { return g_instance; } - -void ExtensionsAPIClient::AddAdditionalValueStoreCaches( - content::BrowserContext* context, - const scoped_refptr& factory, - const scoped_refptr >& observers, - std::map* caches) {} - -} // namespace extensions diff --git a/extensions/browser/api/extensions_api_client.h b/extensions/browser/api/extensions_api_client.h deleted file mode 100644 index 88dbaa4..0000000 --- a/extensions/browser/api/extensions_api_client.h +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef EXTENSIONS_BROWSER_API_EXTENSIONS_API_CLIENT_H_ -#define EXTENSIONS_BROWSER_API_EXTENSIONS_API_CLIENT_H_ - -#include - -#include "base/memory/ref_counted.h" -#include "extensions/browser/api/storage/settings_namespace.h" - -template -class ObserverListThreadSafe; - -namespace content { -class BrowserContext; -} - -namespace extensions { - -class SettingsObserver; -class SettingsStorageFactory; -class ValueStoreCache; - -// Allows the embedder of the extensions module to customize its support for -// API features. The embedder must create a single instance in the browser -// process. Provides a default implementation that does nothing. -class ExtensionsAPIClient { - public: - // Construction sets the single instance. - ExtensionsAPIClient(); - - // Destruction clears the single instance. - virtual ~ExtensionsAPIClient(); - - // Returns the single instance of |this|. - static ExtensionsAPIClient* Get(); - - // Storage API support. - - // Add any additional value store caches (e.g. for chrome.storage.managed) - // to |caches|. By default adds nothing. - virtual void AddAdditionalValueStoreCaches( - content::BrowserContext* context, - const scoped_refptr& factory, - const scoped_refptr >& observers, - std::map* caches); - - // NOTE: If this interface gains too many methods (perhaps more than 20) it - // should be split into one interface per API. -}; - -} // namespace extensions - -#endif // EXTENSIONS_BROWSER_API_EXTENSIONS_API_CLIENT_H_ diff --git a/extensions/browser/api/storage/settings_namespace.cc b/extensions/browser/api/storage/settings_namespace.cc deleted file mode 100644 index e178c7c..0000000 --- a/extensions/browser/api/storage/settings_namespace.cc +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "extensions/browser/api/storage/settings_namespace.h" - -#include "base/logging.h" - -namespace extensions { - -namespace settings_namespace { - -namespace { -const char kLocalNamespace[] = "local"; -const char kSyncNamespace[] = "sync"; -const char kManagedNamespace[] = "managed"; -} // namespace - -std::string ToString(Namespace settings_namespace) { - switch (settings_namespace) { - case LOCAL: - return kLocalNamespace; - case SYNC: - return kSyncNamespace; - case MANAGED: - return kManagedNamespace; - case INVALID: - break; - } - NOTREACHED(); - return std::string(); -} - -Namespace FromString(const std::string& namespace_string) { - if (namespace_string == kLocalNamespace) - return LOCAL; - if (namespace_string == kSyncNamespace) - return SYNC; - if (namespace_string == kManagedNamespace) - return MANAGED; - return INVALID; -} - -} // namespace settings_namespace - -} // namespace extensions diff --git a/extensions/browser/api/storage/settings_namespace.h b/extensions/browser/api/storage/settings_namespace.h deleted file mode 100644 index 7a5a812..0000000 --- a/extensions/browser/api/storage/settings_namespace.h +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef EXTENSIONS_BROWSER_API_STORAGE_SETTINGS_NAMESPACE_H_ -#define EXTENSIONS_BROWSER_API_STORAGE_SETTINGS_NAMESPACE_H_ - -#include - -namespace extensions { - -namespace settings_namespace { - -// The namespaces of the storage areas. -enum Namespace { - LOCAL, // "local" i.e. chrome.storage.local - SYNC, // "sync" i.e. chrome.storage.sync - MANAGED, // "managed" i.e. chrome.storage.managed - INVALID -}; - -// Converts a namespace to its string representation. -// Namespace must not be INVALID. -std::string ToString(Namespace settings_namespace); - -// Converts a string representation of a namespace to its namespace, or INVALID -// if the string doesn't map to one. -Namespace FromString(const std::string& ns_string); - -} // namespace settings_namespace - -} // namespace extensions - -#endif // EXTENSIONS_BROWSER_API_STORAGE_SETTINGS_NAMESPACE_H_ -- cgit v1.1