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/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 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1096 // Either directly call appropriate url_fetcher function | 1096 // Either directly call appropriate url_fetcher function |
1097 // or postpone call to the UI thread. | 1097 // or postpone call to the UI thread. |
1098 uint16 msg_type = msg.type(); | 1098 uint16 msg_type = msg.type(); |
1099 switch (msg_type) { | 1099 switch (msg_type) { |
1100 default: | 1100 default: |
1101 return false; | 1101 return false; |
1102 | 1102 |
1103 case AutomationMsg_RequestStart::ID: | 1103 case AutomationMsg_RequestStart::ID: |
1104 if (ui_thread || (url_fetcher_flags_ & | 1104 if (ui_thread || (url_fetcher_flags_ & |
1105 PluginUrlRequestManager::START_REQUEST_THREADSAFE)) { | 1105 PluginUrlRequestManager::START_REQUEST_THREADSAFE)) { |
1106 AutomationMsg_RequestStart::Dispatch(&msg, url_fetcher_, | 1106 AutomationMsg_RequestStart::Dispatch(&msg, url_fetcher_, this, |
1107 &PluginUrlRequestManager::StartUrlRequest); | 1107 &PluginUrlRequestManager::StartUrlRequest); |
1108 return true; | 1108 return true; |
1109 } | 1109 } |
1110 break; | 1110 break; |
1111 | 1111 |
1112 case AutomationMsg_RequestRead::ID: | 1112 case AutomationMsg_RequestRead::ID: |
1113 if (ui_thread || (url_fetcher_flags_ & | 1113 if (ui_thread || (url_fetcher_flags_ & |
1114 PluginUrlRequestManager::READ_REQUEST_THREADSAFE)) { | 1114 PluginUrlRequestManager::READ_REQUEST_THREADSAFE)) { |
1115 AutomationMsg_RequestRead::Dispatch(&msg, url_fetcher_, | 1115 AutomationMsg_RequestRead::Dispatch(&msg, url_fetcher_, this, |
1116 &PluginUrlRequestManager::ReadUrlRequest); | 1116 &PluginUrlRequestManager::ReadUrlRequest); |
1117 return true; | 1117 return true; |
1118 } | 1118 } |
1119 break; | 1119 break; |
1120 | 1120 |
1121 case AutomationMsg_RequestEnd::ID: | 1121 case AutomationMsg_RequestEnd::ID: |
1122 if (ui_thread || (url_fetcher_flags_ & | 1122 if (ui_thread || (url_fetcher_flags_ & |
1123 PluginUrlRequestManager::STOP_REQUEST_THREADSAFE)) { | 1123 PluginUrlRequestManager::STOP_REQUEST_THREADSAFE)) { |
1124 AutomationMsg_RequestEnd::Dispatch(&msg, url_fetcher_, | 1124 AutomationMsg_RequestEnd::Dispatch(&msg, url_fetcher_, this, |
1125 &PluginUrlRequestManager::EndUrlRequest); | 1125 &PluginUrlRequestManager::EndUrlRequest); |
1126 return true; | 1126 return true; |
1127 } | 1127 } |
1128 break; | 1128 break; |
1129 | 1129 |
1130 case AutomationMsg_DownloadRequestInHost::ID: | 1130 case AutomationMsg_DownloadRequestInHost::ID: |
1131 if (ui_thread || (url_fetcher_flags_ & | 1131 if (ui_thread || (url_fetcher_flags_ & |
1132 PluginUrlRequestManager::DOWNLOAD_REQUEST_THREADSAFE)) { | 1132 PluginUrlRequestManager::DOWNLOAD_REQUEST_THREADSAFE)) { |
1133 AutomationMsg_DownloadRequestInHost::Dispatch(&msg, url_fetcher_, | 1133 AutomationMsg_DownloadRequestInHost::Dispatch(&msg, url_fetcher_, this, |
1134 &PluginUrlRequestManager::DownloadUrlRequestInHost); | 1134 &PluginUrlRequestManager::DownloadUrlRequestInHost); |
1135 return true; | 1135 return true; |
1136 } | 1136 } |
1137 break; | 1137 break; |
1138 | 1138 |
1139 case AutomationMsg_GetCookiesFromHost::ID: | 1139 case AutomationMsg_GetCookiesFromHost::ID: |
1140 if (ui_thread || (url_fetcher_flags_ & | 1140 if (ui_thread || (url_fetcher_flags_ & |
1141 PluginUrlRequestManager::COOKIE_REQUEST_THREADSAFE)) { | 1141 PluginUrlRequestManager::COOKIE_REQUEST_THREADSAFE)) { |
1142 AutomationMsg_GetCookiesFromHost::Dispatch(&msg, url_fetcher_, | 1142 AutomationMsg_GetCookiesFromHost::Dispatch(&msg, url_fetcher_, this, |
1143 &PluginUrlRequestManager::GetCookiesFromHost); | 1143 &PluginUrlRequestManager::GetCookiesFromHost); |
1144 return true; | 1144 return true; |
1145 } | 1145 } |
1146 break; | 1146 break; |
1147 | 1147 |
1148 case AutomationMsg_SetCookieAsync::ID: | 1148 case AutomationMsg_SetCookieAsync::ID: |
1149 if (ui_thread || (url_fetcher_flags_ & | 1149 if (ui_thread || (url_fetcher_flags_ & |
1150 PluginUrlRequestManager::COOKIE_REQUEST_THREADSAFE)) { | 1150 PluginUrlRequestManager::COOKIE_REQUEST_THREADSAFE)) { |
1151 AutomationMsg_SetCookieAsync::Dispatch(&msg, url_fetcher_, | 1151 AutomationMsg_SetCookieAsync::Dispatch(&msg, url_fetcher_, this, |
1152 &PluginUrlRequestManager::SetCookiesInHost); | 1152 &PluginUrlRequestManager::SetCookiesInHost); |
1153 return true; | 1153 return true; |
1154 } | 1154 } |
1155 break; | 1155 break; |
1156 } | 1156 } |
1157 | 1157 |
1158 PostTask(FROM_HERE, NewRunnableMethod(this, | 1158 PostTask(FROM_HERE, NewRunnableMethod(this, |
1159 &ChromeFrameAutomationClient::ProcessUrlRequestMessage, tab, msg, true)); | 1159 &ChromeFrameAutomationClient::ProcessUrlRequestMessage, tab, msg, true)); |
1160 return true; | 1160 return true; |
1161 } | 1161 } |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1453 const URLRequestStatus& status) { | 1453 const URLRequestStatus& status) { |
1454 automation_server_->Send(new AutomationMsg_RequestEnd(0, tab_->handle(), | 1454 automation_server_->Send(new AutomationMsg_RequestEnd(0, tab_->handle(), |
1455 request_id, status)); | 1455 request_id, status)); |
1456 } | 1456 } |
1457 | 1457 |
1458 void ChromeFrameAutomationClient::OnCookiesRetrieved(bool success, | 1458 void ChromeFrameAutomationClient::OnCookiesRetrieved(bool success, |
1459 const GURL& url, const std::string& cookie_string, int cookie_id) { | 1459 const GURL& url, const std::string& cookie_string, int cookie_id) { |
1460 automation_server_->Send(new AutomationMsg_GetCookiesHostResponse(0, | 1460 automation_server_->Send(new AutomationMsg_GetCookiesHostResponse(0, |
1461 tab_->handle(), success, url, cookie_string, cookie_id)); | 1461 tab_->handle(), success, url, cookie_string, cookie_id)); |
1462 } | 1462 } |
OLD | NEW |