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

Unified Diff: chrome/browser/extensions/extension_function_dispatcher.cc

Issue 9978012: Revert 130697 - Reland r130462: Implement FeatureProvider for ExtensionAPI." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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
Index: chrome/browser/extensions/extension_function_dispatcher.cc
===================================================================
--- chrome/browser/extensions/extension_function_dispatcher.cc (revision 130700)
+++ chrome/browser/extensions/extension_function_dispatcher.cc (working copy)
@@ -7,7 +7,6 @@
#include <map>
#include "base/json/json_string_value_serializer.h"
-#include "base/lazy_instance.h"
#include "base/memory/ref_counted.h"
#include "base/process_util.h"
#include "base/values.h"
@@ -40,8 +39,6 @@
using content::RenderViewHost;
using WebKit::WebSecurityOrigin;
-namespace {
-
const char kAccessDenied[] = "access denied";
const char kQuotaExceeded[] = "quota exceeded";
@@ -83,20 +80,6 @@
}
}
-// Separate copy of ExtensionAPI used for IO thread extension functions. We need
-// this because ExtensionAPI has mutable data. It should be possible to remove
-// this once all the extension APIs are updated to the feature system.
-struct Static {
- Static()
- : api(extensions::ExtensionAPI::CreateWithDefaultConfiguration()) {
- }
- scoped_ptr<extensions::ExtensionAPI> api;
-};
-base::LazyInstance<Static> g_global_io_data = LAZY_INSTANCE_INITIALIZER;
-
-} // namespace
-
-
void ExtensionFunctionDispatcher::GetAllFunctionNames(
std::vector<std::string>* names) {
ExtensionFunctionRegistry::GetInstance()->GetAllNames(names);
@@ -125,9 +108,7 @@
scoped_refptr<ExtensionFunction> function(
CreateExtensionFunction(params, extension, render_process_id,
- extension_info_map->process_map(),
- g_global_io_data.Get().api.get(),
- profile,
+ extension_info_map->process_map(), profile,
ipc_sender, routing_id));
if (!function) {
LogFailure(extension, params.name, kAccessDenied);
@@ -210,7 +191,6 @@
CreateExtensionFunction(params, extension,
render_view_host->GetProcess()->GetID(),
*(service->process_map()),
- extensions::ExtensionAPI::GetSharedInstance(),
profile(), render_view_host,
render_view_host->GetRoutingID()));
if (!function) {
@@ -262,7 +242,6 @@
const Extension* extension,
int requesting_process_id,
const extensions::ProcessMap& process_map,
- extensions::ExtensionAPI* api,
void* profile,
IPC::Message::Sender* ipc_sender,
int routing_id) {
@@ -272,7 +251,7 @@
return NULL;
}
- if (api->IsPrivileged(params.name) &&
+ if (ExtensionAPI::GetInstance()->IsPrivileged(params.name) &&
!process_map.Contains(extension->id(), requesting_process_id)) {
LOG(ERROR) << "Extension API called from incorrect process "
<< requesting_process_id
« no previous file with comments | « chrome/browser/extensions/extension_function_dispatcher.h ('k') | chrome/browser/extensions/settings/settings_frontend.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698