| 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 "content/common/child_process_host_impl.h" | 5 #include "content/common/child_process_host_impl.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/atomic_sequence_num.h" | 9 #include "base/atomic_sequence_num.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 #include "ipc/ipc_channel.h" | 31 #include "ipc/ipc_channel.h" |
| 32 #include "ipc/ipc_logging.h" | 32 #include "ipc/ipc_logging.h" |
| 33 #include "ipc/message_filter.h" | 33 #include "ipc/message_filter.h" |
| 34 | 34 |
| 35 #if defined(OS_LINUX) | 35 #if defined(OS_LINUX) |
| 36 #include "base/linux_util.h" | 36 #include "base/linux_util.h" |
| 37 #elif defined(OS_WIN) | 37 #elif defined(OS_WIN) |
| 38 #include "content/common/font_cache_dispatcher_win.h" | 38 #include "content/common/font_cache_dispatcher_win.h" |
| 39 #endif // OS_LINUX | 39 #endif // OS_LINUX |
| 40 | 40 |
| 41 #include "content/public/common/image_decoder.mojom.h" |
| 42 |
| 41 namespace { | 43 namespace { |
| 42 | 44 |
| 43 // Global atomic to generate child process unique IDs. | 45 // Global atomic to generate child process unique IDs. |
| 44 base::StaticAtomicSequenceNumber g_unique_id; | 46 base::StaticAtomicSequenceNumber g_unique_id; |
| 45 | 47 |
| 48 class ImageDecoderImpl : public content::mojom::ImageDecoder { |
| 49 public: |
| 50 ImageDecoderImpl() {} |
| 51 ~ImageDecoderImpl() override {} |
| 52 |
| 53 void DecodeImage(mojo::Array<uint8_t> encoded_data, |
| 54 content::mojom::ImageCodec codec, |
| 55 bool shrink_to_fit, |
| 56 const DecodeImageCallback& callback) override { |
| 57 } |
| 58 void DecodeImage2(content::mojom::ImageCodec codec, |
| 59 bool shrink_to_fit, |
| 60 const DecodeImage2Callback& callback) override { |
| 61 } |
| 62 void DecodeImage3(mojo::Array<uint8_t> encoded_data, |
| 63 bool shrink_to_fit, |
| 64 const DecodeImage3Callback& callback) override { |
| 65 } |
| 66 void DecodeImage4(mojo::Array<uint8_t> encoded_data, |
| 67 content::mojom::ImageCodec codec, |
| 68 const DecodeImage4Callback& callback) override { |
| 69 } |
| 70 |
| 71 void DecodeImage5(mojo::Array<uint8_t> encoded_data, |
| 72 content::mojom::ImageCodec codec, |
| 73 bool shrink_to_fit, |
| 74 const DecodeImage5Callback& callback) override { |
| 75 } |
| 76 void DecodeImage6(mojo::Array<uint8_t> encoded_data, |
| 77 content::mojom::ImageCodec codec, |
| 78 bool shrink_to_fit, |
| 79 const DecodeImage6Callback& callback) override { |
| 80 } |
| 81 }; |
| 82 |
| 46 } // namespace | 83 } // namespace |
| 47 | 84 |
| 48 namespace content { | 85 namespace content { |
| 49 | 86 |
| 50 int ChildProcessHost::kInvalidUniqueID = -1; | 87 int ChildProcessHost::kInvalidUniqueID = -1; |
| 51 | 88 |
| 52 uint64_t ChildProcessHost::kBrowserTracingProcessId = | 89 uint64_t ChildProcessHost::kBrowserTracingProcessId = |
| 53 std::numeric_limits<uint64_t>::max(); | 90 std::numeric_limits<uint64_t>::max(); |
| 54 | 91 |
| 55 // static | 92 // static |
| 56 ChildProcessHost* ChildProcessHost::Create(ChildProcessHostDelegate* delegate) { | 93 ChildProcessHost* ChildProcessHost::Create(ChildProcessHostDelegate* delegate) { |
| 94 ImageDecoderImpl foo; |
| 95 mojom::ImageDecoderPtr client; |
| 96 client->DecodeImage(nullptr, content::mojom::ImageCodec::DEFAULT, |
| 97 false, mojom::ImageDecoder::DecodeImageCallback()); |
| 98 client->DecodeImage2(content::mojom::ImageCodec::DEFAULT, |
| 99 false, mojom::ImageDecoder::DecodeImage2Callback()); |
| 100 client->DecodeImage3(nullptr, |
| 101 false, mojom::ImageDecoder::DecodeImage3Callback()); |
| 102 client->DecodeImage4(nullptr, content::mojom::ImageCodec::DEFAULT, |
| 103 mojom::ImageDecoder::DecodeImage4Callback()); |
| 104 client->DecodeImage5(nullptr, content::mojom::ImageCodec::DEFAULT, |
| 105 false, mojom::ImageDecoder::DecodeImage5Callback()); |
| 106 client->DecodeImage6(nullptr, content::mojom::ImageCodec::DEFAULT, |
| 107 false, mojom::ImageDecoder::DecodeImage6Callback()); |
| 57 return new ChildProcessHostImpl(delegate); | 108 return new ChildProcessHostImpl(delegate); |
| 58 } | 109 } |
| 59 | 110 |
| 60 // static | 111 // static |
| 61 base::FilePath ChildProcessHost::GetChildPath(int flags) { | 112 base::FilePath ChildProcessHost::GetChildPath(int flags) { |
| 62 base::FilePath child_path; | 113 base::FilePath child_path; |
| 63 | 114 |
| 64 child_path = base::CommandLine::ForCurrentProcess()->GetSwitchValuePath( | 115 child_path = base::CommandLine::ForCurrentProcess()->GetSwitchValuePath( |
| 65 switches::kBrowserSubprocessPath); | 116 switches::kBrowserSubprocessPath); |
| 66 | 117 |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 } | 375 } |
| 325 | 376 |
| 326 void ChildProcessHostImpl::OnDeletedGpuMemoryBuffer( | 377 void ChildProcessHostImpl::OnDeletedGpuMemoryBuffer( |
| 327 gfx::GpuMemoryBufferId id, | 378 gfx::GpuMemoryBufferId id, |
| 328 const gpu::SyncToken& sync_token) { | 379 const gpu::SyncToken& sync_token) { |
| 329 // Note: Nothing to do here as ownership of shared memory backed | 380 // Note: Nothing to do here as ownership of shared memory backed |
| 330 // GpuMemoryBuffers is passed with IPC. | 381 // GpuMemoryBuffers is passed with IPC. |
| 331 } | 382 } |
| 332 | 383 |
| 333 } // namespace content | 384 } // namespace content |
| OLD | NEW |