OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_frame/npapi_url_request.h" | 5 #include "chrome_frame/npapi_url_request.h" |
6 | 6 |
7 #include "base/string_number_conversions.h" | 7 #include "base/string_number_conversions.h" |
8 #include "base/threading/platform_thread.h" | 8 #include "base/threading/platform_thread.h" |
9 #include "chrome_frame/np_browser_functions.h" | 9 #include "chrome_frame/np_browser_functions.h" |
10 #include "chrome_frame/np_utils.h" | 10 #include "chrome_frame/np_utils.h" |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 void NPAPIUrlRequestManager::UrlNotify(const char* url, NPReason reason, | 411 void NPAPIUrlRequestManager::UrlNotify(const char* url, NPReason reason, |
412 void* notify_data) { | 412 void* notify_data) { |
413 NPAPIUrlRequest* request = RequestFromNotifyData(notify_data); | 413 NPAPIUrlRequest* request = RequestFromNotifyData(notify_data); |
414 DCHECK(request != NULL); | 414 DCHECK(request != NULL); |
415 if (request) { | 415 if (request) { |
416 request->Stop(); | 416 request->Stop(); |
417 request->Release(); | 417 request->Release(); |
418 } | 418 } |
419 } | 419 } |
420 | 420 |
| 421 void NPAPIUrlRequestManager::UrlRedirectNotify(const char* url, int status, |
| 422 void* notify_data) { |
| 423 NPAPIUrlRequest* request = RequestFromNotifyData(notify_data); |
| 424 if (request) { |
| 425 delegate_->OnResponseStarted(request->id(), "", "", 0, base::Time(), |
| 426 url, status); |
| 427 } else { |
| 428 NOTREACHED() << "Received unexpected redirect notification for url:" |
| 429 << url; |
| 430 } |
| 431 } |
| 432 |
421 scoped_refptr<NPAPIUrlRequest> NPAPIUrlRequestManager::LookupRequest( | 433 scoped_refptr<NPAPIUrlRequest> NPAPIUrlRequestManager::LookupRequest( |
422 int request_id) { | 434 int request_id) { |
423 RequestMap::iterator index = request_map_.find(request_id); | 435 RequestMap::iterator index = request_map_.find(request_id); |
424 if (index != request_map_.end()) | 436 if (index != request_map_.end()) |
425 return index->second; | 437 return index->second; |
426 return NULL; | 438 return NULL; |
427 } | 439 } |
OLD | NEW |