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

Unified Diff: extensions/browser/api/declarative/declarative_api.cc

Issue 764643002: Remove WebViewKey in rules registry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Renaming move "remove rules registry for webview" part to WebViewGuest. 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
Index: extensions/browser/api/declarative/declarative_api.cc
diff --git a/extensions/browser/api/declarative/declarative_api.cc b/extensions/browser/api/declarative/declarative_api.cc
index 5cd807e6f65d88850af174ffb607214263694bd4..83ef50e748f205fc5bc44aaf44844f9030065cb5 100644
--- a/extensions/browser/api/declarative/declarative_api.cc
+++ b/extensions/browser/api/declarative/declarative_api.cc
@@ -148,14 +148,18 @@ bool RulesFunction::RunAsync() {
EXTENSION_FUNCTION_ERROR(kWebViewExpectedError);
event_name = GetWebRequestEventName(event_name);
- // If we are not operating on a particular <webview>, then the key is (0, 0).
- RulesRegistry::WebViewKey key(
- webview_instance_id ? embedder_process_id : 0, webview_instance_id);
+ // If we are not operating on a particular <webview>, then the key is 0.
+ int rules_registry_id = RulesRegistryService::kDefaultRulesRegistryID;
+ if (has_webview) {
+ rules_registry_id = WebViewGuest::GetOrGenerateRulesRegistryID(
+ embedder_process_id, webview_instance_id, browser_context());
Fady Samuel 2014/11/28 11:35:51 make it web_view_instance_id to be consistent with
Xi Han 2014/11/28 16:12:56 Done.
+ }
// The following call will return a NULL pointer for apps_shell, but should
// never be called there anyways.
- rules_registry_ = RulesRegistryService::Get(browser_context())->
- GetRulesRegistry(key, event_name);
+ rules_registry_ =
+ RulesRegistryService::Get(browser_context())
+ ->GetRulesRegistry(rules_registry_id, has_webview, event_name);
Fady Samuel 2014/11/28 11:35:51 I don't think we need to pass in has_webview anymo
Xi Han 2014/11/28 16:12:56 Removed.
DCHECK(rules_registry_.get());
// Raw access to this function is not available to extensions, therefore
// there should never be a request for a nonexisting rules registry.

Powered by Google App Engine
This is Rietveld 408576698