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

Side by Side Diff: chrome/browser/dom_ui/shared_resources_data_source.cc

Issue 4222005: Turn on file access checks on Win. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Second try 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/browser_main.cc ('k') | chrome/browser/download/download_util.cc » ('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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/browser/dom_ui/shared_resources_data_source.h" 5 #include "chrome/browser/dom_ui/shared_resources_data_source.h"
6 6
7 #include "app/resource_bundle.h" 7 #include "app/resource_bundle.h"
8 #include "base/singleton.h" 8 #include "base/singleton.h"
9 #include "base/thread_restrictions.h"
9 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/browser_thread.h" 11 #include "chrome/browser/browser_thread.h"
11 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" 12 #include "chrome/browser/dom_ui/chrome_url_data_manager.h"
12 #include "chrome/browser/io_thread.h" 13 #include "chrome/browser/io_thread.h"
13 #include "chrome/common/url_constants.h" 14 #include "chrome/common/url_constants.h"
14 #include "grit/generated_resources.h" 15 #include "grit/generated_resources.h"
15 #include "grit/shared_resources.h" 16 #include "grit/shared_resources.h"
16 #include "grit/shared_resources_map.h" 17 #include "grit/shared_resources_map.h"
17 #include "grit/app_resources.h" 18 #include "grit/app_resources.h"
18 #include "grit/theme_resources.h" 19 #include "grit/theme_resources.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 int request_id) { 73 int request_id) {
73 int idr = PathToIDR(path); 74 int idr = PathToIDR(path);
74 DCHECK_NE(-1, idr); 75 DCHECK_NE(-1, idr);
75 const ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 76 const ResourceBundle& rb = ResourceBundle::GetSharedInstance();
76 scoped_refptr<RefCountedStaticMemory> bytes(rb.LoadDataResourceBytes(idr)); 77 scoped_refptr<RefCountedStaticMemory> bytes(rb.LoadDataResourceBytes(idr));
77 SendResponse(request_id, bytes); 78 SendResponse(request_id, bytes);
78 } 79 }
79 80
80 std::string SharedResourcesDataSource::GetMimeType( 81 std::string SharedResourcesDataSource::GetMimeType(
81 const std::string& path) const { 82 const std::string& path) const {
83 // Requests should not block on the disk! On Windows this goes to the
84 // registry.
85 // http://code.google.com/p/chromium/issues/detail?id=59849
86 base::ThreadRestrictions::ScopedAllowIO allow_io;
87
82 std::string mime_type; 88 std::string mime_type;
83 net::GetMimeTypeFromFile(FilePath().AppendASCII(path), &mime_type); 89 net::GetMimeTypeFromFile(FilePath().AppendASCII(path), &mime_type);
84 return mime_type; 90 return mime_type;
85 } 91 }
86 92
OLDNEW
« no previous file with comments | « chrome/browser/browser_main.cc ('k') | chrome/browser/download/download_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698