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

Side by Side Diff: chrome/browser/nacl_host/nacl_process_host.h

Issue 8397001: Open NaCl IRT file only once at startup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 9 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/chrome_browser_main.cc ('k') | chrome/browser/nacl_host/nacl_process_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_BROWSER_NACL_HOST_NACL_PROCESS_HOST_H_ 5 #ifndef CHROME_BROWSER_NACL_HOST_NACL_PROCESS_HOST_H_
6 #define CHROME_BROWSER_NACL_HOST_NACL_PROCESS_HOST_H_ 6 #define CHROME_BROWSER_NACL_HOST_NACL_PROCESS_HOST_H_
7 #pragma once 7 #pragma once
8 8
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 10
(...skipping 10 matching lines...) Expand all
21 // channel. There will be one NaClProcessHost per NaCl process 21 // channel. There will be one NaClProcessHost per NaCl process
22 // The browser is responsible for starting the NaCl process 22 // The browser is responsible for starting the NaCl process
23 // when requested by the renderer. 23 // when requested by the renderer.
24 // After that, most of the communication is directly between NaCl plugin 24 // After that, most of the communication is directly between NaCl plugin
25 // running in the renderer and NaCl processes. 25 // running in the renderer and NaCl processes.
26 class NaClProcessHost : public BrowserChildProcessHost { 26 class NaClProcessHost : public BrowserChildProcessHost {
27 public: 27 public:
28 explicit NaClProcessHost(const std::wstring& url); 28 explicit NaClProcessHost(const std::wstring& url);
29 virtual ~NaClProcessHost(); 29 virtual ~NaClProcessHost();
30 30
31 // Do any minimal work that must be done at browser startup.
32 static void EarlyStartup();
33
31 // Initialize the new NaCl process, returning true on success. 34 // Initialize the new NaCl process, returning true on success.
32 bool Launch(ChromeRenderMessageFilter* chrome_render_message_filter, 35 bool Launch(ChromeRenderMessageFilter* chrome_render_message_filter,
33 int socket_count, 36 int socket_count,
34 IPC::Message* reply_msg); 37 IPC::Message* reply_msg);
35 38
36 virtual bool OnMessageReceived(const IPC::Message& msg); 39 virtual bool OnMessageReceived(const IPC::Message& msg);
37 40
38 void OnProcessLaunchedByBroker(base::ProcessHandle handle); 41 void OnProcessLaunchedByBroker(base::ProcessHandle handle);
39 42
40 protected: 43 protected:
41 virtual base::TerminationStatus GetChildTerminationStatus(int* exit_code); 44 virtual base::TerminationStatus GetChildTerminationStatus(int* exit_code);
42 virtual void OnChildDied(); 45 virtual void OnChildDied();
43 46
44 private: 47 private:
45 // Internal class that holds the nacl::Handle objecs so that 48 // Internal class that holds the nacl::Handle objecs so that
46 // nacl_process_host.h doesn't include NaCl headers. Needed since it's 49 // nacl_process_host.h doesn't include NaCl headers. Needed since it's
47 // included by src\content, which can't depend on the NaCl gyp file because it 50 // included by src\content, which can't depend on the NaCl gyp file because it
48 // depends on chrome.gyp (circular dependency). 51 // depends on chrome.gyp (circular dependency).
49 struct NaClInternal; 52 struct NaClInternal;
50 53
51 bool LaunchSelLdr(); 54 bool LaunchSelLdr();
52 55
53 // Get the architecture-specific filename of NaCl's integrated
54 // runtime (IRT) library, relative to the plugins directory.
55 FilePath::StringType GetIrtLibraryFilename();
56
57 virtual void OnProcessLaunched(); 56 virtual void OnProcessLaunched();
58 57
59 void OpenIrtFileDone(base::PlatformFileError error_code, 58 void IrtReady();
60 base::PassPlatformFile file, 59 void SendStart(base::PlatformFile irt_file);
61 bool created);
62 60
63 virtual bool CanShutdown(); 61 virtual bool CanShutdown();
64 62
65 private: 63 private:
66 // The ChromeRenderMessageFilter that requested this NaCl process. We use 64 // The ChromeRenderMessageFilter that requested this NaCl process. We use
67 // this for sending the reply once the process has started. 65 // this for sending the reply once the process has started.
68 scoped_refptr<ChromeRenderMessageFilter> chrome_render_message_filter_; 66 scoped_refptr<ChromeRenderMessageFilter> chrome_render_message_filter_;
69 67
70 // The reply message to send. 68 // The reply message to send.
71 IPC::Message* reply_msg_; 69 IPC::Message* reply_msg_;
72 70
73 // Socket pairs for the NaCl process and renderer. 71 // Socket pairs for the NaCl process and renderer.
74 scoped_ptr<NaClInternal> internal_; 72 scoped_ptr<NaClInternal> internal_;
75 73
76 // Windows platform flag
77 bool running_on_wow64_;
78
79 base::WeakPtrFactory<NaClProcessHost> weak_factory_; 74 base::WeakPtrFactory<NaClProcessHost> weak_factory_;
80 75
81 DISALLOW_COPY_AND_ASSIGN(NaClProcessHost); 76 DISALLOW_COPY_AND_ASSIGN(NaClProcessHost);
82 }; 77 };
83 78
84 #endif // CHROME_BROWSER_NACL_HOST_NACL_PROCESS_HOST_H_ 79 #endif // CHROME_BROWSER_NACL_HOST_NACL_PROCESS_HOST_H_
OLDNEW
« no previous file with comments | « chrome/browser/chrome_browser_main.cc ('k') | chrome/browser/nacl_host/nacl_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698