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

Unified Diff: chrome/browser/printing/print_dialog_cloud_uitest.cc

Issue 3872002: Thread IO safety: file_util annotated, IO thread blocked from doing IO (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 10 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/net/url_request_mock_util.cc ('k') | chrome/browser/service/service_process_control.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/printing/print_dialog_cloud_uitest.cc
diff --git a/chrome/browser/printing/print_dialog_cloud_uitest.cc b/chrome/browser/printing/print_dialog_cloud_uitest.cc
index 1cc446d950c94791c17420a67bf6b2223c4e041a..3b579611bd0464f8200f63489485b4408af32bb9 100644
--- a/chrome/browser/printing/print_dialog_cloud_uitest.cc
+++ b/chrome/browser/printing/print_dialog_cloud_uitest.cc
@@ -11,6 +11,7 @@
#include "base/file_util.h"
#include "base/path_service.h"
#include "base/singleton.h"
+#include "base/thread_restrictions.h"
#include "base/values.h"
#include "chrome/browser/browser_list.h"
#include "chrome/browser/browser_thread.h"
@@ -32,7 +33,11 @@ class TestData {
public:
TestData() {}
- char* GetTestData() {
+ const char* GetTestData() {
+ // Fetching this data blocks the IO thread, but we don't really care because
+ // this is a test.
+ base::ThreadRestrictions::ScopedAllowIO allow_io;
+
if (test_data_.empty()) {
FilePath test_data_directory;
PathService::Get(chrome::DIR_TEST_DATA, &test_data_directory);
@@ -40,7 +45,7 @@ class TestData {
test_data_directory.AppendASCII("printing/cloud_print_uitest.html");
file_util::ReadFileToString(test_file, &test_data_);
}
- return &test_data_[0];
+ return test_data_.c_str();
}
private:
std::string test_data_;
« no previous file with comments | « chrome/browser/net/url_request_mock_util.cc ('k') | chrome/browser/service/service_process_control.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698