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

Side by Side Diff: content/public/test/mock_render_thread.cc

Issue 10854245: In-te-grate hy-phen-ator to con-tent. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 3 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
« no previous file with comments | « content/public/test/mock_render_thread.h ('k') | content/renderer/hyphenator/hyphenator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "content/public/test/mock_render_thread.h" 5 #include "content/public/test/mock_render_thread.h"
6 6
7 #include "base/process_util.h" 7 #include "base/process_util.h"
8 #include "base/message_loop_proxy.h" 8 #include "base/message_loop_proxy.h"
9 #include "content/common/view_messages.h" 9 #include "content/common/view_messages.h"
10 #include "ipc/ipc_message_utils.h" 10 #include "ipc/ipc_message_utils.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 widget_ = NULL; 91 widget_ = NULL;
92 } 92 }
93 93
94 int MockRenderThread::GenerateRoutingID() { 94 int MockRenderThread::GenerateRoutingID() {
95 NOTREACHED(); 95 NOTREACHED();
96 return MSG_ROUTING_NONE; 96 return MSG_ROUTING_NONE;
97 } 97 }
98 98
99 void MockRenderThread::AddFilter(IPC::ChannelProxy::MessageFilter* filter) { 99 void MockRenderThread::AddFilter(IPC::ChannelProxy::MessageFilter* filter) {
100 filter->OnFilterAdded(&sink()); 100 filter->OnFilterAdded(&sink());
101 // Add this filter to a vector so the MockRenderThread::RemoveFilter function
102 // can check if this filter is added.
103 filters_.push_back(make_scoped_refptr(filter));
101 } 104 }
102 105
103 void MockRenderThread::RemoveFilter(IPC::ChannelProxy::MessageFilter* filter) { 106 void MockRenderThread::RemoveFilter(IPC::ChannelProxy::MessageFilter* filter) {
104 filter->OnFilterRemoved(); 107 // Emulate the IPC::ChannelProxy::OnRemoveFilter function.
108 for (size_t i = 0; i < filters_.size(); ++i) {
109 if (filters_[i].get() == filter) {
110 filter->OnFilterRemoved();
111 filters_.erase(filters_.begin() + i);
112 return;
113 }
114 }
115 NOTREACHED() << "filter to be removed not found";
105 } 116 }
106 117
107 void MockRenderThread::SetOutgoingMessageFilter( 118 void MockRenderThread::SetOutgoingMessageFilter(
108 IPC::ChannelProxy::OutgoingMessageFilter* filter) { 119 IPC::ChannelProxy::OutgoingMessageFilter* filter) {
109 } 120 }
110 121
111 void MockRenderThread::AddObserver(content::RenderProcessObserver* observer) { 122 void MockRenderThread::AddObserver(content::RenderProcessObserver* observer) {
112 } 123 }
113 124
114 void MockRenderThread::RemoveObserver( 125 void MockRenderThread::RemoveObserver(
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 void MockRenderThread::OnDuplicateSection( 230 void MockRenderThread::OnDuplicateSection(
220 base::SharedMemoryHandle renderer_handle, 231 base::SharedMemoryHandle renderer_handle,
221 base::SharedMemoryHandle* browser_handle) { 232 base::SharedMemoryHandle* browser_handle) {
222 // We don't have to duplicate the input handles since RenderViewTest does not 233 // We don't have to duplicate the input handles since RenderViewTest does not
223 // separate a browser process from a renderer process. 234 // separate a browser process from a renderer process.
224 *browser_handle = renderer_handle; 235 *browser_handle = renderer_handle;
225 } 236 }
226 #endif // defined(OS_WIN) 237 #endif // defined(OS_WIN)
227 238
228 } // namespace content 239 } // namespace content
OLDNEW
« no previous file with comments | « content/public/test/mock_render_thread.h ('k') | content/renderer/hyphenator/hyphenator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698