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

Side by Side Diff: chrome/installer/util/work_item.cc

Issue 151101: Fixit: Remove bunch of coverity warnings from chrome/installer/*. (Closed)
Patch Set: Created 11 years, 5 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 unified diff | Download patch
« no previous file with comments | « chrome/installer/util/work_item.h ('k') | chrome/installer/util/work_item_list.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 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 #include "chrome/installer/util/work_item.h" 5 #include "chrome/installer/util/work_item.h"
6 6
7 #include "chrome/installer/util/copy_tree_work_item.h" 7 #include "chrome/installer/util/copy_tree_work_item.h"
8 #include "chrome/installer/util/create_dir_work_item.h" 8 #include "chrome/installer/util/create_dir_work_item.h"
9 #include "chrome/installer/util/create_reg_key_work_item.h" 9 #include "chrome/installer/util/create_reg_key_work_item.h"
10 #include "chrome/installer/util/delete_tree_work_item.h" 10 #include "chrome/installer/util/delete_tree_work_item.h"
11 #include "chrome/installer/util/delete_reg_value_work_item.h" 11 #include "chrome/installer/util/delete_reg_value_work_item.h"
12 #include "chrome/installer/util/move_tree_work_item.h" 12 #include "chrome/installer/util/move_tree_work_item.h"
13 #include "chrome/installer/util/self_reg_work_item.h" 13 #include "chrome/installer/util/self_reg_work_item.h"
14 #include "chrome/installer/util/set_reg_value_work_item.h" 14 #include "chrome/installer/util/set_reg_value_work_item.h"
15 #include "chrome/installer/util/work_item_list.h" 15 #include "chrome/installer/util/work_item_list.h"
16 16
17 WorkItem::WorkItem() { 17 WorkItem::WorkItem() {
18 } 18 }
19 19
20 WorkItem::~WorkItem() { 20 WorkItem::~WorkItem() {
21 } 21 }
22 22
23 CopyTreeWorkItem* WorkItem::CreateCopyTreeWorkItem( 23 CopyTreeWorkItem* WorkItem::CreateCopyTreeWorkItem(
24 std::wstring source_path, std::wstring dest_path, std::wstring temp_dir, 24 const std::wstring& source_path,
25 CopyOverWriteOption overwrite_option, std::wstring alternative_path) { 25 const std::wstring& dest_path,
26 const std::wstring& temp_dir,
27 CopyOverWriteOption overwrite_option,
28 const std::wstring& alternative_path) {
26 return new CopyTreeWorkItem(source_path, dest_path, temp_dir, 29 return new CopyTreeWorkItem(source_path, dest_path, temp_dir,
27 overwrite_option, alternative_path); 30 overwrite_option, alternative_path);
28 } 31 }
29 32
30 CreateDirWorkItem* WorkItem::CreateCreateDirWorkItem(std::wstring path) { 33 CreateDirWorkItem* WorkItem::CreateCreateDirWorkItem(const std::wstring& path) {
31 return new CreateDirWorkItem(path); 34 return new CreateDirWorkItem(path);
32 } 35 }
33 36
34 CreateRegKeyWorkItem* WorkItem::CreateCreateRegKeyWorkItem( 37 CreateRegKeyWorkItem* WorkItem::CreateCreateRegKeyWorkItem(
35 HKEY predefined_root, std::wstring path) { 38 HKEY predefined_root, const std::wstring& path) {
36 return new CreateRegKeyWorkItem(predefined_root, path); 39 return new CreateRegKeyWorkItem(predefined_root, path);
37 } 40 }
38 41
39 DeleteRegValueWorkItem* WorkItem::CreateDeleteRegValueWorkItem( 42 DeleteRegValueWorkItem* WorkItem::CreateDeleteRegValueWorkItem(
40 HKEY predefined_root, std::wstring key_path, 43 HKEY predefined_root,
41 std::wstring value_name, bool is_str_type) { 44 const std::wstring& key_path,
45 const std::wstring& value_name,
46 bool is_str_type) {
42 return new DeleteRegValueWorkItem(predefined_root, key_path, 47 return new DeleteRegValueWorkItem(predefined_root, key_path,
43 value_name, is_str_type); 48 value_name, is_str_type);
44 } 49 }
45 50
46 DeleteTreeWorkItem* WorkItem::CreateDeleteTreeWorkItem(std::wstring root_path, 51 DeleteTreeWorkItem* WorkItem::CreateDeleteTreeWorkItem(
47 std::wstring key_path) { 52 const std::wstring& root_path, const std::wstring& key_path) {
48 return new DeleteTreeWorkItem(root_path, key_path); 53 return new DeleteTreeWorkItem(root_path, key_path);
49 } 54 }
50 55
51 MoveTreeWorkItem* WorkItem::CreateMoveTreeWorkItem(std::wstring source_path, 56 MoveTreeWorkItem* WorkItem::CreateMoveTreeWorkItem(
52 std::wstring dest_path, 57 const std::wstring& source_path,
53 std::wstring temp_dir) { 58 const std::wstring& dest_path,
59 const std::wstring& temp_dir) {
54 return new MoveTreeWorkItem(source_path, dest_path, temp_dir); 60 return new MoveTreeWorkItem(source_path, dest_path, temp_dir);
55 } 61 }
56 62
57 SetRegValueWorkItem* WorkItem::CreateSetRegValueWorkItem( 63 SetRegValueWorkItem* WorkItem::CreateSetRegValueWorkItem(
58 HKEY predefined_root, std::wstring key_path, 64 HKEY predefined_root,
59 std::wstring value_name, std::wstring value_data, bool overwrite) { 65 const std::wstring& key_path,
66 const std::wstring& value_name,
67 const std::wstring& value_data,
68 bool overwrite) {
60 return new SetRegValueWorkItem(predefined_root, key_path, 69 return new SetRegValueWorkItem(predefined_root, key_path,
61 value_name, value_data, overwrite); 70 value_name, value_data, overwrite);
62 } 71 }
63 72
64 SetRegValueWorkItem* WorkItem::CreateSetRegValueWorkItem( 73 SetRegValueWorkItem* WorkItem::CreateSetRegValueWorkItem(
65 HKEY predefined_root, std::wstring key_path, 74 HKEY predefined_root,
66 std::wstring value_name, DWORD value_data, bool overwrite) { 75 const std::wstring& key_path,
76 const std::wstring& value_name,
77 DWORD value_data, bool overwrite) {
67 return new SetRegValueWorkItem(predefined_root, key_path, 78 return new SetRegValueWorkItem(predefined_root, key_path,
68 value_name, value_data, overwrite); 79 value_name, value_data, overwrite);
69 } 80 }
70 81
71 SelfRegWorkItem* WorkItem::CreateSelfRegWorkItem(const std::wstring& dll_path, 82 SelfRegWorkItem* WorkItem::CreateSelfRegWorkItem(const std::wstring& dll_path,
72 bool do_register) { 83 bool do_register) {
73 return new SelfRegWorkItem(dll_path, do_register); 84 return new SelfRegWorkItem(dll_path, do_register);
74 } 85 }
75 86
76 WorkItemList* WorkItem::CreateWorkItemList() { 87 WorkItemList* WorkItem::CreateWorkItemList() {
77 return new WorkItemList(); 88 return new WorkItemList();
78 } 89 }
79 90
80 std::wstring WorkItem::Dump() { 91 std::wstring WorkItem::Dump() {
81 return std::wstring(L"Work Item"); 92 return std::wstring(L"Work Item");
82 } 93 }
OLDNEW
« no previous file with comments | « chrome/installer/util/work_item.h ('k') | chrome/installer/util/work_item_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698