diff options
author | thestig <thestig@chromium.org> | 2015-05-24 20:23:21 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-25 03:23:49 +0000 |
commit | 6f6374ee312ec0f8e07e208056a8f9135d97087f (patch) | |
tree | c2a5343be2c8d85178d910f26f9e48bcef413b62 | |
parent | c3c76185d51f062f4ef27e7263f9d50a4c8b506e (diff) | |
download | chromium_src-6f6374ee312ec0f8e07e208056a8f9135d97087f.zip chromium_src-6f6374ee312ec0f8e07e208056a8f9135d97087f.tar.gz chromium_src-6f6374ee312ec0f8e07e208056a8f9135d97087f.tar.bz2 |
NativeProcessLauncher should always pass LaunchedCallback by reference.
Review URL: https://codereview.chromium.org/1145243004
Cr-Commit-Position: refs/heads/master@{#331255}
3 files changed, 10 insertions, 10 deletions
diff --git a/chrome/browser/extensions/api/messaging/native_message_process_host_unittest.cc b/chrome/browser/extensions/api/messaging/native_message_process_host_unittest.cc index 3bc06cb..db03d50 100644 --- a/chrome/browser/extensions/api/messaging/native_message_process_host_unittest.cc +++ b/chrome/browser/extensions/api/messaging/native_message_process_host_unittest.cc @@ -80,7 +80,7 @@ class FakeLauncher : public NativeProcessLauncher { void Launch(const GURL& origin, const std::string& native_host_name, - LaunchedCallback callback) const override { + const LaunchedCallback& callback) const override { callback.Run(NativeProcessLauncher::RESULT_SUCCESS, base::Process(), read_file_.Pass(), write_file_.Pass()); } diff --git a/chrome/browser/extensions/api/messaging/native_process_launcher.cc b/chrome/browser/extensions/api/messaging/native_process_launcher.cc index 5fd487d..a6bf208 100644 --- a/chrome/browser/extensions/api/messaging/native_process_launcher.cc +++ b/chrome/browser/extensions/api/messaging/native_process_launcher.cc @@ -42,7 +42,7 @@ class NativeProcessLauncherImpl : public NativeProcessLauncher { void Launch(const GURL& origin, const std::string& native_host_name, - LaunchedCallback callback) const override; + const LaunchedCallback& callback) const override; private: class Core : public base::RefCountedThreadSafe<Core> { @@ -50,7 +50,7 @@ class NativeProcessLauncherImpl : public NativeProcessLauncher { Core(bool allow_user_level_hosts, intptr_t native_window); void Launch(const GURL& origin, const std::string& native_host_name, - LaunchedCallback callback); + const LaunchedCallback& callback); void Detach(); private: @@ -59,13 +59,13 @@ class NativeProcessLauncherImpl : public NativeProcessLauncher { void DoLaunchOnThreadPool(const GURL& origin, const std::string& native_host_name, - LaunchedCallback callback); + const LaunchedCallback& callback); void PostErrorResult(const LaunchedCallback& callback, LaunchResult error); void PostResult(const LaunchedCallback& callback, base::Process process, base::File read_file, base::File write_file); - void CallCallbackOnIOThread(LaunchedCallback callback, + void CallCallbackOnIOThread(const LaunchedCallback& callback, LaunchResult result, base::Process process, base::File read_file, @@ -105,7 +105,7 @@ void NativeProcessLauncherImpl::Core::Detach() { void NativeProcessLauncherImpl::Core::Launch( const GURL& origin, const std::string& native_host_name, - LaunchedCallback callback) { + const LaunchedCallback& callback) { content::BrowserThread::PostBlockingPoolTask( FROM_HERE, base::Bind(&Core::DoLaunchOnThreadPool, this, origin, native_host_name, callback)); @@ -114,7 +114,7 @@ void NativeProcessLauncherImpl::Core::Launch( void NativeProcessLauncherImpl::Core::DoLaunchOnThreadPool( const GURL& origin, const std::string& native_host_name, - LaunchedCallback callback) { + const LaunchedCallback& callback) { DCHECK(content::BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread()); if (!NativeMessagingHostManifest::IsValidName(native_host_name)) { @@ -204,7 +204,7 @@ void NativeProcessLauncherImpl::Core::DoLaunchOnThreadPool( } void NativeProcessLauncherImpl::Core::CallCallbackOnIOThread( - LaunchedCallback callback, + const LaunchedCallback& callback, LaunchResult result, base::Process process, base::File read_file, @@ -250,7 +250,7 @@ NativeProcessLauncherImpl::~NativeProcessLauncherImpl() { void NativeProcessLauncherImpl::Launch(const GURL& origin, const std::string& native_host_name, - LaunchedCallback callback) const { + const LaunchedCallback& callback) const { core_->Launch(origin, native_host_name, callback); } diff --git a/chrome/browser/extensions/api/messaging/native_process_launcher.h b/chrome/browser/extensions/api/messaging/native_process_launcher.h index d0d3f43..7558fa3 100644 --- a/chrome/browser/extensions/api/messaging/native_process_launcher.h +++ b/chrome/browser/extensions/api/messaging/native_process_launcher.h @@ -56,7 +56,7 @@ class NativeProcessLauncher { // closing IO pipes). virtual void Launch(const GURL& origin, const std::string& native_host_name, - LaunchedCallback callback) const = 0; + const LaunchedCallback& callback) const = 0; protected: // The following two methods are platform specific and are implemented in |