| 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 #ifndef CHROME_UTILITY_CHROME_CONTENT_UTILITY_CLIENT_H_ | 5 #ifndef CHROME_UTILITY_CHROME_CONTENT_UTILITY_CLIENT_H_ |
| 6 #define CHROME_UTILITY_CHROME_CONTENT_UTILITY_CLIENT_H_ | 6 #define CHROME_UTILITY_CHROME_CONTENT_UTILITY_CLIENT_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/memory/scoped_vector.h" | 14 #include "base/memory/scoped_vector.h" |
| 14 #include "content/public/utility/content_utility_client.h" | 15 #include "content/public/utility/content_utility_client.h" |
| 15 #include "ipc/ipc_platform_file.h" | 16 #include "ipc/ipc_platform_file.h" |
| 17 #include "mojo/common/weak_binding_set.h" |
| 18 #include "third_party/mojo/src/mojo/public/cpp/bindings/interface_request.h" |
| 16 | 19 |
| 17 namespace base { | 20 namespace base { |
| 18 class FilePath; | 21 class FilePath; |
| 19 struct FileDescriptor; | 22 struct FileDescriptor; |
| 20 } | 23 } |
| 21 | 24 |
| 25 namespace content { |
| 26 class Process; |
| 27 } |
| 28 |
| 22 class UtilityMessageHandler; | 29 class UtilityMessageHandler; |
| 23 | 30 |
| 24 class ChromeContentUtilityClient : public content::ContentUtilityClient { | 31 class ChromeContentUtilityClient : public content::ContentUtilityClient { |
| 25 public: | 32 public: |
| 26 ChromeContentUtilityClient(); | 33 ChromeContentUtilityClient(); |
| 27 ~ChromeContentUtilityClient() override; | 34 ~ChromeContentUtilityClient() override; |
| 28 | 35 |
| 29 void UtilityThreadStarted() override; | 36 void UtilityThreadStarted() override; |
| 30 bool OnMessageReceived(const IPC::Message& message) override; | 37 bool OnMessageReceived(const IPC::Message& message) override; |
| 31 void RegisterMojoServices(content::ServiceRegistry* registry) override; | 38 void RegisterMojoServices(content::ServiceRegistry* registry) override; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 void OnAnalyzeZipFileForDownloadProtection( | 81 void OnAnalyzeZipFileForDownloadProtection( |
| 75 const IPC::PlatformFileForTransit& zip_file, | 82 const IPC::PlatformFileForTransit& zip_file, |
| 76 const IPC::PlatformFileForTransit& temp_file); | 83 const IPC::PlatformFileForTransit& temp_file); |
| 77 #endif | 84 #endif |
| 78 #if defined(ENABLE_EXTENSIONS) | 85 #if defined(ENABLE_EXTENSIONS) |
| 79 void OnParseMediaMetadata(const std::string& mime_type, | 86 void OnParseMediaMetadata(const std::string& mime_type, |
| 80 int64 total_size, | 87 int64 total_size, |
| 81 bool get_attached_images); | 88 bool get_attached_images); |
| 82 #endif | 89 #endif |
| 83 | 90 |
| 91 void BindProcessRequest(mojo::InterfaceRequest<content::Process> request); |
| 92 |
| 84 typedef ScopedVector<UtilityMessageHandler> Handlers; | 93 typedef ScopedVector<UtilityMessageHandler> Handlers; |
| 85 Handlers handlers_; | 94 Handlers handlers_; |
| 86 | 95 |
| 87 // Flag to enable whitelisting. | 96 // Flag to enable whitelisting. |
| 88 bool filter_messages_; | 97 bool filter_messages_; |
| 89 // A list of message_ids to filter. | 98 // A list of message_ids to filter. |
| 90 std::set<int> message_id_whitelist_; | 99 std::set<int> message_id_whitelist_; |
| 91 // Maximum IPC msg size (default to kMaximumMessageSize; override for testing) | 100 // Maximum IPC msg size (default to kMaximumMessageSize; override for testing) |
| 92 static int64_t max_ipc_message_size_; | 101 static int64_t max_ipc_message_size_; |
| 93 | 102 |
| 103 // Mojo child process implementation. |
| 104 scoped_ptr<content::Process> process_impl_; |
| 105 // Bindings to the Process impl. |
| 106 mojo::WeakBindingSet<content::Process> process_bindings_; |
| 107 |
| 94 DISALLOW_COPY_AND_ASSIGN(ChromeContentUtilityClient); | 108 DISALLOW_COPY_AND_ASSIGN(ChromeContentUtilityClient); |
| 95 }; | 109 }; |
| 96 | 110 |
| 97 #endif // CHROME_UTILITY_CHROME_CONTENT_UTILITY_CLIENT_H_ | 111 #endif // CHROME_UTILITY_CHROME_CONTENT_UTILITY_CLIENT_H_ |
| OLD | NEW |