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 broker_rpc_client_(true), | 35 webrequest_events_funnel_(new BrokerRpcClient(true)) { |
36 webrequest_events_funnel_(&broker_rpc_client_) { | |
37 HRESULT hr = broker_rpc_client_.Connect(true); | |
38 DCHECK(SUCCEEDED(hr)); | |
39 } | 36 } |
40 | 37 |
41 WebRequestNotifier::~WebRequestNotifier() { | 38 WebRequestNotifier::~WebRequestNotifier() { |
42 DCHECK_EQ(start_count_, 0); | 39 DCHECK_EQ(start_count_, 0); |
43 } | 40 } |
44 | 41 |
45 bool WebRequestNotifier::RequestToStart() { | 42 bool WebRequestNotifier::RequestToStart() { |
46 { | 43 { |
47 CComCritSecLock<CComAutoCriticalSection> lock(critical_section_); | 44 CComCritSecLock<CComAutoCriticalSection> lock(critical_section_); |
48 start_count_++; | 45 start_count_++; |
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
806 NOTREACHED(); | 803 NOTREACHED(); |
807 break; | 804 break; |
808 } | 805 } |
809 | 806 |
810 if (fire_on_error_occurred) { | 807 if (fire_on_error_occurred) { |
811 webrequest_events_funnel().OnErrorOccurred( | 808 webrequest_events_funnel().OnErrorOccurred( |
812 info->id, info->url.c_str(), L"", base::Time::Now()); | 809 info->id, info->url.c_str(), L"", base::Time::Now()); |
813 } | 810 } |
814 info->state = next_state; | 811 info->state = next_state; |
815 } | 812 } |
OLD | NEW |