| 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 // Web request notifier implementation. | 5 // Web request notifier implementation. |
| 6 #include "ceee/ie/plugin/bho/webrequest_notifier.h" | 6 #include "ceee/ie/plugin/bho/webrequest_notifier.h" |
| 7 | 7 |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
| 10 #include "chrome_frame/function_stub.h" | 10 #include "chrome_frame/function_stub.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 const char kHttpSendRequestAFunctionName[] = "HttpSendRequestA"; | 25 const char kHttpSendRequestAFunctionName[] = "HttpSendRequestA"; |
| 26 const char kHttpSendRequestWFunctionName[] = "HttpSendRequestW"; | 26 const char kHttpSendRequestWFunctionName[] = "HttpSendRequestW"; |
| 27 const char kInternetReadFileFunctionName[] = "InternetReadFile"; | 27 const char kInternetReadFileFunctionName[] = "InternetReadFile"; |
| 28 | 28 |
| 29 } // namespace | 29 } // namespace |
| 30 | 30 |
| 31 WebRequestNotifier::WebRequestNotifier() | 31 WebRequestNotifier::WebRequestNotifier() |
| 32 : internet_status_callback_stub_(NULL), | 32 : internet_status_callback_stub_(NULL), |
| 33 start_count_(0), | 33 start_count_(0), |
| 34 initialize_state_(NOT_INITIALIZED), | 34 initialize_state_(NOT_INITIALIZED), |
| 35 webrequest_events_funnel_(new BrokerRpcClient(true)) { | 35 broker_rpc_client_(true), |
| 36 webrequest_events_funnel_(&broker_rpc_client_) { |
| 37 HRESULT hr = broker_rpc_client_.Connect(true); |
| 38 DCHECK(SUCCEEDED(hr)); |
| 36 } | 39 } |
| 37 | 40 |
| 38 WebRequestNotifier::~WebRequestNotifier() { | 41 WebRequestNotifier::~WebRequestNotifier() { |
| 39 DCHECK_EQ(start_count_, 0); | 42 DCHECK_EQ(start_count_, 0); |
| 40 } | 43 } |
| 41 | 44 |
| 42 bool WebRequestNotifier::RequestToStart() { | 45 bool WebRequestNotifier::RequestToStart() { |
| 43 { | 46 { |
| 44 CComCritSecLock<CComAutoCriticalSection> lock(critical_section_); | 47 CComCritSecLock<CComAutoCriticalSection> lock(critical_section_); |
| 45 start_count_++; | 48 start_count_++; |
| (...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 803 NOTREACHED(); | 806 NOTREACHED(); |
| 804 break; | 807 break; |
| 805 } | 808 } |
| 806 | 809 |
| 807 if (fire_on_error_occurred) { | 810 if (fire_on_error_occurred) { |
| 808 webrequest_events_funnel().OnErrorOccurred( | 811 webrequest_events_funnel().OnErrorOccurred( |
| 809 info->id, info->url.c_str(), L"", base::Time::Now()); | 812 info->id, info->url.c_str(), L"", base::Time::Now()); |
| 810 } | 813 } |
| 811 info->state = next_state; | 814 info->state = next_state; |
| 812 } | 815 } |
| OLD | NEW |