From 30a9071ad365fc3141a5cd30a01559e508e9a891 Mon Sep 17 00:00:00 2001 From: "alexis.menard@intel.com" Date: Mon, 18 Nov 2013 16:26:11 +0000 Subject: [PATCH] Move chrome/browser/nacl_host/pnacl_translation_cache.* to components/nacl/browser These files have no dependencies on chrome/ so they can be safely moved to the components/ directory. This is part of an effort to componentize NaCl code. BUG=244791 Review URL: https://codereview.chromium.org/61763026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235735 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/nacl_host/pnacl_host.cc | 2 +- chrome/browser/nacl_host/pnacl_host_unittest.cc | 2 +- chrome/chrome_browser.gypi | 2 -- chrome/chrome_common.gypi | 2 -- chrome/chrome_tests_unit.gypi | 2 -- components/components_tests.gyp | 2 ++ components/nacl.gyp | 2 ++ components/nacl/browser/DEPS | 2 ++ .../nacl/browser}/pnacl_translation_cache.cc | 2 +- .../nacl/browser}/pnacl_translation_cache.h | 6 +++--- .../nacl/browser}/pnacl_translation_cache_unittest.cc | 2 +- components/nacl_common.gyp | 2 ++ 12 files changed, 15 insertions(+), 13 deletions(-) rename {chrome/browser/nacl_host => components/nacl/browser}/pnacl_translation_cache.cc (99%) rename {chrome/browser/nacl_host => components/nacl/browser}/pnacl_translation_cache.h (94%) rename {chrome/browser/nacl_host => components/nacl/browser}/pnacl_translation_cache_unittest.cc (99%) diff --git a/chrome/browser/nacl_host/pnacl_host.cc b/chrome/browser/nacl_host/pnacl_host.cc index 0ee7a1375958ef..6a974cd9aaa40a 100644 --- a/chrome/browser/nacl_host/pnacl_host.cc +++ b/chrome/browser/nacl_host/pnacl_host.cc @@ -11,8 +11,8 @@ #include "base/logging.h" #include "base/task_runner_util.h" #include "base/threading/sequenced_worker_pool.h" -#include "chrome/browser/nacl_host/pnacl_translation_cache.h" #include "components/nacl/browser/nacl_browser.h" +#include "components/nacl/browser/pnacl_translation_cache.h" #include "content/public/browser/browser_thread.h" #include "net/base/io_buffer.h" #include "net/base/net_errors.h" diff --git a/chrome/browser/nacl_host/pnacl_host_unittest.cc b/chrome/browser/nacl_host/pnacl_host_unittest.cc index df4a32d6a49c53..c4678f7b2e792d 100644 --- a/chrome/browser/nacl_host/pnacl_host_unittest.cc +++ b/chrome/browser/nacl_host/pnacl_host_unittest.cc @@ -9,7 +9,7 @@ #include "base/files/scoped_temp_dir.h" #include "base/run_loop.h" #include "base/threading/sequenced_worker_pool.h" -#include "chrome/browser/nacl_host/pnacl_translation_cache.h" +#include "components/nacl/browser/pnacl_translation_cache.h" #include "content/public/browser/browser_thread.h" #include "content/public/test/test_browser_thread_bundle.h" #include "net/base/test_completion_callback.h" diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index 3c6259f386bf7b..c9a4a56823a32f 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -2847,8 +2847,6 @@ 'browser/nacl_host/nacl_process_host.h', 'browser/nacl_host/pnacl_host.cc', 'browser/nacl_host/pnacl_host.h', - 'browser/nacl_host/pnacl_translation_cache.cc', - 'browser/nacl_host/pnacl_translation_cache.h', '../components/nacl/common/nacl_debug_exception_handler_win.cc', '../components/nacl/common/nacl_debug_exception_handler_win.h', ], diff --git a/chrome/chrome_common.gypi b/chrome/chrome_common.gypi index 0530a8d1297c13..10c8b85e99fba3 100644 --- a/chrome/chrome_common.gypi +++ b/chrome/chrome_common.gypi @@ -401,8 +401,6 @@ '../components/nacl/common/nacl_host_messages.h', '../components/nacl/common/nacl_process_type.h', '../components/nacl/common/nacl_sandbox_type_mac.h', - '../components/nacl/common/pnacl_types.cc', - '../components/nacl/common/pnacl_types.h', ], 'conditions': [ ['enable_extensions==1', { diff --git a/chrome/chrome_tests_unit.gypi b/chrome/chrome_tests_unit.gypi index e59e8171bdbd25..a31aa97cde81bc 100644 --- a/chrome/chrome_tests_unit.gypi +++ b/chrome/chrome_tests_unit.gypi @@ -1036,7 +1036,6 @@ 'browser/metrics/variations/variations_request_scheduler_unittest.cc', 'browser/nacl_host/nacl_file_host_unittest.cc', 'browser/nacl_host/nacl_process_host_unittest.cc', - 'browser/nacl_host/pnacl_translation_cache_unittest.cc', 'browser/nacl_host/pnacl_host_unittest.cc', 'browser/net/chrome_fraudulent_certificate_reporter_unittest.cc', 'browser/net/chrome_network_data_saving_metrics_unittest.cc', @@ -2126,7 +2125,6 @@ 'browser/nacl_host/nacl_file_host_unittest.cc', 'browser/nacl_host/nacl_process_host_unittest.cc', 'browser/nacl_host/pnacl_host_unittest.cc', - 'browser/nacl_host/pnacl_translation_cache_unittest.cc', # TODO(yael): Move to //components/components_tests.gypi once # nacl_defines is moved out of chrome.gyp into a common place. '../components/nacl/loader/nacl_ipc_adapter_unittest.cc', diff --git a/components/components_tests.gyp b/components/components_tests.gyp index 1ec3ed57af8179..990c65321918cc 100644 --- a/components/components_tests.gyp +++ b/components/components_tests.gyp @@ -135,9 +135,11 @@ ['disable_nacl==0', { 'sources': [ 'nacl/browser/nacl_validation_cache_unittest.cc', + 'nacl/browser/pnacl_translation_cache_unittest.cc', ], 'dependencies': [ 'nacl.gyp:nacl_browser', + 'nacl_common.gyp:nacl_common', ], }], ['OS == "android"', { diff --git a/components/nacl.gyp b/components/nacl.gyp index 5ec4fcecb309ae..4e1f8048cc40a9 100644 --- a/components/nacl.gyp +++ b/components/nacl.gyp @@ -107,6 +107,8 @@ 'nacl/browser/nacl_browser.h', 'nacl/browser/nacl_validation_cache.cc', 'nacl/browser/nacl_validation_cache.h', + 'nacl/browser/pnacl_translation_cache.cc', + 'nacl/browser/pnacl_translation_cache.h', ], 'include_dirs': [ '..', diff --git a/components/nacl/browser/DEPS b/components/nacl/browser/DEPS index 1c35d9ca694b70..67b5b476401ee1 100644 --- a/components/nacl/browser/DEPS +++ b/components/nacl/browser/DEPS @@ -1,3 +1,5 @@ include_rules = [ "+content/public/browser", + "+content/public/test", + "+net", ] diff --git a/chrome/browser/nacl_host/pnacl_translation_cache.cc b/components/nacl/browser/pnacl_translation_cache.cc similarity index 99% rename from chrome/browser/nacl_host/pnacl_translation_cache.cc rename to components/nacl/browser/pnacl_translation_cache.cc index 56354792ebb6bf..e27103adf8d5f2 100644 --- a/chrome/browser/nacl_host/pnacl_translation_cache.cc +++ b/components/nacl/browser/pnacl_translation_cache.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/nacl_host/pnacl_translation_cache.h" +#include "components/nacl/browser/pnacl_translation_cache.h" #include diff --git a/chrome/browser/nacl_host/pnacl_translation_cache.h b/components/nacl/browser/pnacl_translation_cache.h similarity index 94% rename from chrome/browser/nacl_host/pnacl_translation_cache.h rename to components/nacl/browser/pnacl_translation_cache.h index 7ca4bcc65ca261..9dd528cd863b60 100644 --- a/chrome/browser/nacl_host/pnacl_translation_cache.h +++ b/components/nacl/browser/pnacl_translation_cache.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_NACL_HOST_PNACL_TRANSLATION_CACHE_H_ -#define CHROME_BROWSER_NACL_HOST_PNACL_TRANSLATION_CACHE_H_ +#ifndef COMPONENTS_NACL_BROWSER_PNACL_TRANSLATION_CACHE_H_ +#define COMPONENTS_NACL_BROWSER_PNACL_TRANSLATION_CACHE_H_ #include @@ -103,4 +103,4 @@ class PnaclTranslationCache } // namespace pnacl -#endif // CHROME_BROWSER_NACL_HOST_PNACL_TRANSLATION_CACHE_H_ +#endif // COMPONENTS_NACL_BROWSER_PNACL_TRANSLATION_CACHE_H_ diff --git a/chrome/browser/nacl_host/pnacl_translation_cache_unittest.cc b/components/nacl/browser/pnacl_translation_cache_unittest.cc similarity index 99% rename from chrome/browser/nacl_host/pnacl_translation_cache_unittest.cc rename to components/nacl/browser/pnacl_translation_cache_unittest.cc index adcdd35b5db865..94cd681f955c48 100644 --- a/chrome/browser/nacl_host/pnacl_translation_cache_unittest.cc +++ b/components/nacl/browser/pnacl_translation_cache_unittest.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/nacl_host/pnacl_translation_cache.h" +#include "components/nacl/browser/pnacl_translation_cache.h" #include "base/files/file_path.h" #include "base/files/scoped_temp_dir.h" diff --git a/components/nacl_common.gyp b/components/nacl_common.gyp index cedf67576979b5..960eb1c6541781 100644 --- a/components/nacl_common.gyp +++ b/components/nacl_common.gyp @@ -25,6 +25,8 @@ 'nacl/common/nacl_messages.h', 'nacl/common/nacl_types.cc', 'nacl/common/nacl_types.h', + 'nacl/common/pnacl_types.cc', + 'nacl/common/pnacl_types.h', ], 'include_dirs': [ '..',