| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef CHROME_BROWSER_COMPONENT_UPDATER_BACKGROUND_DOWNLOADER_WIN_H_ | 5 #ifndef CHROME_BROWSER_COMPONENT_UPDATER_BACKGROUND_DOWNLOADER_WIN_H_ |
| 6 #define CHROME_BROWSER_COMPONENT_UPDATER_BACKGROUND_DOWNLOADER_WIN_H_ | 6 #define CHROME_BROWSER_COMPONENT_UPDATER_BACKGROUND_DOWNLOADER_WIN_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/component_updater/crx_downloader.h" | 8 #include "chrome/browser/component_updater/crx_downloader.h" |
| 9 | 9 |
| 10 #include <windows.h> | 10 #include <windows.h> |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 // of this class and the CrxDownloader overrides are expected to be called | 21 // of this class and the CrxDownloader overrides are expected to be called |
| 22 // from the UI thread. The rest of the class code runs on the FILE thread in | 22 // from the UI thread. The rest of the class code runs on the FILE thread in |
| 23 // a single threaded apartment. Instances of this class are created and | 23 // a single threaded apartment. Instances of this class are created and |
| 24 // destroyed in the UI thread. See the implementation of the class destructor | 24 // destroyed in the UI thread. See the implementation of the class destructor |
| 25 // for details regarding the clean up of resources acquired in this class. | 25 // for details regarding the clean up of resources acquired in this class. |
| 26 class BackgroundDownloader : public CrxDownloader { | 26 class BackgroundDownloader : public CrxDownloader { |
| 27 protected: | 27 protected: |
| 28 friend class CrxDownloader; | 28 friend class CrxDownloader; |
| 29 BackgroundDownloader(scoped_ptr<CrxDownloader> successor, | 29 BackgroundDownloader(scoped_ptr<CrxDownloader> successor, |
| 30 net::URLRequestContextGetter* context_getter, | 30 net::URLRequestContextGetter* context_getter, |
| 31 scoped_refptr<base::SequencedTaskRunner> task_runner, | 31 scoped_refptr<base::SequencedTaskRunner> task_runner); |
| 32 const DownloadCallback& download_callback); | |
| 33 virtual ~BackgroundDownloader(); | 32 virtual ~BackgroundDownloader(); |
| 34 | 33 |
| 35 private: | 34 private: |
| 36 // Overrides for CrxDownloader. | 35 // Overrides for CrxDownloader. |
| 37 virtual void DoStartDownload(const GURL& url) OVERRIDE; | 36 virtual void DoStartDownload(const GURL& url) OVERRIDE; |
| 38 | 37 |
| 39 // Called asynchronously on the FILE thread at different stages during | 38 // Called asynchronously on the FILE thread at different stages during |
| 40 // the download. |OnDownloading| can be called multiple times. | 39 // the download. |OnDownloading| can be called multiple times. |
| 41 // |EndDownload| switches the execution flow from the FILE to the UI thread. | 40 // |EndDownload| switches the execution flow from the FILE to the UI thread. |
| 42 // Accessing any data members of this object on the FILE thread after | 41 // Accessing any data members of this object on the FILE thread after |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 | 87 |
| 89 bool is_completed_; | 88 bool is_completed_; |
| 90 | 89 |
| 91 DISALLOW_COPY_AND_ASSIGN(BackgroundDownloader); | 90 DISALLOW_COPY_AND_ASSIGN(BackgroundDownloader); |
| 92 }; | 91 }; |
| 93 | 92 |
| 94 } // namespace component_updater | 93 } // namespace component_updater |
| 95 | 94 |
| 96 #endif // CHROME_BROWSER_COMPONENT_UPDATER_BACKGROUND_DOWNLOADER_WIN_H_ | 95 #endif // CHROME_BROWSER_COMPONENT_UPDATER_BACKGROUND_DOWNLOADER_WIN_H_ |
| 97 | 96 |
| OLD | NEW |