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

Unified Diff: base/win/registry.cc

Issue 4431001: Revert 64960 - Turn on file access checks on Win.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/platform_file_win.cc ('k') | base/win_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/win/registry.cc
===================================================================
--- base/win/registry.cc (revision 64973)
+++ base/win/registry.cc (working copy)
@@ -7,7 +7,6 @@
#include <shlwapi.h>
#include "base/logging.h"
-#include "base/thread_restrictions.h"
#pragma comment(lib, "shlwapi.lib") // for SHDeleteKey
@@ -16,8 +15,6 @@
RegistryValueIterator::RegistryValueIterator(HKEY root_key,
const wchar_t* folder_key) {
- base::ThreadRestrictions::AssertIOAllowed();
-
LONG result = RegOpenKeyEx(root_key, folder_key, 0, KEY_READ, &key_);
if (result != ERROR_SUCCESS) {
key_ = NULL;
@@ -38,7 +35,6 @@
}
RegistryValueIterator::~RegistryValueIterator() {
- base::ThreadRestrictions::AssertIOAllowed();
if (key_)
::RegCloseKey(key_);
}
@@ -53,7 +49,6 @@
}
bool RegistryValueIterator::Read() {
- base::ThreadRestrictions::AssertIOAllowed();
if (Valid()) {
DWORD ncount = arraysize(name_);
value_size_ = sizeof(value_);
@@ -70,7 +65,6 @@
}
DWORD RegistryValueIterator::ValueCount() const {
- base::ThreadRestrictions::AssertIOAllowed();
DWORD count = 0;
HRESULT result = ::RegQueryInfoKey(key_, NULL, 0, NULL, NULL, NULL, NULL,
&count, NULL, NULL, NULL, NULL);
@@ -83,7 +77,6 @@
RegistryKeyIterator::RegistryKeyIterator(HKEY root_key,
const wchar_t* folder_key) {
- base::ThreadRestrictions::AssertIOAllowed();
LONG result = RegOpenKeyEx(root_key, folder_key, 0, KEY_READ, &key_);
if (result != ERROR_SUCCESS) {
key_ = NULL;
@@ -104,7 +97,6 @@
}
RegistryKeyIterator::~RegistryKeyIterator() {
- base::ThreadRestrictions::AssertIOAllowed();
if (key_)
::RegCloseKey(key_);
}
@@ -119,7 +111,6 @@
}
bool RegistryKeyIterator::Read() {
- base::ThreadRestrictions::AssertIOAllowed();
if (Valid()) {
DWORD ncount = arraysize(name_);
FILETIME written;
@@ -134,7 +125,6 @@
}
DWORD RegistryKeyIterator::SubkeyCount() const {
- base::ThreadRestrictions::AssertIOAllowed();
DWORD count = 0;
HRESULT result = ::RegQueryInfoKey(key_, NULL, 0, NULL, &count, NULL, NULL,
NULL, NULL, NULL, NULL, NULL);
@@ -153,7 +143,6 @@
RegKey::RegKey(HKEY rootkey, const wchar_t* subkey, REGSAM access)
: key_(NULL),
watch_event_(0) {
- base::ThreadRestrictions::AssertIOAllowed();
if (rootkey) {
if (access & (KEY_SET_VALUE | KEY_CREATE_SUB_KEY | KEY_CREATE_LINK))
Create(rootkey, subkey, access);
@@ -169,7 +158,6 @@
}
void RegKey::Close() {
- base::ThreadRestrictions::AssertIOAllowed();
StopWatching();
if (key_) {
::RegCloseKey(key_);
@@ -184,7 +172,6 @@
bool RegKey::CreateWithDisposition(HKEY rootkey, const wchar_t* subkey,
DWORD* disposition, REGSAM access) {
- base::ThreadRestrictions::AssertIOAllowed();
DCHECK(rootkey && subkey && access && disposition);
Close();
@@ -206,7 +193,6 @@
}
bool RegKey::Open(HKEY rootkey, const wchar_t* subkey, REGSAM access) {
- base::ThreadRestrictions::AssertIOAllowed();
DCHECK(rootkey && subkey && access);
Close();
@@ -219,7 +205,6 @@
}
bool RegKey::CreateKey(const wchar_t* name, REGSAM access) {
- base::ThreadRestrictions::AssertIOAllowed();
DCHECK(name && access);
HKEY subkey = NULL;
@@ -232,7 +217,6 @@
}
bool RegKey::OpenKey(const wchar_t* name, REGSAM access) {
- base::ThreadRestrictions::AssertIOAllowed();
DCHECK(name && access);
HKEY subkey = NULL;
@@ -245,7 +229,6 @@
}
DWORD RegKey::ValueCount() {
- base::ThreadRestrictions::AssertIOAllowed();
DWORD count = 0;
HRESULT result = RegQueryInfoKey(key_, NULL, 0, NULL, NULL, NULL,
NULL, &count, NULL, NULL, NULL, NULL);
@@ -253,7 +236,6 @@
}
bool RegKey::ReadName(int index, std::wstring* name) {
- base::ThreadRestrictions::AssertIOAllowed();
wchar_t buf[256];
DWORD bufsize = arraysize(buf);
LRESULT r = ::RegEnumValue(key_, index, buf, &bufsize, NULL, NULL,
@@ -266,7 +248,6 @@
}
bool RegKey::ValueExists(const wchar_t* name) {
- base::ThreadRestrictions::AssertIOAllowed();
if (!key_)
return false;
HRESULT result = RegQueryValueEx(key_, name, 0, NULL, NULL, NULL);
@@ -275,7 +256,6 @@
bool RegKey::ReadValue(const wchar_t* name, void* data,
DWORD* dsize, DWORD* dtype) {
- base::ThreadRestrictions::AssertIOAllowed();
if (!key_)
return false;
HRESULT result = RegQueryValueEx(key_, name, 0, dtype,
@@ -284,7 +264,6 @@
}
bool RegKey::ReadValue(const wchar_t* name, std::wstring* value) {
- base::ThreadRestrictions::AssertIOAllowed();
DCHECK(value);
const size_t kMaxStringLength = 1024; // This is after expansion.
// Use the one of the other forms of ReadValue if 1024 is too small for you.
@@ -329,7 +308,6 @@
bool RegKey::WriteValue(const wchar_t* name, const void * data,
DWORD dsize, DWORD dtype) {
- base::ThreadRestrictions::AssertIOAllowed();
DCHECK(data);
if (!key_)
@@ -356,12 +334,10 @@
}
bool RegKey::DeleteKey(const wchar_t* name) {
- base::ThreadRestrictions::AssertIOAllowed();
return (!key_) ? false : (ERROR_SUCCESS == SHDeleteKey(key_, name));
}
bool RegKey::DeleteValue(const wchar_t* value_name) {
- base::ThreadRestrictions::AssertIOAllowed();
DCHECK(value_name);
HRESULT result = RegDeleteValue(key_, value_name);
return (result == ERROR_SUCCESS);
« no previous file with comments | « base/platform_file_win.cc ('k') | base/win_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698