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

Side by Side Diff: chrome/browser/image_writer/image_writer.h

Issue 61643015: Adds imageWriterPrivate support for Windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reorganization and test updates. Created 7 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
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
jam 2013/11/21 19:36:41 here and in other files, the new copyright header
Drew Haven 2013/11/26 02:10:43 Done.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_IMAGE_WRITER_IMAGE_WRITER_H_
6 #define CHROME_BROWSER_IMAGE_WRITER_IMAGE_WRITER_H_
7
8 #include <string>
9 #include <vector>
10
11 #include "base/files/file_path.h"
12 #include "base/threading/sequenced_worker_pool.h"
13 #include "content/public/browser/utility_process_host_client.h"
14
15 // Decodes an image in a sandboxed process.
jam 2013/11/21 19:36:41 update
Drew Haven 2013/11/26 02:10:43 Done.
16 class ImageWriter : public content::UtilityProcessHostClient {
17 public:
18 class Delegate {
19 public:
20 // Called when image is decoded.
21 // |writer| is used to identify the image in case of decoding several
22 // images simultaneously.
23 virtual void OnWriteImageSucceeded() = 0;
24
25 // Called when decoding image failed. Delegate can do some cleanup in
26 // this handler.
27 virtual void OnWriteImageFailed(const std::string& message) = 0;
28
29 virtual void OnWriteImageProgress(int progress) = 0;
30
31 protected:
32 virtual ~Delegate() {}
33 };
34
35 ImageWriter(Delegate* delegate,
36 const base::FilePath& source,
37 const base::FilePath& target);
38
39 void Start(scoped_refptr<base::SequencedTaskRunner> task_runner);
40
41 // Overidden from UtilityProcessHostClient:
42 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
jam 2013/11/21 19:36:41 nit: put in private section
Drew Haven 2013/11/26 02:10:43 Done.
43
44 private:
45 // It's a reference counted object, so destructor is private.
46 virtual ~ImageWriter();
47
48 // IPC message handlers.
49 void OnWriteImageSucceeded();
50 void OnWriteImageFailed(const std::string& message);
51 void OnWriteImageProgress(int progress);
52
53 void StartWriteInUtilityProcess();
54
55 Delegate* delegate_;
56 base::FilePath source_;
57 base::FilePath target_;
58 scoped_refptr<base::SequencedTaskRunner> task_runner_;
59
60 DISALLOW_COPY_AND_ASSIGN(ImageWriter);
61 };
62
63 #endif // CHROME_BROWSER_IMAGE_WRITER_IMAGE_WRITER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698