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

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

Issue 2166523003: Add ref count to service workers for extension API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: send increment/decrement request from renderer/ process Created 4 years, 3 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/chrome_content_browser_client_extensions_par t.h" 5 #include "chrome/browser/extensions/chrome_content_browser_client_extensions_par t.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <set> 9 #include <set>
10 10
(...skipping 11 matching lines...) Expand all
22 #include "chrome/common/chrome_constants.h" 22 #include "chrome/common/chrome_constants.h"
23 #include "chrome/common/chrome_switches.h" 23 #include "chrome/common/chrome_switches.h"
24 #include "chrome/common/extensions/extension_process_policy.h" 24 #include "chrome/common/extensions/extension_process_policy.h"
25 #include "components/guest_view/browser/guest_view_message_filter.h" 25 #include "components/guest_view/browser/guest_view_message_filter.h"
26 #include "content/public/browser/browser_thread.h" 26 #include "content/public/browser/browser_thread.h"
27 #include "content/public/browser/browser_url_handler.h" 27 #include "content/public/browser/browser_url_handler.h"
28 #include "content/public/browser/render_process_host.h" 28 #include "content/public/browser/render_process_host.h"
29 #include "content/public/browser/render_view_host.h" 29 #include "content/public/browser/render_view_host.h"
30 #include "content/public/browser/resource_dispatcher_host.h" 30 #include "content/public/browser/resource_dispatcher_host.h"
31 #include "content/public/browser/site_instance.h" 31 #include "content/public/browser/site_instance.h"
32 #include "content/public/browser/storage_partition.h"
32 #include "content/public/browser/vpn_service_proxy.h" 33 #include "content/public/browser/vpn_service_proxy.h"
33 #include "content/public/browser/web_contents.h" 34 #include "content/public/browser/web_contents.h"
34 #include "content/public/common/content_switches.h" 35 #include "content/public/common/content_switches.h"
35 #include "extensions/browser/api/web_request/web_request_api.h" 36 #include "extensions/browser/api/web_request/web_request_api.h"
36 #include "extensions/browser/api/web_request/web_request_api_helpers.h" 37 #include "extensions/browser/api/web_request/web_request_api_helpers.h"
37 #include "extensions/browser/bad_message.h" 38 #include "extensions/browser/bad_message.h"
38 #include "extensions/browser/extension_host.h" 39 #include "extensions/browser/extension_host.h"
39 #include "extensions/browser/extension_message_filter.h" 40 #include "extensions/browser/extension_message_filter.h"
40 #include "extensions/browser/extension_registry.h" 41 #include "extensions/browser/extension_registry.h"
41 #include "extensions/browser/extension_service_worker_message_filter.h" 42 #include "extensions/browser/extension_service_worker_message_filter.h"
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 content::RenderProcessHost* host) { 548 content::RenderProcessHost* host) {
548 int id = host->GetID(); 549 int id = host->GetID();
549 Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext()); 550 Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext());
550 551
551 host->AddFilter(new ChromeExtensionMessageFilter(id, profile)); 552 host->AddFilter(new ChromeExtensionMessageFilter(id, profile));
552 host->AddFilter(new ExtensionMessageFilter(id, profile)); 553 host->AddFilter(new ExtensionMessageFilter(id, profile));
553 host->AddFilter(new IOThreadExtensionMessageFilter(id, profile)); 554 host->AddFilter(new IOThreadExtensionMessageFilter(id, profile));
554 host->AddFilter(new ExtensionsGuestViewMessageFilter(id, profile)); 555 host->AddFilter(new ExtensionsGuestViewMessageFilter(id, profile));
555 if (extensions::ExtensionsClient::Get() 556 if (extensions::ExtensionsClient::Get()
556 ->ExtensionAPIEnabledInExtensionServiceWorkers()) { 557 ->ExtensionAPIEnabledInExtensionServiceWorkers()) {
557 host->AddFilter(new ExtensionServiceWorkerMessageFilter(id, profile)); 558 host->AddFilter(new ExtensionServiceWorkerMessageFilter(
559 id, profile, host->GetStoragePartition()->GetServiceWorkerContext()));
558 } 560 }
559 extension_web_request_api_helpers::SendExtensionWebRequestStatusToHost(host); 561 extension_web_request_api_helpers::SendExtensionWebRequestStatusToHost(host);
560 } 562 }
561 563
562 void ChromeContentBrowserClientExtensionsPart::SiteInstanceGotProcess( 564 void ChromeContentBrowserClientExtensionsPart::SiteInstanceGotProcess(
563 SiteInstance* site_instance) { 565 SiteInstance* site_instance) {
564 BrowserContext* context = site_instance->GetProcess()->GetBrowserContext(); 566 BrowserContext* context = site_instance->GetProcess()->GetBrowserContext();
565 ExtensionRegistry* registry = ExtensionRegistry::Get(context); 567 ExtensionRegistry* registry = ExtensionRegistry::Get(context);
566 if (!registry) 568 if (!registry)
567 return; 569 return;
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
686 } 688 }
687 } 689 }
688 } 690 }
689 691
690 void ChromeContentBrowserClientExtensionsPart::ResourceDispatcherHostCreated() { 692 void ChromeContentBrowserClientExtensionsPart::ResourceDispatcherHostCreated() {
691 content::ResourceDispatcherHost::Get()->RegisterInterceptor( 693 content::ResourceDispatcherHost::Get()->RegisterInterceptor(
692 "Origin", kExtensionScheme, base::Bind(&OnHttpHeaderReceived)); 694 "Origin", kExtensionScheme, base::Bind(&OnHttpHeaderReceived));
693 } 695 }
694 696
695 } // namespace extensions 697 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698