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/urlmon_url_request.h" | 5 #include "chrome_frame/urlmon_url_request.h" |
6 | 6 |
7 #include <wininet.h> | 7 #include <wininet.h> |
8 #include <urlmon.h> | 8 #include <urlmon.h> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1066 } else { | 1066 } else { |
1067 NOTREACHED() << "Cannot handle download if we don't have anyone to hand it " | 1067 NOTREACHED() << "Cannot handle download if we don't have anyone to hand it " |
1068 "to."; | 1068 "to."; |
1069 } | 1069 } |
1070 } | 1070 } |
1071 | 1071 |
1072 void UrlmonUrlRequestManager::BindTerminated(IMoniker* moniker, | 1072 void UrlmonUrlRequestManager::BindTerminated(IMoniker* moniker, |
1073 IBindCtx* bind_ctx, | 1073 IBindCtx* bind_ctx, |
1074 IStream* post_data, | 1074 IStream* post_data, |
1075 const char* request_headers) { | 1075 const char* request_headers) { |
1076 DownloadInHostParams download_params; | 1076 DownloadInHostParams* download_params = new DownloadInHostParams; |
1077 download_params.bind_ctx = bind_ctx; | 1077 download_params->bind_ctx = bind_ctx; |
1078 download_params.moniker = moniker; | 1078 download_params->moniker = moniker; |
1079 download_params.post_data = post_data; | 1079 download_params->post_data = post_data; |
1080 if (request_headers) { | 1080 if (request_headers) { |
1081 download_params.request_headers = request_headers; | 1081 download_params->request_headers = request_headers; |
1082 } | 1082 } |
1083 // We use SendMessage and not PostMessage to make sure that if the | 1083 ::PostMessage(notification_window_, WM_DOWNLOAD_IN_HOST, |
1084 // notification window does not handle the message we won't leak | 1084 reinterpret_cast<WPARAM>(download_params), 0); |
1085 // the moniker. | |
1086 ::SendMessage(notification_window_, WM_DOWNLOAD_IN_HOST, | |
1087 reinterpret_cast<WPARAM>(&download_params), 0); | |
1088 } | 1085 } |
1089 | 1086 |
1090 void UrlmonUrlRequestManager::GetCookiesForUrl(const GURL& url, int cookie_id) { | 1087 void UrlmonUrlRequestManager::GetCookiesForUrl(const GURL& url, int cookie_id) { |
1091 DWORD cookie_size = 0; | 1088 DWORD cookie_size = 0; |
1092 bool success = true; | 1089 bool success = true; |
1093 std::string cookie_string; | 1090 std::string cookie_string; |
1094 | 1091 |
1095 int32 cookie_action = COOKIEACTION_READ; | 1092 int32 cookie_action = COOKIEACTION_READ; |
1096 BOOL result = InternetGetCookieA(url.spec().c_str(), NULL, NULL, | 1093 BOOL result = InternetGetCookieA(url.spec().c_str(), NULL, NULL, |
1097 &cookie_size); | 1094 &cookie_size); |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1260 privacy_info_.privacy_records[UTF8ToWide(url)]; | 1257 privacy_info_.privacy_records[UTF8ToWide(url)]; |
1261 | 1258 |
1262 privacy_entry.flags |= flags; | 1259 privacy_entry.flags |= flags; |
1263 privacy_entry.policy_ref = UTF8ToWide(policy_ref); | 1260 privacy_entry.policy_ref = UTF8ToWide(policy_ref); |
1264 | 1261 |
1265 if (fire_privacy_event && IsWindow(notification_window_)) { | 1262 if (fire_privacy_event && IsWindow(notification_window_)) { |
1266 PostMessage(notification_window_, WM_FIRE_PRIVACY_CHANGE_NOTIFICATION, 1, | 1263 PostMessage(notification_window_, WM_FIRE_PRIVACY_CHANGE_NOTIFICATION, 1, |
1267 0); | 1264 0); |
1268 } | 1265 } |
1269 } | 1266 } |
OLD | NEW |