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

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: sync@tott Created 4 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
« no previous file with comments | « no previous file | chrome/browser/extensions/service_worker_apitest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 content::RenderProcessHost* host) { 554 content::RenderProcessHost* host) {
554 int id = host->GetID(); 555 int id = host->GetID();
555 Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext()); 556 Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext());
556 557
557 host->AddFilter(new ChromeExtensionMessageFilter(id, profile)); 558 host->AddFilter(new ChromeExtensionMessageFilter(id, profile));
558 host->AddFilter(new ExtensionMessageFilter(id, profile)); 559 host->AddFilter(new ExtensionMessageFilter(id, profile));
559 host->AddFilter(new IOThreadExtensionMessageFilter(id, profile)); 560 host->AddFilter(new IOThreadExtensionMessageFilter(id, profile));
560 host->AddFilter(new ExtensionsGuestViewMessageFilter(id, profile)); 561 host->AddFilter(new ExtensionsGuestViewMessageFilter(id, profile));
561 if (extensions::ExtensionsClient::Get() 562 if (extensions::ExtensionsClient::Get()
562 ->ExtensionAPIEnabledInExtensionServiceWorkers()) { 563 ->ExtensionAPIEnabledInExtensionServiceWorkers()) {
563 host->AddFilter(new ExtensionServiceWorkerMessageFilter(id, profile)); 564 host->AddFilter(new ExtensionServiceWorkerMessageFilter(
565 id, profile, host->GetStoragePartition()->GetServiceWorkerContext()));
564 } 566 }
565 extension_web_request_api_helpers::SendExtensionWebRequestStatusToHost(host); 567 extension_web_request_api_helpers::SendExtensionWebRequestStatusToHost(host);
566 } 568 }
567 569
568 void ChromeContentBrowserClientExtensionsPart::SiteInstanceGotProcess( 570 void ChromeContentBrowserClientExtensionsPart::SiteInstanceGotProcess(
569 SiteInstance* site_instance) { 571 SiteInstance* site_instance) {
570 BrowserContext* context = site_instance->GetProcess()->GetBrowserContext(); 572 BrowserContext* context = site_instance->GetProcess()->GetBrowserContext();
571 ExtensionRegistry* registry = ExtensionRegistry::Get(context); 573 ExtensionRegistry* registry = ExtensionRegistry::Get(context);
572 if (!registry) 574 if (!registry)
573 return; 575 return;
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
688 #endif 690 #endif
689 } 691 }
690 } 692 }
691 693
692 void ChromeContentBrowserClientExtensionsPart::ResourceDispatcherHostCreated() { 694 void ChromeContentBrowserClientExtensionsPart::ResourceDispatcherHostCreated() {
693 content::ResourceDispatcherHost::Get()->RegisterInterceptor( 695 content::ResourceDispatcherHost::Get()->RegisterInterceptor(
694 "Origin", kExtensionScheme, base::Bind(&OnHttpHeaderReceived)); 696 "Origin", kExtensionScheme, base::Bind(&OnHttpHeaderReceived));
695 } 697 }
696 698
697 } // namespace extensions 699 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/service_worker_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698