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

Side by Side Diff: content/common/child_thread.h

Issue 6711024: Example of how to interpose yourself in a message stream. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_COMMON_CHILD_THREAD_H_ 5 #ifndef CONTENT_COMMON_CHILD_THREAD_H_
6 #define CONTENT_COMMON_CHILD_THREAD_H_ 6 #define CONTENT_COMMON_CHILD_THREAD_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 24 matching lines...) Expand all
35 35
36 // IPC::Message::Sender implementation: 36 // IPC::Message::Sender implementation:
37 virtual bool Send(IPC::Message* msg); 37 virtual bool Send(IPC::Message* msg);
38 38
39 // See documentation on MessageRouter for AddRoute and RemoveRoute 39 // See documentation on MessageRouter for AddRoute and RemoveRoute
40 void AddRoute(int32 routing_id, IPC::Channel::Listener* listener); 40 void AddRoute(int32 routing_id, IPC::Channel::Listener* listener);
41 void RemoveRoute(int32 routing_id); 41 void RemoveRoute(int32 routing_id);
42 42
43 IPC::Channel::Listener* ResolveRoute(int32 routing_id); 43 IPC::Channel::Listener* ResolveRoute(int32 routing_id);
44 44
45 IPC::SyncChannel* channel() { return channel_.get(); }
46
45 // Creates a ResourceLoaderBridge. 47 // Creates a ResourceLoaderBridge.
46 // Tests can override this method if they want a custom loading behavior. 48 // Tests can override this method if they want a custom loading behavior.
47 virtual webkit_glue::ResourceLoaderBridge* CreateBridge( 49 virtual webkit_glue::ResourceLoaderBridge* CreateBridge(
48 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info); 50 const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info);
49 51
50 ResourceDispatcher* resource_dispatcher(); 52 ResourceDispatcher* resource_dispatcher();
51 53
52 SocketStreamDispatcher* socket_stream_dispatcher() { 54 SocketStreamDispatcher* socket_stream_dispatcher() {
53 return socket_stream_dispatcher_.get(); 55 return socket_stream_dispatcher_.get();
54 } 56 }
(...skipping 22 matching lines...) Expand all
77 void OnProcessFinalRelease(); 79 void OnProcessFinalRelease();
78 80
79 virtual bool OnControlMessageReceived(const IPC::Message& msg); 81 virtual bool OnControlMessageReceived(const IPC::Message& msg);
80 virtual void OnAskBeforeShutdown(); 82 virtual void OnAskBeforeShutdown();
81 virtual void OnShutdown(); 83 virtual void OnShutdown();
82 84
83 #ifdef IPC_MESSAGE_LOG_ENABLED 85 #ifdef IPC_MESSAGE_LOG_ENABLED
84 virtual void OnSetIPCLoggingEnabled(bool enable); 86 virtual void OnSetIPCLoggingEnabled(bool enable);
85 #endif 87 #endif
86 88
87 IPC::SyncChannel* channel() { return channel_.get(); }
88
89 void set_on_channel_error_called(bool on_channel_error_called) { 89 void set_on_channel_error_called(bool on_channel_error_called) {
90 on_channel_error_called_ = on_channel_error_called; 90 on_channel_error_called_ = on_channel_error_called;
91 } 91 }
92 92
93 private: 93 private:
94 void Init(); 94 void Init();
95 95
96 // IPC::Channel::Listener implementation: 96 // IPC::Channel::Listener implementation:
97 virtual bool OnMessageReceived(const IPC::Message& msg); 97 virtual bool OnMessageReceived(const IPC::Message& msg);
98 virtual void OnChannelError(); 98 virtual void OnChannelError();
(...skipping 27 matching lines...) Expand all
126 scoped_ptr<NotificationService> notification_service_; 126 scoped_ptr<NotificationService> notification_service_;
127 127
128 scoped_ptr<FileSystemDispatcher> file_system_dispatcher_; 128 scoped_ptr<FileSystemDispatcher> file_system_dispatcher_;
129 129
130 scoped_ptr<QuotaDispatcher> quota_dispatcher_; 130 scoped_ptr<QuotaDispatcher> quota_dispatcher_;
131 131
132 DISALLOW_COPY_AND_ASSIGN(ChildThread); 132 DISALLOW_COPY_AND_ASSIGN(ChildThread);
133 }; 133 };
134 134
135 #endif // CONTENT_COMMON_CHILD_THREAD_H_ 135 #endif // CONTENT_COMMON_CHILD_THREAD_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698