OLD | NEW |
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 "chrome_frame/chrome_frame_automation.h" | 5 #include "chrome_frame/chrome_frame_automation.h" |
6 | 6 |
7 #include "app/app_switches.h" | 7 #include "app/app_switches.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 | 72 |
73 // Get AddRef-ed pointer to corresponding TabProxy object | 73 // Get AddRef-ed pointer to corresponding TabProxy object |
74 TabProxy* tab = static_cast<TabProxy*>(tracker_->GetResource( | 74 TabProxy* tab = static_cast<TabProxy*>(tracker_->GetResource( |
75 message.routing_id())); | 75 message.routing_id())); |
76 bool handled = false; | 76 bool handled = false; |
77 if (tab) { | 77 if (tab) { |
78 handled = tab->OnMessageReceived(message); | 78 handled = tab->OnMessageReceived(message); |
79 tab->Release(); | 79 tab->Release(); |
80 } else { | 80 } else { |
81 DLOG(ERROR) << "Failed to find TabProxy for tab:" << message.routing_id(); | 81 DLOG(ERROR) << "Failed to find TabProxy for tab:" << message.routing_id(); |
| 82 // To prevent subsequent crashes, we set handled to true in this case. |
| 83 handled = true; |
82 } | 84 } |
83 return handled; | 85 return handled; |
84 } | 86 } |
85 | 87 |
86 virtual void OnChannelError() { | 88 virtual void OnChannelError() { |
87 std::list<AutomationHandle>::const_iterator iter = tabs_list_.begin(); | 89 std::list<AutomationHandle>::const_iterator iter = tabs_list_.begin(); |
88 for (; iter != tabs_list_.end(); ++iter) { | 90 for (; iter != tabs_list_.end(); ++iter) { |
89 // Get AddRef-ed pointer to corresponding TabProxy object | 91 // Get AddRef-ed pointer to corresponding TabProxy object |
90 TabProxy* tab = static_cast<TabProxy*>(tracker_->GetResource(*iter)); | 92 TabProxy* tab = static_cast<TabProxy*>(tracker_->GetResource(*iter)); |
91 if (tab) { | 93 if (tab) { |
(...skipping 1366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1458 const net::URLRequestStatus& status) { | 1460 const net::URLRequestStatus& status) { |
1459 automation_server_->Send(new AutomationMsg_RequestEnd( | 1461 automation_server_->Send(new AutomationMsg_RequestEnd( |
1460 tab_->handle(), request_id, status)); | 1462 tab_->handle(), request_id, status)); |
1461 } | 1463 } |
1462 | 1464 |
1463 void ChromeFrameAutomationClient::OnCookiesRetrieved(bool success, | 1465 void ChromeFrameAutomationClient::OnCookiesRetrieved(bool success, |
1464 const GURL& url, const std::string& cookie_string, int cookie_id) { | 1466 const GURL& url, const std::string& cookie_string, int cookie_id) { |
1465 automation_server_->Send(new AutomationMsg_GetCookiesHostResponse( | 1467 automation_server_->Send(new AutomationMsg_GetCookiesHostResponse( |
1466 tab_->handle(), success, url, cookie_string, cookie_id)); | 1468 tab_->handle(), success, url, cookie_string, cookie_id)); |
1467 } | 1469 } |
OLD | NEW |