| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/download/download_resource_handler.h" | 5 #include "content/browser/download/download_resource_handler.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 } | 99 } |
| 100 | 100 |
| 101 void DeleteOnUIThread( | 101 void DeleteOnUIThread( |
| 102 std::unique_ptr<DownloadResourceHandler::DownloadTabInfo> tab_info) {} | 102 std::unique_ptr<DownloadResourceHandler::DownloadTabInfo> tab_info) {} |
| 103 | 103 |
| 104 } // namespace | 104 } // namespace |
| 105 | 105 |
| 106 DownloadResourceHandler::DownloadResourceHandler(net::URLRequest* request) | 106 DownloadResourceHandler::DownloadResourceHandler(net::URLRequest* request) |
| 107 : ResourceHandler(request), | 107 : ResourceHandler(request), |
| 108 tab_info_(new DownloadTabInfo()), | 108 tab_info_(new DownloadTabInfo()), |
| 109 core_(request, this) { | 109 core_(request, this, false) { |
| 110 // Do UI thread initialization for tab_info_ asap after | 110 // Do UI thread initialization for tab_info_ asap after |
| 111 // DownloadResourceHandler creation since the tab could be navigated | 111 // DownloadResourceHandler creation since the tab could be navigated |
| 112 // before StartOnUIThread gets called. This is safe because deletion | 112 // before StartOnUIThread gets called. This is safe because deletion |
| 113 // will occur via PostTask() as well, which will serialized behind this | 113 // will occur via PostTask() as well, which will serialized behind this |
| 114 // PostTask() | 114 // PostTask() |
| 115 const ResourceRequestInfoImpl* request_info = GetRequestInfo(); | 115 const ResourceRequestInfoImpl* request_info = GetRequestInfo(); |
| 116 BrowserThread::PostTask( | 116 BrowserThread::PostTask( |
| 117 BrowserThread::UI, FROM_HERE, | 117 BrowserThread::UI, FROM_HERE, |
| 118 base::Bind( | 118 base::Bind( |
| 119 &InitializeDownloadTabInfoOnUIThread, | 119 &InitializeDownloadTabInfoOnUIThread, |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 " }", | 282 " }", |
| 283 request() ? | 283 request() ? |
| 284 request()->url().spec().c_str() : | 284 request()->url().spec().c_str() : |
| 285 "<NULL request>", | 285 "<NULL request>", |
| 286 info->GetChildID(), | 286 info->GetChildID(), |
| 287 info->GetRequestID(), | 287 info->GetRequestID(), |
| 288 info->GetRouteID()); | 288 info->GetRouteID()); |
| 289 } | 289 } |
| 290 | 290 |
| 291 } // namespace content | 291 } // namespace content |
| OLD | NEW |