| OLD | NEW |
| 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 #include <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/process_util.h" | 9 #include "base/process_util.h" |
| 10 #include "chrome/common/render_messages.h" | 10 #include "chrome/common/render_messages.h" |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 | 123 |
| 124 // This class forwards the incoming messages to the ResourceDispatcherHostTest. | 124 // This class forwards the incoming messages to the ResourceDispatcherHostTest. |
| 125 // This is used to emulate different sub-processes, since this filter will | 125 // This is used to emulate different sub-processes, since this filter will |
| 126 // have a different ID than the original. For the test, we want all the incoming | 126 // have a different ID than the original. For the test, we want all the incoming |
| 127 // messages to go to the same place, which is why this forwards. | 127 // messages to go to the same place, which is why this forwards. |
| 128 class ForwardingFilter : public ResourceMessageFilter { | 128 class ForwardingFilter : public ResourceMessageFilter { |
| 129 public: | 129 public: |
| 130 explicit ForwardingFilter(IPC::Message::Sender* dest) | 130 explicit ForwardingFilter(IPC::Message::Sender* dest) |
| 131 : ResourceMessageFilter(ChildProcessInfo::GenerateChildProcessUniqueId(), | 131 : ResourceMessageFilter(ChildProcessInfo::GenerateChildProcessUniqueId(), |
| 132 ChildProcessInfo::RENDER_PROCESS, | 132 ChildProcessInfo::RENDER_PROCESS, |
| 133 NULL, |
| 133 NULL), | 134 NULL), |
| 134 dest_(dest) { | 135 dest_(dest) { |
| 135 OnChannelConnected(base::GetCurrentProcId()); | 136 OnChannelConnected(base::GetCurrentProcId()); |
| 136 } | 137 } |
| 137 | 138 |
| 138 // ResourceMessageFilter override | 139 // ResourceMessageFilter override |
| 139 virtual bool Send(IPC::Message* msg) { | 140 virtual bool Send(IPC::Message* msg) { |
| 140 if (!dest_) | 141 if (!dest_) |
| 141 return false; | 142 return false; |
| 142 return dest_->Send(msg); | 143 return dest_->Send(msg); |
| (...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1004 const net::URLRequestStatus& status, | 1005 const net::URLRequestStatus& status, |
| 1005 const std::string& info) { | 1006 const std::string& info) { |
| 1006 return true; | 1007 return true; |
| 1007 } | 1008 } |
| 1008 | 1009 |
| 1009 void OnRequestClosed() {} | 1010 void OnRequestClosed() {} |
| 1010 | 1011 |
| 1011 private: | 1012 private: |
| 1012 DISALLOW_COPY_AND_ASSIGN(DummyResourceHandler); | 1013 DISALLOW_COPY_AND_ASSIGN(DummyResourceHandler); |
| 1013 }; | 1014 }; |
| OLD | NEW |