[SyncFS] Build indexes from FileTracker entries on disk.
[chromium-blink-merge.git] / content / child / thread_safe_sender.h
blob6cd5c7517e9e98bf42a53d9ca533e966ff78063a
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CONTENT_CHILD_THREAD_SAFE_SENDER_H_
6 #define CONTENT_CHILD_THREAD_SAFE_SENDER_H_
8 #include "base/gtest_prod_util.h"
9 #include "base/memory/ref_counted.h"
10 #include "content/common/content_export.h"
11 #include "ipc/ipc_sender.h"
13 namespace base {
14 class MessageLoopProxy;
17 namespace IPC {
18 class SyncMessageFilter;
21 namespace content {
22 class ChildThread;
24 // The class of Sender returned by ChildThread::thread_safe_sender().
25 class CONTENT_EXPORT ThreadSafeSender
26 : public IPC::Sender,
27 public base::RefCountedThreadSafe<ThreadSafeSender> {
28 public:
29 virtual bool Send(IPC::Message* msg) OVERRIDE;
31 private:
32 friend class ChildThread; // for construction
33 friend class IndexedDBDispatcherTest;
34 friend class WebIDBCursorImplTest;
35 friend class base::RefCountedThreadSafe<ThreadSafeSender>;
37 ThreadSafeSender(base::MessageLoopProxy* main_loop,
38 IPC::SyncMessageFilter* sync_filter);
39 virtual ~ThreadSafeSender();
41 scoped_refptr<base::MessageLoopProxy> main_loop_;
42 scoped_refptr<IPC::SyncMessageFilter> sync_filter_;
44 DISALLOW_COPY_AND_ASSIGN(ThreadSafeSender);
47 } // namespace content
49 #endif // CONTENT_CHILD_THREAD_SAFE_SENDER_H_