| 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_item_impl.h" | 5 #include "content/browser/download/download_item_impl.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 841 GetStartTime(), | 841 GetStartTime(), |
| 842 GetEndTime(), | 842 GetEndTime(), |
| 843 GetReceivedBytes(), | 843 GetReceivedBytes(), |
| 844 GetTotalBytes(), | 844 GetTotalBytes(), |
| 845 GetState(), | 845 GetState(), |
| 846 GetDbHandle(), | 846 GetDbHandle(), |
| 847 GetOpened()); | 847 GetOpened()); |
| 848 } | 848 } |
| 849 | 849 |
| 850 WebContents* DownloadItemImpl::GetWebContents() const { | 850 WebContents* DownloadItemImpl::GetWebContents() const { |
| 851 // TODO(rdsmith): Remove null check after removing GetTabContents() from | 851 // TODO(rdsmith): Remove null check after removing GetWebContents() from |
| 852 // paths that might be used by DownloadItems created from history import. | 852 // paths that might be used by DownloadItems created from history import. |
| 853 // Currently such items have null request_handle_s, where other items | 853 // Currently such items have null request_handle_s, where other items |
| 854 // (regular and SavePackage downloads) have actual objects off the pointer. | 854 // (regular and SavePackage downloads) have actual objects off the pointer. |
| 855 if (request_handle_.get()) | 855 if (request_handle_.get()) |
| 856 return request_handle_->GetWebContents(); | 856 return request_handle_->GetWebContents(); |
| 857 return NULL; | 857 return NULL; |
| 858 } | 858 } |
| 859 | 859 |
| 860 content::BrowserContext* DownloadItemImpl::GetBrowserContext() const { | 860 content::BrowserContext* DownloadItemImpl::GetBrowserContext() const { |
| 861 return delegate_->GetBrowserContext(); | 861 return delegate_->GetBrowserContext(); |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1153 std::map<const void*, ExternalData*>::iterator it = | 1153 std::map<const void*, ExternalData*>::iterator it = |
| 1154 external_data_map_.find(key); | 1154 external_data_map_.find(key); |
| 1155 | 1155 |
| 1156 if (it == external_data_map_.end()) { | 1156 if (it == external_data_map_.end()) { |
| 1157 external_data_map_[key] = data; | 1157 external_data_map_[key] = data; |
| 1158 } else if (it->second != data) { | 1158 } else if (it->second != data) { |
| 1159 delete it->second; | 1159 delete it->second; |
| 1160 it->second = data; | 1160 it->second = data; |
| 1161 } | 1161 } |
| 1162 } | 1162 } |
| OLD | NEW |