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

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

Issue 10271017: Add scopedallowIO for google chrome specific registry access. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/google_update_settings.h" 5 #include "chrome/installer/util/google_update_settings.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 } 122 }
123 123
124 bool GetChromeChannelInternal(bool system_install, 124 bool GetChromeChannelInternal(bool system_install,
125 bool add_multi_modifier, 125 bool add_multi_modifier,
126 string16* channel) { 126 string16* channel) {
127 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); 127 BrowserDistribution* dist = BrowserDistribution::GetDistribution();
128 if (dist->GetChromeChannel(channel)) { 128 if (dist->GetChromeChannel(channel)) {
129 return true; 129 return true;
130 } 130 }
131 131
132 // The registry functions below will end up going to disk. Do this on another
133 // thread to avoid slowing the IO thread. http://crbug.com/62121
134 base::ThreadRestrictions::ScopedAllowIO allow_io;
135
132 HKEY root_key = system_install ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; 136 HKEY root_key = system_install ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER;
133 string16 reg_path = dist->GetStateKey(); 137 string16 reg_path = dist->GetStateKey();
134 RegKey key(root_key, reg_path.c_str(), KEY_READ); 138 RegKey key(root_key, reg_path.c_str(), KEY_READ);
135 139
136 installer::ChannelInfo channel_info; 140 installer::ChannelInfo channel_info;
137 if (!channel_info.Initialize(key)) { 141 if (!channel_info.Initialize(key)) {
138 channel->assign(installer::kChromeChannelUnknown); 142 channel->assign(installer::kChromeChannelUnknown);
139 return false; 143 return false;
140 } 144 }
141 145
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 string16 cmd_line; 541 string16 cmd_line;
538 RegKey update_key; 542 RegKey update_key;
539 543
540 if (update_key.Open(root_key, google_update::kRegPathGoogleUpdate, 544 if (update_key.Open(root_key, google_update::kRegPathGoogleUpdate,
541 KEY_QUERY_VALUE) == ERROR_SUCCESS) { 545 KEY_QUERY_VALUE) == ERROR_SUCCESS) {
542 update_key.ReadValue(google_update::kRegUninstallCmdLine, &cmd_line); 546 update_key.ReadValue(google_update::kRegUninstallCmdLine, &cmd_line);
543 } 547 }
544 548
545 return cmd_line; 549 return cmd_line;
546 } 550 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698