| 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_CRX_UPDATE_ITEM_H_ | 5 #ifndef CHROME_BROWSER_COMPONENT_UPDATER_CRX_UPDATE_ITEM_H_ |
| 6 #define CHROME_BROWSER_COMPONENT_UPDATER_CRX_UPDATE_ITEM_H_ | 6 #define CHROME_BROWSER_COMPONENT_UPDATER_CRX_UPDATE_ITEM_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/memory/weak_ptr.h" | |
| 13 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 14 #include "base/version.h" | 13 #include "base/version.h" |
| 15 #include "chrome/browser/component_updater/component_updater_service.h" | 14 #include "chrome/browser/component_updater/component_updater_service.h" |
| 16 | 15 |
| 17 class CUResourceThrottle; | |
| 18 | |
| 19 // This is the one and only per-item state structure. Designed to be hosted | 16 // This is the one and only per-item state structure. Designed to be hosted |
| 20 // in a std::vector or a std::list. The two main members are |component| | 17 // in a std::vector or a std::list. The two main members are |component| |
| 21 // which is supplied by the the component updater client and |status| which | 18 // which is supplied by the the component updater client and |status| which |
| 22 // is modified as the item is processed by the update pipeline. The expected | 19 // is modified as the item is processed by the update pipeline. The expected |
| 23 // transition graph is: | 20 // transition graph is: |
| 24 // | 21 // |
| 25 // on-demand on-demand | 22 // on-demand on-demand |
| 26 // +---------------------------> kNew <--------------+-------------+ | 23 // +---------------------------> kNew <--------------+-------------+ |
| 27 // | | | | | 24 // | | | | |
| 28 // | V | | | 25 // | V | | |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 // the |extra_code1| usually contains a system error, but it can contain | 95 // the |extra_code1| usually contains a system error, but it can contain |
| 99 // any extended information that is relevant to either the category or the | 96 // any extended information that is relevant to either the category or the |
| 100 // error itself. | 97 // error itself. |
| 101 int error_category; | 98 int error_category; |
| 102 int error_code; | 99 int error_code; |
| 103 int extra_code1; | 100 int extra_code1; |
| 104 int diff_error_category; | 101 int diff_error_category; |
| 105 int diff_error_code; | 102 int diff_error_code; |
| 106 int diff_extra_code1; | 103 int diff_extra_code1; |
| 107 | 104 |
| 108 std::vector<base::WeakPtr<CUResourceThrottle> > throttles; | |
| 109 | |
| 110 CrxUpdateItem(); | 105 CrxUpdateItem(); |
| 111 ~CrxUpdateItem(); | 106 ~CrxUpdateItem(); |
| 112 | 107 |
| 113 // Function object used to find a specific component. | 108 // Function object used to find a specific component. |
| 114 class FindById { | 109 class FindById { |
| 115 public: | 110 public: |
| 116 explicit FindById(const std::string& id) : id_(id) {} | 111 explicit FindById(const std::string& id) : id_(id) {} |
| 117 | 112 |
| 118 bool operator() (CrxUpdateItem* item) const { | 113 bool operator() (CrxUpdateItem* item) const { |
| 119 return (item->id == id_); | 114 return (item->id == id_); |
| 120 } | 115 } |
| 121 private: | 116 private: |
| 122 const std::string& id_; | 117 const std::string& id_; |
| 123 }; | 118 }; |
| 124 }; | 119 }; |
| 125 | 120 |
| 126 #endif // CHROME_BROWSER_COMPONENT_UPDATER_CRX_UPDATE_ITEM_H_ | 121 #endif // CHROME_BROWSER_COMPONENT_UPDATER_CRX_UPDATE_ITEM_H_ |
| OLD | NEW |