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

Side by Side Diff: content/browser/renderer_host/resource_dispatcher_host_unittest.cc

Issue 6825038: Create a content::ResourceContext. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Oops, inverted the assertions. Created 9 years, 8 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 #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
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
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 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698