Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Side by Side Diff: chrome/utility/chrome_content_utility_client.h

Issue 98603007: Launches a privileged utility process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleans up ChildProcessLauncher implementations. Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/memory/scoped_vector.h" 9 #include "base/memory/scoped_vector.h"
10 #include "base/platform_file.h" 10 #include "base/platform_file.h"
(...skipping 22 matching lines...) Expand all
33 class ChromeContentUtilityClient : public content::ContentUtilityClient { 33 class ChromeContentUtilityClient : public content::ContentUtilityClient {
34 public: 34 public:
35 ChromeContentUtilityClient(); 35 ChromeContentUtilityClient();
36 virtual ~ChromeContentUtilityClient(); 36 virtual ~ChromeContentUtilityClient();
37 37
38 virtual void UtilityThreadStarted() OVERRIDE; 38 virtual void UtilityThreadStarted() OVERRIDE;
39 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; 39 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
40 40
41 static void PreSandboxStartup(); 41 static void PreSandboxStartup();
42 42
43 // Adds a message handler to the utility client. This will take ownership of
44 // the handler.
45 void AddHandler(UtilityMessageHandler* handler);
jam 2014/01/30 21:41:03 hmm, these two methods are only added for a unitte
Drew Haven 2014/01/31 20:00:12 Since this has security implications, I feel like
jam 2014/02/01 01:09:10 I understand the need to test. Perhaps there are o
Drew Haven 2014/02/04 21:25:54 Okay, that generally sounds good. Once we start a
46
47 // Adds a message type to the whitelist.
48 void AddWhitelistMessageType(int message_type);
49
43 private: 50 private:
44 // IPC message handlers. 51 // IPC message handlers.
45 void OnUnpackExtension(const base::FilePath& extension_path, 52 void OnUnpackExtension(const base::FilePath& extension_path,
46 const std::string& extension_id, 53 const std::string& extension_id,
47 int location, int creation_flags); 54 int location, int creation_flags);
48 void OnUnpackWebResource(const std::string& resource_data); 55 void OnUnpackWebResource(const std::string& resource_data);
49 void OnParseUpdateManifest(const std::string& xml); 56 void OnParseUpdateManifest(const std::string& xml);
50 void OnDecodeImage(const std::vector<unsigned char>& encoded_data); 57 void OnDecodeImage(const std::vector<unsigned char>& encoded_data);
51 void OnDecodeImageBase64(const std::string& encoded_data); 58 void OnDecodeImageBase64(const std::string& encoded_data);
52 void OnRenderPDFPagesToMetafile( 59 void OnRenderPDFPagesToMetafile(
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 const picasa::AlbumTableFilesForTransit& album_table_files); 106 const picasa::AlbumTableFilesForTransit& album_table_files);
100 107
101 void OnIndexPicasaAlbumsContents( 108 void OnIndexPicasaAlbumsContents(
102 const picasa::AlbumUIDSet& album_uids, 109 const picasa::AlbumUIDSet& album_uids,
103 const std::vector<picasa::FolderINIContents>& folders_inis); 110 const std::vector<picasa::FolderINIContents>& folders_inis);
104 #endif // defined(OS_WIN) || defined(OS_MACOSX) 111 #endif // defined(OS_WIN) || defined(OS_MACOSX)
105 112
106 typedef ScopedVector<UtilityMessageHandler> Handlers; 113 typedef ScopedVector<UtilityMessageHandler> Handlers;
107 Handlers handlers_; 114 Handlers handlers_;
108 115
116 // Flag to enable whitelisting.
117 bool filter_messages_;
118 // A list of message_ids to filter.
119 std::set<int> message_id_whitelist_;
120
109 DISALLOW_COPY_AND_ASSIGN(ChromeContentUtilityClient); 121 DISALLOW_COPY_AND_ASSIGN(ChromeContentUtilityClient);
110 }; 122 };
111 123
112 } // namespace chrome 124 } // namespace chrome
113 125
114 #endif // CHROME_UTILITY_CHROME_CONTENT_UTILITY_CLIENT_H_ 126 #endif // CHROME_UTILITY_CHROME_CONTENT_UTILITY_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698