| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_EXTENSIONS_PACK_EXTENSION_JOB_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_PACK_EXTENSION_JOB_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_PACK_EXTENSION_JOB_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_PACK_EXTENSION_JOB_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 public: | 22 public: |
| 23 virtual void OnPackSuccess(const FilePath& crx_file, | 23 virtual void OnPackSuccess(const FilePath& crx_file, |
| 24 const FilePath& key_file) = 0; | 24 const FilePath& key_file) = 0; |
| 25 virtual void OnPackFailure(const std::wstring& message) = 0; | 25 virtual void OnPackFailure(const std::wstring& message) = 0; |
| 26 }; | 26 }; |
| 27 | 27 |
| 28 PackExtensionJob(Client* client, | 28 PackExtensionJob(Client* client, |
| 29 const FilePath& root_directory, | 29 const FilePath& root_directory, |
| 30 const FilePath& key_file); | 30 const FilePath& key_file); |
| 31 | 31 |
| 32 // Starts the packing thread job. See http://crbug.com/27944 for more details |
| 33 // on why this function is needed. |
| 34 void Start(); |
| 35 |
| 32 // The client should call this when it is destroyed to prevent | 36 // The client should call this when it is destroyed to prevent |
| 33 // PackExtensionJob from attempting to access it. | 37 // PackExtensionJob from attempting to access it. |
| 34 void ClearClient(); | 38 void ClearClient(); |
| 35 | 39 |
| 36 private: | 40 private: |
| 37 friend class base::RefCountedThreadSafe<PackExtensionJob>; | 41 friend class base::RefCountedThreadSafe<PackExtensionJob>; |
| 38 | 42 |
| 39 ~PackExtensionJob() {} | 43 ~PackExtensionJob() {} |
| 40 | 44 |
| 41 void RunOnFileThread(); | 45 void RunOnFileThread(); |
| 42 void ReportSuccessOnUIThread(); | 46 void ReportSuccessOnUIThread(); |
| 43 void ReportFailureOnUIThread(const std::string& error); | 47 void ReportFailureOnUIThread(const std::string& error); |
| 44 | 48 |
| 45 ChromeThread::ID client_thread_id_; | 49 ChromeThread::ID client_thread_id_; |
| 46 Client* client_; | 50 Client* client_; |
| 47 FilePath root_directory_; | 51 FilePath root_directory_; |
| 48 FilePath key_file_; | 52 FilePath key_file_; |
| 49 FilePath crx_file_out_; | 53 FilePath crx_file_out_; |
| 50 FilePath key_file_out_; | 54 FilePath key_file_out_; |
| 51 | 55 |
| 52 DISALLOW_COPY_AND_ASSIGN(PackExtensionJob); | 56 DISALLOW_COPY_AND_ASSIGN(PackExtensionJob); |
| 53 }; | 57 }; |
| 54 | 58 |
| 55 #endif // CHROME_BROWSER_EXTENSIONS_PACK_EXTENSION_JOB_H_ | 59 #endif // CHROME_BROWSER_EXTENSIONS_PACK_EXTENSION_JOB_H_ |
| OLD | NEW |