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/utility/chrome_content_utility_client.h" | 5 #include "chrome/utility/chrome_content_utility_client.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 Send(new ChromeUtilityHostMsg_DecodeImage_Succeeded(decoded_image, | 284 Send(new ChromeUtilityHostMsg_DecodeImage_Succeeded(decoded_image, |
285 request_id)); | 285 request_id)); |
286 } | 286 } |
287 ReleaseProcessIfNeeded(); | 287 ReleaseProcessIfNeeded(); |
288 } | 288 } |
289 | 289 |
290 void ChromeContentUtilityClient::OnDecodeImage( | 290 void ChromeContentUtilityClient::OnDecodeImage( |
291 const std::vector<unsigned char>& encoded_data, | 291 const std::vector<unsigned char>& encoded_data, |
292 bool shrink_to_fit, | 292 bool shrink_to_fit, |
293 int request_id) { | 293 int request_id) { |
| 294 content::UtilityThread::Get()->EnsureBlinkInitialized(); |
294 DecodeImageAndSend(encoded_data, shrink_to_fit, request_id); | 295 DecodeImageAndSend(encoded_data, shrink_to_fit, request_id); |
295 } | 296 } |
296 | 297 |
297 #if defined(OS_CHROMEOS) | 298 #if defined(OS_CHROMEOS) |
298 void ChromeContentUtilityClient::OnCreateZipFile( | 299 void ChromeContentUtilityClient::OnCreateZipFile( |
299 const base::FilePath& src_dir, | 300 const base::FilePath& src_dir, |
300 const std::vector<base::FilePath>& src_relative_paths, | 301 const std::vector<base::FilePath>& src_relative_paths, |
301 const base::FileDescriptor& dest_fd) { | 302 const base::FileDescriptor& dest_fd) { |
302 // dest_fd should be closed in the function. See ipc/ipc_message_util.h for | 303 // dest_fd should be closed in the function. See ipc/ipc_message_util.h for |
303 // details. | 304 // details. |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 const std::string& mime_type, int64 total_size, bool get_attached_images) { | 405 const std::string& mime_type, int64 total_size, bool get_attached_images) { |
405 // Only one IPCDataSource may be created and added to the list of handlers. | 406 // Only one IPCDataSource may be created and added to the list of handlers. |
406 metadata::IPCDataSource* source = new metadata::IPCDataSource(total_size); | 407 metadata::IPCDataSource* source = new metadata::IPCDataSource(total_size); |
407 handlers_.push_back(source); | 408 handlers_.push_back(source); |
408 | 409 |
409 metadata::MediaMetadataParser* parser = new metadata::MediaMetadataParser( | 410 metadata::MediaMetadataParser* parser = new metadata::MediaMetadataParser( |
410 source, mime_type, get_attached_images); | 411 source, mime_type, get_attached_images); |
411 parser->Start(base::Bind(&FinishParseMediaMetadata, base::Owned(parser))); | 412 parser->Start(base::Bind(&FinishParseMediaMetadata, base::Owned(parser))); |
412 } | 413 } |
413 #endif | 414 #endif |
OLD | NEW |