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

Unified Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 154263004: Add commandline flag for ServiceWroker in the renderer process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: incorporated kinuko's comment Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/worker_host/worker_service_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_process_host_impl.cc
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 05b823ed2a1d6d32c0455feb420938af4e21e45b..28ec3059fd4b5dba6f8566c2bb1025097a6cbffc 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -97,6 +97,7 @@
#include "content/browser/screen_orientation/screen_orientation_dispatcher_host.h"
#include "content/browser/service_worker/service_worker_context_wrapper.h"
#include "content/browser/service_worker/service_worker_dispatcher_host.h"
+#include "content/browser/shared_worker/shared_worker_message_filter.h"
#include "content/browser/speech/input_tag_speech_dispatcher_host.h"
#include "content/browser/speech/speech_recognition_dispatcher_host.h"
#include "content/browser/storage_partition_impl.h"
@@ -123,6 +124,7 @@
#include "content/public/browser/render_widget_host_iterator.h"
#include "content/public/browser/resource_context.h"
#include "content/public/browser/user_metrics.h"
+#include "content/public/browser/worker_service.h"
#include "content/public/common/content_constants.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/process_type.h"
@@ -756,18 +758,35 @@ void RenderProcessHostImpl::CreateMessageFilters() {
base::Unretained(widget_helper_.get())));
AddFilter(message_port_message_filter_);
- AddFilter(new WorkerMessageFilter(
- GetID(),
- resource_context,
- WorkerStoragePartition(
- storage_partition_impl_->GetURLRequestContext(),
- storage_partition_impl_->GetMediaURLRequestContext(),
- storage_partition_impl_->GetAppCacheService(),
- storage_partition_impl_->GetQuotaManager(),
- storage_partition_impl_->GetFileSystemContext(),
- storage_partition_impl_->GetDatabaseTracker(),
- storage_partition_impl_->GetIndexedDBContext()),
- message_port_message_filter_));
+ // If "--enable-embedded-shared-worker" is set, we use
+ // SharedWorkerMessageFilter in stead of WorkerMessageFilter.
+ if (WorkerService::EmbeddedSharedWorkerEnabled()) {
+ AddFilter(new SharedWorkerMessageFilter(
+ GetID(),
+ resource_context,
+ WorkerStoragePartition(
+ storage_partition_impl_->GetURLRequestContext(),
+ storage_partition_impl_->GetMediaURLRequestContext(),
+ storage_partition_impl_->GetAppCacheService(),
+ storage_partition_impl_->GetQuotaManager(),
+ storage_partition_impl_->GetFileSystemContext(),
+ storage_partition_impl_->GetDatabaseTracker(),
+ storage_partition_impl_->GetIndexedDBContext()),
+ message_port_message_filter_));
+ } else {
+ AddFilter(new WorkerMessageFilter(
+ GetID(),
+ resource_context,
+ WorkerStoragePartition(
+ storage_partition_impl_->GetURLRequestContext(),
+ storage_partition_impl_->GetMediaURLRequestContext(),
+ storage_partition_impl_->GetAppCacheService(),
+ storage_partition_impl_->GetQuotaManager(),
+ storage_partition_impl_->GetFileSystemContext(),
+ storage_partition_impl_->GetDatabaseTracker(),
+ storage_partition_impl_->GetIndexedDBContext()),
+ message_port_message_filter_));
+ }
#if defined(ENABLE_WEBRTC)
AddFilter(new P2PSocketDispatcherHost(
« no previous file with comments | « no previous file | content/browser/worker_host/worker_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698