Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(228)

Unified Diff: extensions/common/extension_api.cc

Issue 183893041: Move sockets APIs out of src/chrome (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rename api targets Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/common/api/sockets_udp.idl ('k') | extensions/common/extensions_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/extension_api.cc
diff --git a/extensions/common/extension_api.cc b/extensions/common/extension_api.cc
index 8e27f2b036f4af94f1ae3ae56eacc52774537198..b418734e7729da3f7d21dc94e6aa98078f7eae52 100644
--- a/extensions/common/extension_api.cc
+++ b/extensions/common/extension_api.cc
@@ -16,8 +16,8 @@
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/values.h"
-#include "chrome/common/extensions/api/generated_schemas.h"
#include "extensions/common/extension.h"
+#include "extensions/common/extensions_client.h"
#include "extensions/common/features/feature.h"
#include "extensions/common/features/feature_provider.h"
#include "extensions/common/permissions/permission_set.h"
@@ -29,8 +29,6 @@
namespace extensions {
-using api::GeneratedSchemas;
-
namespace {
const char* kChildKinds[] = {
@@ -200,7 +198,9 @@ void ExtensionAPI::LoadSchema(const std::string& name,
const base::StringPiece& schema) {
scoped_ptr<base::ListValue> schema_list(LoadSchemaList(name, schema));
std::string schema_namespace;
-
+ extensions::ExtensionsClient* extensions_client =
+ extensions::ExtensionsClient::Get();
+ DCHECK(extensions_client);
while (!schema_list->empty()) {
base::DictionaryValue* schema = NULL;
{
@@ -212,7 +212,7 @@ void ExtensionAPI::LoadSchema(const std::string& name,
CHECK(schema->GetString("namespace", &schema_namespace));
PrefixWithNamespace(schema_namespace, schema);
schemas_[schema_namespace] = make_linked_ptr(schema);
- if (!GeneratedSchemas::IsGenerated(schema_namespace))
+ if (!extensions_client->IsAPISchemaGenerated(schema_namespace))
CHECK_EQ(1u, unloaded_schemas_.erase(schema_namespace));
}
}
@@ -344,14 +344,17 @@ const base::DictionaryValue* ExtensionAPI::GetSchema(
result = maybe_schema->second.get();
} else {
// Might not have loaded yet; or might just not exist.
- UnloadedSchemaMap::iterator maybe_schema_resource =
+ UnloadedSchemaMap::iterator maybe_schema_resource =
unloaded_schemas_.find(api_name);
+ extensions::ExtensionsClient* extensions_client =
+ extensions::ExtensionsClient::Get();
+ DCHECK(extensions_client);
if (maybe_schema_resource != unloaded_schemas_.end()) {
LoadSchema(maybe_schema_resource->first,
ReadFromResource(maybe_schema_resource->second));
} else if (default_configuration_initialized_ &&
- GeneratedSchemas::IsGenerated(api_name)) {
- LoadSchema(api_name, GeneratedSchemas::Get(api_name));
+ extensions_client->IsAPISchemaGenerated(api_name)) {
+ LoadSchema(api_name, extensions_client->GetAPISchema(api_name));
} else {
return NULL;
}
@@ -390,9 +393,12 @@ Feature* ExtensionAPI::GetFeatureDependency(const std::string& full_name) {
std::string ExtensionAPI::GetAPINameFromFullName(const std::string& full_name,
std::string* child_name) {
std::string api_name_candidate = full_name;
+ extensions::ExtensionsClient* extensions_client =
+ extensions::ExtensionsClient::Get();
+ DCHECK(extensions_client);
while (true) {
if (schemas_.find(api_name_candidate) != schemas_.end() ||
- GeneratedSchemas::IsGenerated(api_name_candidate) ||
+ extensions_client->IsAPISchemaGenerated(api_name_candidate) ||
unloaded_schemas_.find(api_name_candidate) != unloaded_schemas_.end()) {
std::string result = api_name_candidate;
« no previous file with comments | « extensions/common/api/sockets_udp.idl ('k') | extensions/common/extensions_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698