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

Unified Diff: content/browser/android/download_process_host.h

Issue 1622743005: Introduce background Download process to android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/android/download_process_host.h
diff --git a/content/browser/android/download_process_host.h b/content/browser/android/download_process_host.h
new file mode 100644
index 0000000000000000000000000000000000000000..bf066dca419bd3956dd32b990557b9d4260ac9e3
--- /dev/null
+++ b/content/browser/android/download_process_host.h
@@ -0,0 +1,39 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
svaldez 2016/01/25 15:33:43 2016, same with any other dates.
qinmin 2016/01/25 22:48:23 Done.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_BROWSER_ANDROID_DOWNLOAD_PROCESS_HOST_H_
+#define CONTENT_BROWSER_ANDROID_DOWNLOAD_PROCESS_HOST_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "content/public/browser/browser_child_process_host.h"
+#include "content/public/browser/browser_child_process_host_delegate.h"
+
+namespace content {
+
+class DownloadProcessHost : public content::BrowserChildProcessHostDelegate {
+ public:
+ DownloadProcessHost();
+ ~DownloadProcessHost() override;
+
+ // Starts a process if necessary. Returns true if it succeeded or a process
+ // has already been started.
+ bool StartProcess();
+
+ private:
+ // content::BrowserChildProcessHostDelegate:
+ bool OnMessageReceived(const IPC::Message& message) override;
+ void OnProcessLaunchFailed() override;
+ void OnProcessCrashed(int exit_code) override;
+ void OnProcessLaunched() override;
+
+ bool started_;
+
+ scoped_ptr<content::BrowserChildProcessHost> process_;
+
+ DISALLOW_COPY_AND_ASSIGN(DownloadProcessHost);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_ANDROID_DOWNLOAD_PROCESS_HOST_H_

Powered by Google App Engine
This is Rietveld 408576698