Skip to content

Commit

Permalink
Fix nacl_process_host.h includes.
Browse files Browse the repository at this point in the history
This file should never be included when DISABLE_NACL is defined. Erroneous
includes of this file caused problems interacting with the native_client/
source from components/nacl.

I tested this change locally with a disable_nacl=1 build.

BUG=none
R=mseaborn@chromium.org, sky@chromium.org

Review URL: https://codereview.chromium.org/421613002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285918 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
teravest@chromium.org committed Jul 28, 2014
1 parent a6c2d13 commit 927da9e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 18 deletions.
5 changes: 4 additions & 1 deletion chrome/browser/chrome_browser_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@
#include "components/language_usage_metrics/language_usage_metrics.h"
#include "components/metrics/metrics_service.h"
#include "components/nacl/browser/nacl_browser.h"
#include "components/nacl/browser/nacl_process_host.h"
#include "components/rappor/rappor_service.h"
#include "components/signin/core/common/profile_management_switches.h"
#include "components/startup_metric_utils/startup_metric_utils.h"
Expand Down Expand Up @@ -187,6 +186,10 @@
#include "chrome/browser/component_updater/cld_component_installer.h"
#endif

#if !defined(DISABLE_NACL)
#include "components/nacl/browser/nacl_process_host.h"
#endif

#if defined(ENABLE_FULL_PRINTING) && !defined(OFFICIAL_BUILD)
#include "printing/printed_document.h"
#endif
Expand Down
5 changes: 4 additions & 1 deletion chrome/browser/extensions/app_background_page_apitest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include "chrome/browser/ui/extensions/application_launch.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
#include "components/nacl/browser/nacl_process_host.h"
#include "content/public/browser/notification_service.h"
#include "content/public/test/test_notification_tracker.h"
#include "content/public/test/test_utils.h"
Expand All @@ -29,6 +28,10 @@
#include "net/dns/mock_host_resolver.h"
#include "net/test/embedded_test_server/embedded_test_server.h"

#if !defined(DISABLE_NACL)
#include "components/nacl/browser/nacl_process_host.h"
#endif

#if defined(OS_MACOSX)
#include "base/mac/scoped_nsautorelease_pool.h"
#endif
Expand Down
7 changes: 3 additions & 4 deletions components/nacl/browser/nacl_process_host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,7 @@ NaClProcessHost::NaClProcessHost(const GURL& manifest_url,
const base::FilePath& profile_directory)
: manifest_url_(manifest_url),
nexe_file_(nexe_file.Pass()),
nexe_token_lo_(nexe_token.lo),
nexe_token_hi_(nexe_token.hi),
nexe_token_(nexe_token),
permissions_(permissions),
#if defined(OS_WIN)
process_launched_by_broker_(false),
Expand Down Expand Up @@ -840,8 +839,8 @@ bool NaClProcessHost::StartNaClExecution() {

// TODO(teravest): Resolve the file tokens right now instead of making the
// loader send IPC to resolve them later.
params.nexe_token_lo = nexe_token_lo_;
params.nexe_token_hi = nexe_token_hi_;
params.nexe_token_lo = nexe_token_.lo;
params.nexe_token_hi = nexe_token_.hi;

const ChildProcessData& data = process_->GetData();
if (!ShareHandleToSelLdr(data.handle,
Expand Down
14 changes: 2 additions & 12 deletions components/nacl/browser/nacl_process_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,11 @@
#include "content/public/browser/browser_child_process_host_delegate.h"
#include "content/public/browser/browser_child_process_host_iterator.h"
#include "ipc/ipc_channel_handle.h"
#include "native_client/src/public/nacl_file_info.h"
#include "net/socket/socket_descriptor.h"
#include "ppapi/shared_impl/ppapi_permissions.h"
#include "url/gurl.h"

// NaClFileToken here is forward declared here instead of including
// nacl_file_info.h because that file isn't safe to include for disable_nacl=1
// builds.
// TODO(teravest): Stop building this header in disable_nacl=1 builds and
// include nacl_file_info.h instead of forward declaring NaClFileToken.
struct NaClFileToken;

namespace content {
class BrowserChildProcessHost;
class BrowserPpapiHost;
Expand Down Expand Up @@ -199,11 +193,7 @@ class NaClProcessHost : public content::BrowserChildProcessHostDelegate {

GURL manifest_url_;
base::File nexe_file_;

// TODO(teravest): Use NaClFileInfo here, but without breaking the
// disable_nacl=1 build. (Why is this file even built with disable_nacl=1?)
uint64_t nexe_token_lo_;
uint64_t nexe_token_hi_;
NaClFileToken nexe_token_;

ppapi::PpapiPermissions permissions_;

Expand Down

0 comments on commit 927da9e

Please sign in to comment.