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 18 matching lines...) Expand all Loading... |
29 scoped_refptr<base::SequencedTaskRunner> task_runner, | 29 scoped_refptr<base::SequencedTaskRunner> task_runner, |
30 const DownloadCallback& download_callback); | 30 const DownloadCallback& download_callback); |
31 virtual ~BackgroundDownloader(); | 31 virtual ~BackgroundDownloader(); |
32 | 32 |
33 private: | 33 private: |
34 // Overrides for CrxDownloader. | 34 // Overrides for CrxDownloader. |
35 virtual void DoStartDownload(const GURL& url) OVERRIDE; | 35 virtual void DoStartDownload(const GURL& url) OVERRIDE; |
36 | 36 |
37 // Called asynchronously on the FILE thread at different stages during | 37 // Called asynchronously on the FILE thread at different stages during |
38 // the download. |OnDownloading| can be called multiple times. | 38 // the download. |OnDownloading| can be called multiple times. |
| 39 // |EndDownload| switches the execution flow from the FILE to the UI thread. |
| 40 // Accessing any data members of this object on the FILE thread after |
| 41 // calling |EndDownload| is unsafe. |
39 void BeginDownload(const GURL& url); | 42 void BeginDownload(const GURL& url); |
40 void OnDownloading(); | 43 void OnDownloading(); |
41 void EndDownload(HRESULT hr); | 44 void EndDownload(HRESULT hr); |
42 | 45 |
43 // Handles the job state transitions to a final state. | 46 // Handles the job state transitions to a final state. |
44 void OnStateTransferred(); | 47 void OnStateTransferred(); |
45 void OnStateError(); | 48 void OnStateError(); |
46 void OnStateCancelled(); | 49 void OnStateCancelled(); |
47 void OnStateAcknowledged(); | 50 void OnStateAcknowledged(); |
48 | 51 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 83 |
81 bool is_completed_; | 84 bool is_completed_; |
82 | 85 |
83 DISALLOW_COPY_AND_ASSIGN(BackgroundDownloader); | 86 DISALLOW_COPY_AND_ASSIGN(BackgroundDownloader); |
84 }; | 87 }; |
85 | 88 |
86 } // namespace component_updater | 89 } // namespace component_updater |
87 | 90 |
88 #endif // CHROME_BROWSER_COMPONENT_UPDATER_BACKGROUND_DOWNLOADER_WIN_H_ | 91 #endif // CHROME_BROWSER_COMPONENT_UPDATER_BACKGROUND_DOWNLOADER_WIN_H_ |
89 | 92 |
OLD | NEW |