diff options
author | Ben Murdoch <benm@google.com> | 2010-11-25 19:40:10 +0000 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2010-12-03 13:52:53 +0000 |
commit | 4a5e2dc747d50c653511c68ccb2cfbfb740bd5a7 (patch) | |
tree | 938665d93a11fe7a6d0124e3c1e020d1f9d3f947 /chrome/common/extensions/extension_resource.cc | |
parent | 7c627d87728a355737862918d144f98f69406954 (diff) | |
download | external_chromium-4a5e2dc747d50c653511c68ccb2cfbfb740bd5a7.zip external_chromium-4a5e2dc747d50c653511c68ccb2cfbfb740bd5a7.tar.gz external_chromium-4a5e2dc747d50c653511c68ccb2cfbfb740bd5a7.tar.bz2 |
Merge Chromium at r66597: Initial merge by git.
Change-Id: I9639f8a997f90ec219573aa22a49f5dbde78cc7b
Diffstat (limited to 'chrome/common/extensions/extension_resource.cc')
-rw-r--r-- | chrome/common/extensions/extension_resource.cc | 34 |
1 files changed, 3 insertions, 31 deletions
diff --git a/chrome/common/extensions/extension_resource.cc b/chrome/common/extensions/extension_resource.cc index be22ec9..258b537 100644 --- a/chrome/common/extensions/extension_resource.cc +++ b/chrome/common/extensions/extension_resource.cc @@ -8,10 +8,6 @@ #include "base/logging.h" #include "base/thread_restrictions.h" -PlatformThreadId ExtensionResource::file_thread_id_ = 0; - -bool ExtensionResource::check_for_file_thread_ = false; - ExtensionResource::ExtensionResource() { } @@ -23,7 +19,7 @@ ExtensionResource::ExtensionResource(const std::string& extension_id, relative_path_(relative_path) { } -const FilePath& ExtensionResource::GetFilePathOnAnyThreadHack() const { +const FilePath& ExtensionResource::GetFilePath() const { if (extension_root_.empty() || relative_path_.empty()) { DCHECK(full_resource_path_.empty()); return full_resource_path_; @@ -34,24 +30,13 @@ const FilePath& ExtensionResource::GetFilePathOnAnyThreadHack() const { return full_resource_path_; full_resource_path_ = - GetFilePathOnAnyThreadHack(extension_root_, relative_path_); + GetFilePath(extension_root_, relative_path_); return full_resource_path_; } -const FilePath& ExtensionResource::GetFilePath() const { - ExtensionResource::CheckFileAccessFromFileThread(); - return GetFilePathOnAnyThreadHack(); -} - // static -FilePath ExtensionResource::GetFilePathOnAnyThreadHack( +FilePath ExtensionResource::GetFilePath( const FilePath& extension_root, const FilePath& relative_path) { - // This function is a hack, and causes us to block the IO thread. - // Fixing - // http://code.google.com/p/chromium/issues/detail?id=59849 - // would also fix this. Suppress the error for now. - base::ThreadRestrictions::ScopedAllowIO allow_io; - // We need to resolve the parent references in the extension_root // path on its own because IsParent doesn't like parent references. FilePath clean_extension_root(extension_root); @@ -76,19 +61,6 @@ FilePath ExtensionResource::GetFilePathOnAnyThreadHack( return FilePath(); } -// static -FilePath ExtensionResource::GetFilePath( - const FilePath& extension_root, const FilePath& relative_path) { - CheckFileAccessFromFileThread(); - return GetFilePathOnAnyThreadHack(extension_root, relative_path); -} - -// static -void ExtensionResource::CheckFileAccessFromFileThread() { - DCHECK(!check_for_file_thread_ || - file_thread_id_ == PlatformThread::CurrentId()); -} - // Unit-testing helpers. FilePath::StringType ExtensionResource::NormalizeSeperators( FilePath::StringType path) const { |