Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_UI_APP_LIST_ARC_ARC_APP_ICON_H_ | 5 #ifndef CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_ICON_H_ |
| 6 #define CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_ICON_H_ | 6 #define CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_ICON_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 51 // done to avoid two problems. Problems come because icons are decoded at a | 51 // done to avoid two problems. Problems come because icons are decoded at a |
| 52 // separate process created by ImageDecoder. ImageDecoder has 5 seconds delay | 52 // separate process created by ImageDecoder. ImageDecoder has 5 seconds delay |
| 53 // to stop since the last request (see its kBatchModeTimeoutSeconds for more | 53 // to stop since the last request (see its kBatchModeTimeoutSeconds for more |
| 54 // details). This is unacceptably long for unit tests because the test | 54 // details). This is unacceptably long for unit tests because the test |
| 55 // framework waits until external process is finished. Another problem happens | 55 // framework waits until external process is finished. Another problem happens |
| 56 // when we issue a decoding request, but the process has not started its | 56 // when we issue a decoding request, but the process has not started its |
| 57 // processing yet by the time when a test exits. This might cause situation | 57 // processing yet by the time when a test exits. This might cause situation |
| 58 // when g_one_utility_thread_lock from in_process_utility_thread.cc gets | 58 // when g_one_utility_thread_lock from in_process_utility_thread.cc gets |
| 59 // released in an acquired state which is crash condition in debug builds. | 59 // released in an acquired state which is crash condition in debug builds. |
| 60 static void DisableSafeDecodingForTesting(); | 60 static void DisableSafeDecodingForTesting(); |
| 61 | 61 |
|
msw
2017/05/18 22:03:39
optional nit: remove blank line
khmel
2017/05/18 22:40:02
Done.
| |
| 62 static bool IsSafeDecodingDisabledForTesting(); | |
| 63 | |
| 62 private: | 64 private: |
| 63 friend class ArcAppIconLoader; | 65 friend class ArcAppIconLoader; |
| 64 friend class ArcAppModelBuilder; | 66 friend class ArcAppModelBuilder; |
| 65 | 67 |
| 66 class Source; | 68 class Source; |
| 67 class DecodeRequest; | 69 class DecodeRequest; |
| 68 struct ReadResult; | 70 struct ReadResult; |
| 69 | 71 |
| 70 // Icon loading is performed in several steps. It is initiated by | 72 // Icon loading is performed in several steps. It is initiated by |
| 71 // LoadImageForScaleFactor request that specifies a required scale factor. | 73 // LoadImageForScaleFactor request that specifies a required scale factor. |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 103 | 105 |
| 104 // Contains pending image decode requests. | 106 // Contains pending image decode requests. |
| 105 std::vector<std::unique_ptr<DecodeRequest>> decode_requests_; | 107 std::vector<std::unique_ptr<DecodeRequest>> decode_requests_; |
| 106 | 108 |
| 107 base::WeakPtrFactory<ArcAppIcon> weak_ptr_factory_; | 109 base::WeakPtrFactory<ArcAppIcon> weak_ptr_factory_; |
| 108 | 110 |
| 109 DISALLOW_COPY_AND_ASSIGN(ArcAppIcon); | 111 DISALLOW_COPY_AND_ASSIGN(ArcAppIcon); |
| 110 }; | 112 }; |
| 111 | 113 |
| 112 #endif // CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_ICON_H_ | 114 #endif // CHROME_BROWSER_UI_APP_LIST_ARC_ARC_APP_ICON_H_ |
| OLD | NEW |