<commit_before>// Copyright (c) 2011 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_

#include "base/callback.h"
#include "content/browser/worker_host/worker_storage_partition.h"
#include "content/public/browser/browser_message_filter.h"

class ResourceDispatcherHost;
struct ViewHostMsg_CreateWorker_Params;

namespace content {
class MessagePortMessageFilter;
class ResourceContext;

class WorkerMessageFilter : public BrowserMessageFilter {
 public:
  WorkerMessageFilter(int render_process_id,
                      ResourceContext* resource_context,
                      const WorkerStoragePartition& partition,
                      MessagePortMessageFilter* message_port_filter);

  // BrowserMessageFilter implementation.
  virtual void OnChannelClosing() OVERRIDE;
  virtual bool OnMessageReceived(const IPC::Message& message,
                                 bool* message_was_ok) OVERRIDE;

  int GetNextRoutingID();
  int render_process_id() const { return render_process_id_; }

  MessagePortMessageFilter* message_port_message_filter() const {
    return message_port_message_filter_;
  }

 private:
  virtual ~WorkerMessageFilter();

  // 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);

  int render_process_id_;
  ResourceContext* const resource_context_;
  WorkerStoragePartition partition_;

  MessagePortMessageFilter* message_port_message_filter_;
  DISALLOW_IMPLICIT_CONSTRUCTORS(WorkerMessageFilter);
};

}  // namespace content

#endif  // CONTENT_BROWSER_WORKER_HOST_WORKER_MESSAGE_FILTER_H_<commit_msg>Delete not used and not implemented method in WorkerMessageFilter.<commit_after>// Copyright (c) 2011 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_

#include "base/callback.h"
#include "content/browser/worker_host/worker_storage_partition.h"
#include "content/public/browser/browser_message_filter.h"

class ResourceDispatcherHost;
struct ViewHostMsg_CreateWorker_Params;

namespace content {
class MessagePortMessageFilter;
class ResourceContext;

class WorkerMessageFilter : public BrowserMessageFilter {
 public:
  WorkerMessageFilter(int render_process_id,
                      ResourceContext* resource_context,
                      const WorkerStoragePartition& partition,
                      MessagePortMessageFilter* message_port_filter);

  // BrowserMessageFilter implementation.
  virtual void OnChannelClosing() OVERRIDE;
  virtual bool OnMessageReceived(const IPC::Message& message,
                                 bool* message_was_ok) OVERRIDE;

  int GetNextRoutingID();
  int render_process_id() const { return render_process_id_; }

  MessagePortMessageFilter* message_port_message_filter() const {
    return message_port_message_filter_;
  }

 private:
  virtual ~WorkerMessageFilter();

  // 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);

  int render_process_id_;
  ResourceContext* const resource_context_;
  WorkerStoragePartition partition_;

  MessagePortMessageFilter* message_port_message_filter_;
  DISALLOW_IMPLICIT_CONSTRUCTORS(WorkerMessageFilter);
};

}  // namespace content

#endif  // CONTENT_BROWSER_WORKER_HOST_WORKER_MESSAGE_FILTER_H_
{'fraction_non_alphanumeric': 0.06221889055472264, 'fraction_numerical': 0.001999000499750125, 'mean_word_length': 4.645980253878703, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5994962', 'n_tokens_mistral': 1140, 'n_tokens_neox': 1085, 'n_words': 258}