OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "chrome/test/chrome_plugin/test_chrome_plugin.h" | 5 #include "chrome/test/chrome_plugin/test_chrome_plugin.h" |
6 | 6 |
7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 return count; | 162 return count; |
163 } | 163 } |
164 | 164 |
165 // CPP Funcs | 165 // CPP Funcs |
166 | 166 |
167 CPError STDCALL CPP_Shutdown() { | 167 CPError STDCALL CPP_Shutdown() { |
168 return CPERR_SUCCESS; | 168 return CPERR_SUCCESS; |
169 } | 169 } |
170 | 170 |
171 CPBool STDCALL CPP_ShouldInterceptRequest(CPRequest* request) { | 171 CPBool STDCALL CPP_ShouldInterceptRequest(CPRequest* request) { |
172 DCHECK(StrNCaseCmp(request->url, kChromeTestPluginProtocol, | 172 DCHECK(base::strncasecmp(request->url, kChromeTestPluginProtocol, |
173 arraysize(kChromeTestPluginProtocol) - 1) == 0); | 173 arraysize(kChromeTestPluginProtocol) - 1) == 0); |
174 return FindPayload(request->url) != NULL; | 174 return FindPayload(request->url) != NULL; |
175 } | 175 } |
176 | 176 |
177 CPError STDCALL CPR_StartRequest(CPRequest* request) { | 177 CPError STDCALL CPR_StartRequest(CPRequest* request) { |
178 const TestResponsePayload* payload = FindPayload(request->url); | 178 const TestResponsePayload* payload = FindPayload(request->url); |
179 DCHECK(payload); | 179 DCHECK(payload); |
180 ResponseStream* stream = new ResponseStream(payload, request); | 180 ResponseStream* stream = new ResponseStream(payload, request); |
181 stream->AddRef(); // Released in CPR_EndRequest | 181 stream->AddRef(); // Released in CPR_EndRequest |
182 stream->Init(); | 182 stream->Init(); |
183 request->pdata = stream; | 183 request->pdata = stream; |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 return CPERR_SUCCESS; | 371 return CPERR_SUCCESS; |
372 } | 372 } |
373 | 373 |
374 int STDCALL CP_Test(void* vparam) { | 374 int STDCALL CP_Test(void* vparam) { |
375 TestFuncParams* param = reinterpret_cast<TestFuncParams*>(vparam); | 375 TestFuncParams* param = reinterpret_cast<TestFuncParams*>(vparam); |
376 param->pfuncs.test_make_request = CPT_MakeRequest; | 376 param->pfuncs.test_make_request = CPT_MakeRequest; |
377 | 377 |
378 g_cptest_funcs = param->bfuncs; | 378 g_cptest_funcs = param->bfuncs; |
379 return CPERR_SUCCESS; | 379 return CPERR_SUCCESS; |
380 } | 380 } |
OLD | NEW |