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 "chrome/browser/image_decoder.h" | 5 #include "chrome/browser/image_decoder.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
12 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
13 #include "chrome/common/image_decoder.mojom.h" | 13 #include "chrome/common/image_decoder.mojom.h" |
14 #include "chrome/grit/generated_resources.h" | 14 #include "chrome/grit/generated_resources.h" |
15 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
16 #include "content/public/browser/utility_process_host.h" | 16 #include "content/public/browser/utility_process_host.h" |
17 #include "services/shell/public/cpp/interface_provider.h" | 17 #include "services/service_manager/public/cpp/interface_provider.h" |
18 #include "third_party/skia/include/core/SkBitmap.h" | 18 #include "third_party/skia/include/core/SkBitmap.h" |
19 #include "ui/base/l10n/l10n_util.h" | 19 #include "ui/base/l10n/l10n_util.h" |
20 | 20 |
21 using content::BrowserThread; | 21 using content::BrowserThread; |
22 using content::UtilityProcessHost; | 22 using content::UtilityProcessHost; |
23 | 23 |
24 namespace { | 24 namespace { |
25 | 25 |
26 // static, Leaky to allow access from any thread. | 26 // static, Leaky to allow access from any thread. |
27 base::LazyInstance<ImageDecoder>::Leaky g_decoder = LAZY_INSTANCE_INITIALIZER; | 27 base::LazyInstance<ImageDecoder>::Leaky g_decoder = LAZY_INSTANCE_INITIALIZER; |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 auto it = image_request_id_map_.find(request_id); | 314 auto it = image_request_id_map_.find(request_id); |
315 if (it == image_request_id_map_.end()) | 315 if (it == image_request_id_map_.end()) |
316 return; | 316 return; |
317 image_request = it->second; | 317 image_request = it->second; |
318 image_request_id_map_.erase(it); | 318 image_request_id_map_.erase(it); |
319 } | 319 } |
320 | 320 |
321 DCHECK(image_request->task_runner()->RunsTasksOnCurrentThread()); | 321 DCHECK(image_request->task_runner()->RunsTasksOnCurrentThread()); |
322 image_request->OnDecodeImageFailed(); | 322 image_request->OnDecodeImageFailed(); |
323 } | 323 } |
OLD | NEW |