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

Unified Diff: content/browser/shared_worker/shared_worker_message_filter.h

Issue 166273002: Add SharedWorkerMessageFilter for the embedded SharedWorker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporated kinuko's comments. Created 6 years, 10 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/shared_worker/shared_worker_message_filter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/shared_worker/shared_worker_message_filter.h
diff --git a/content/browser/worker_host/worker_message_filter.h b/content/browser/shared_worker/shared_worker_message_filter.h
similarity index 37%
copy from content/browser/worker_host/worker_message_filter.h
copy to content/browser/shared_worker/shared_worker_message_filter.h
index 7581936da144ccc2d7cbb6714fdd7c7d841b6e28..285f8211d7d7611ca30d2d9d4518c6d578b5178f 100644
--- a/content/browser/worker_host/worker_message_filter.h
+++ b/content/browser/shared_worker/shared_worker_message_filter.h
@@ -1,27 +1,28 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_BROWSER_WORKER_HOST_WORKER_MESSAGE_FILTER_H_
-#define CONTENT_BROWSER_WORKER_HOST_WORKER_MESSAGE_FILTER_H_
+#ifndef CONTENT_BROWSER_SHARED_WORKER_SHARED_WORKER_MESSAGE_FILTER_H_
+#define CONTENT_BROWSER_SHARED_WORKER_SHARED_WORKER_MESSAGE_FILTER_H_
-#include "base/callback.h"
#include "content/browser/worker_host/worker_storage_partition.h"
#include "content/public/browser/browser_message_filter.h"
-class ResourceDispatcherHost;
+class GURL;
struct ViewHostMsg_CreateWorker_Params;
namespace content {
class MessagePortMessageFilter;
class ResourceContext;
-class WorkerMessageFilter : public BrowserMessageFilter {
+// If "enable-embedded-shared-worker" is set this class will be used instead of
+// WorkerMessageFilter.
+class SharedWorkerMessageFilter : public BrowserMessageFilter {
public:
- WorkerMessageFilter(int render_process_id,
- ResourceContext* resource_context,
- const WorkerStoragePartition& partition,
- MessagePortMessageFilter* message_port_filter);
+ SharedWorkerMessageFilter(int render_process_id,
+ ResourceContext* resource_context,
+ const WorkerStoragePartition& partition,
+ MessagePortMessageFilter* message_port_filter);
// BrowserMessageFilter implementation.
virtual void OnChannelClosing() OVERRIDE;
@@ -36,23 +37,40 @@ class WorkerMessageFilter : public BrowserMessageFilter {
}
private:
- virtual ~WorkerMessageFilter();
+ virtual ~SharedWorkerMessageFilter();
// Message handlers.
void OnCreateWorker(const ViewHostMsg_CreateWorker_Params& params,
int* route_id);
void OnForwardToWorker(const IPC::Message& message);
void OnDocumentDetached(unsigned long long document_id);
- void OnCreateMessagePort(int* route_id, int* message_port_id);
+ void OnWorkerContextClosed(int worker_route_id);
+ void OnWorkerContextDestroyed(int worker_route_id);
+ void OnWorkerScriptLoaded(int worker_route_id);
+ void OnWorkerScriptLoadFailed(int worker_route_id);
+ void OnWorkerConnected(int message_port_id, int worker_route_id);
+ void OnAllowDatabase(int worker_route_id,
+ const GURL& url,
+ const base::string16& name,
+ const base::string16& display_name,
+ unsigned long estimated_size,
+ bool* result);
+ void OnAllowFileSystem(int worker_route_id,
+ const GURL& url,
+ bool* result);
+ void OnAllowIndexedDB(int worker_route_id,
+ const GURL& url,
+ const base::string16& name,
+ bool* result);
- int render_process_id_;
+ const int render_process_id_;
ResourceContext* const resource_context_;
- WorkerStoragePartition partition_;
+ const WorkerStoragePartition partition_;
+ MessagePortMessageFilter* const message_port_message_filter_;
- MessagePortMessageFilter* message_port_message_filter_;
- DISALLOW_IMPLICIT_CONSTRUCTORS(WorkerMessageFilter);
+ DISALLOW_IMPLICIT_CONSTRUCTORS(SharedWorkerMessageFilter);
};
} // namespace content
-#endif // CONTENT_BROWSER_WORKER_HOST_WORKER_MESSAGE_FILTER_H_
+#endif // CONTENT_BROWSER_SHARED_WORKER_SHARED_WORKER_MESSAGE_FILTER_H_
« no previous file with comments | « no previous file | content/browser/shared_worker/shared_worker_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698