<commit_before>// Copyright (c) 2010 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 BASE_MESSAGE_LOOP_PROXY_IMPL_H_
#define BASE_MESSAGE_LOOP_PROXY_IMPL_H_
#pragma once

#include "base/lock.h"
#include "base/message_loop.h"
#include "base/message_loop_proxy.h"

namespace base {

// A stock implementation of MessageLoopProxy that takes in a MessageLoop
// and keeps track of its lifetime using the MessageLoop DestructionObserver.
// For now a MessageLoopProxyImpl can only be created for the current thread.
class MessageLoopProxyImpl : public MessageLoopProxy,
                             public MessageLoop::DestructionObserver {
 public:
  ~MessageLoopProxyImpl();

  // MessageLoopProxy implementation
  virtual bool PostTask(const tracked_objects::Location& from_here,
                        Task* task);
  virtual bool PostDelayedTask(const tracked_objects::Location& from_here,
                               Task* task, int64 delay_ms);
  virtual bool PostNonNestableTask(const tracked_objects::Location& from_here,
                                   Task* task);
  virtual bool PostNonNestableDelayedTask(
      const tracked_objects::Location& from_here,
      Task* task,
      int64 delay_ms);
  virtual bool BelongsToCurrentThread();

// MessageLoop::DestructionObserver implementation
  void WillDestroyCurrentMessageLoop();

 protected:<commit_msg>A quick fix for Bug 64463. It seems scoped_refptr<MessageLoopProxy>::~scoped_refptr() cannot call MessageLoopProxyImpl::~MessageLoopProxyImpl() because it is not a virtual destructor. This change just changes it to a virtual one.<commit_after>// Copyright (c) 2010 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 BASE_MESSAGE_LOOP_PROXY_IMPL_H_
#define BASE_MESSAGE_LOOP_PROXY_IMPL_H_
#pragma once

#include "base/lock.h"
#include "base/message_loop.h"
#include "base/message_loop_proxy.h"

namespace base {

// A stock implementation of MessageLoopProxy that takes in a MessageLoop
// and keeps track of its lifetime using the MessageLoop DestructionObserver.
// For now a MessageLoopProxyImpl can only be created for the current thread.
class MessageLoopProxyImpl : public MessageLoopProxy,
                             public MessageLoop::DestructionObserver {
 public:
  virtual ~MessageLoopProxyImpl();

  // MessageLoopProxy implementation
  virtual bool PostTask(const tracked_objects::Location& from_here,
                        Task* task);
  virtual bool PostDelayedTask(const tracked_objects::Location& from_here,
                               Task* task, int64 delay_ms);
  virtual bool PostNonNestableTask(const tracked_objects::Location& from_here,
                                   Task* task);
  virtual bool PostNonNestableDelayedTask(
      const tracked_objects::Location& from_here,
      Task* task,
      int64 delay_ms);
  virtual bool BelongsToCurrentThread();

// MessageLoop::DestructionObserver implementation
  void WillDestroyCurrentMessageLoop();

 protected:
{'fraction_non_alphanumeric': 0.0670654911838791, 'fraction_numerical': 0.006612090680100755, 'mean_word_length': 3.658357771260997, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '6486773', 'n_tokens_mistral': 858, 'n_tokens_neox': 829, 'n_words': 280}