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

Side by Side Diff: components/feedback/feedback_data.cc

Issue 628273003: Clean up ifdef around FilePath creation in src/components (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 unified diff | Download patch
« 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/feedback/feedback_data.h" 5 #include "components/feedback/feedback_data.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/json/json_string_value_serializer.h" 9 #include "base/json/json_string_value_serializer.h"
10 #include "base/memory/ref_counted_memory.h" 10 #include "base/memory/ref_counted_memory.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 base::Bind(&FeedbackData::OnCompressComplete, this)); 85 base::Bind(&FeedbackData::OnCompressComplete, this));
86 } 86 }
87 87
88 void FeedbackData::AttachAndCompressFileData( 88 void FeedbackData::AttachAndCompressFileData(
89 scoped_ptr<std::string> attached_filedata) { 89 scoped_ptr<std::string> attached_filedata) {
90 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 90 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
91 91
92 if (!attached_filedata.get() || attached_filedata->empty()) 92 if (!attached_filedata.get() || attached_filedata->empty())
93 return; 93 return;
94 ++pending_op_count_; 94 ++pending_op_count_;
95 #if defined(OS_WIN) 95 base::FilePath attached_file =
96 base::FilePath attached_file(base::UTF8ToWide(attached_filename_)); 96 base::FilePath::FromUTF8Unsafe(attached_filename_);
97 #else
98 base::FilePath attached_file(attached_filename_);
99 #endif
100 BrowserThread::PostBlockingPoolTaskAndReply( 97 BrowserThread::PostBlockingPoolTaskAndReply(
101 FROM_HERE, 98 FROM_HERE,
102 base::Bind(&FeedbackCommon::CompressFile, 99 base::Bind(&FeedbackCommon::CompressFile,
103 this, 100 this,
104 attached_file, 101 attached_file,
105 std::string(), 102 std::string(),
106 base::Passed(&attached_filedata)), 103 base::Passed(&attached_filedata)),
107 base::Bind(&FeedbackData::OnCompressComplete, this)); 104 base::Bind(&FeedbackData::OnCompressComplete, this));
108 } 105 }
109 106
(...skipping 28 matching lines...) Expand all
138 135
139 void FeedbackData::SendReport() { 136 void FeedbackData::SendReport() {
140 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 137 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
141 if (IsDataComplete() && !report_sent_) { 138 if (IsDataComplete() && !report_sent_) {
142 report_sent_ = true; 139 report_sent_ = true;
143 send_report_.Run(this); 140 send_report_.Run(this);
144 } 141 }
145 } 142 }
146 143
147 } // namespace feedback 144 } // namespace feedback
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