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

Side by Side Diff: chrome/browser/extensions/extension_function_dispatcher.cc

Issue 11246003: Remove Profile->GetExtensionProcessManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix extension_crash_recovery_browsertest Created 8 years, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/extension_function_dispatcher.h" 5 #include "chrome/browser/extensions/extension_function_dispatcher.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/json/json_string_value_serializer.h" 9 #include "base/json/json_string_value_serializer.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 250
251 // We only adjust the keepalive count for UIThreadExtensionFunction for 251 // We only adjust the keepalive count for UIThreadExtensionFunction for
252 // now, largely for simplicity's sake. This is OK because currently, only 252 // now, largely for simplicity's sake. This is OK because currently, only
253 // the webRequest API uses IOThreadExtensionFunction, and that API is not 253 // the webRequest API uses IOThreadExtensionFunction, and that API is not
254 // compatible with lazy background pages. 254 // compatible with lazy background pages.
255 process_manager->IncrementLazyKeepaliveCount(extension); 255 process_manager->IncrementLazyKeepaliveCount(extension);
256 } 256 }
257 257
258 void ExtensionFunctionDispatcher::OnExtensionFunctionCompleted( 258 void ExtensionFunctionDispatcher::OnExtensionFunctionCompleted(
259 const Extension* extension) { 259 const Extension* extension) {
260 profile()->GetExtensionProcessManager()->DecrementLazyKeepaliveCount( 260 extensions::ExtensionSystem::Get(profile())->process_manager()->
261 extension); 261 DecrementLazyKeepaliveCount(extension);
262 } 262 }
263 263
264 // static 264 // static
265 bool ExtensionFunctionDispatcher::CheckPermissions( 265 bool ExtensionFunctionDispatcher::CheckPermissions(
266 ExtensionFunction* function, 266 ExtensionFunction* function,
267 const Extension* extension, 267 const Extension* extension,
268 const ExtensionHostMsg_Request_Params& params, 268 const ExtensionHostMsg_Request_Params& params,
269 IPC::Sender* ipc_sender, 269 IPC::Sender* ipc_sender,
270 int routing_id) { 270 int routing_id) {
271 if (!function->HasPermission()) { 271 if (!function->HasPermission()) {
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 } 323 }
324 324
325 // static 325 // static
326 void ExtensionFunctionDispatcher::SendAccessDenied( 326 void ExtensionFunctionDispatcher::SendAccessDenied(
327 IPC::Sender* ipc_sender, int routing_id, int request_id) { 327 IPC::Sender* ipc_sender, int routing_id, int request_id) {
328 ListValue empty_list; 328 ListValue empty_list;
329 ipc_sender->Send(new ExtensionMsg_Response( 329 ipc_sender->Send(new ExtensionMsg_Response(
330 routing_id, request_id, false, empty_list, 330 routing_id, request_id, false, empty_list,
331 "Access to extension API denied.")); 331 "Access to extension API denied."));
332 } 332 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_devtools_browsertests.cc ('k') | chrome/browser/extensions/extension_infobar_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698