| 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..e5209b6788856af9b2487ee3ba8605890d144e8b 100644
|
| --- a/extensions/browser/api/declarative/declarative_api.cc
|
| +++ b/extensions/browser/api/declarative/declarative_api.cc
|
| @@ -148,14 +148,19 @@ 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::kDefultRulesRegistryID;
|
| + if (has_webview) {
|
| + WebViewGuest::GenerateRulesRegistryID(
|
| + embedder_process_id, webview_instance_id,
|
| + RulesRegistryService::Get(browser_context()), &rules_registry_id);
|
| + }
|
|
|
| // 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);
|
| 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.
|
|
|