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

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

Issue 708713003: Don't crash when granting permissions to active tab. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change for with iterators to a foreach. Created 6 years, 1 month 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 | « no previous file | chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/active_tab_permission_granter.cc
diff --git a/chrome/browser/extensions/active_tab_permission_granter.cc b/chrome/browser/extensions/active_tab_permission_granter.cc
index a7815142001ef01a0c07290acf66027048172498..4e7383864a1e63706427d5b868767a1dc8504a9e 100644
--- a/chrome/browser/extensions/active_tab_permission_granter.cc
+++ b/chrome/browser/extensions/active_tab_permission_granter.cc
@@ -8,6 +8,7 @@
#include "chrome/browser/profiles/profile.h"
#include "content/public/browser/navigation_details.h"
#include "content/public/browser/navigation_entry.h"
+#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/common/extension_messages.h"
@@ -65,9 +66,11 @@ void ActiveTabPermissionGranter::GrantIfRequested(const Extension* extension) {
const content::NavigationEntry* navigation_entry =
web_contents()->GetController().GetVisibleEntry();
if (navigation_entry) {
- Send(new ExtensionMsg_UpdateTabSpecificPermissions(
+ content::RenderViewHost* render_view_host =
+ web_contents()->GetRenderViewHost();
+ render_view_host->Send(new ExtensionMsg_UpdateTabSpecificPermissions(
+ render_view_host->GetRoutingID(),
navigation_entry->GetURL(),
- tab_id_,
extension->id(),
new_hosts));
// If more things ever need to know about this, we should consider making
@@ -133,7 +136,10 @@ void ActiveTabPermissionGranter::ClearActiveExtensionsAndNotify() {
extension_ids.push_back((*it)->id());
}
- Send(new ExtensionMsg_ClearTabSpecificPermissions(tab_id_, extension_ids));
+ content::RenderViewHost* render_view_host =
+ web_contents()->GetRenderViewHost();
+ render_view_host->Send(new ExtensionMsg_ClearTabSpecificPermissions(
+ render_view_host->GetRoutingID(), extension_ids));
granted_extensions_.Clear();
}
« no previous file with comments | « no previous file | chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698