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

Side by Side Diff: content/renderer/gpu/gpu_benchmarking_extension.cc

Issue 10832379: Initialize FilePath with FilePath::FilePath(string) instead of FilePath::AppendASCII(string). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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 | Annotate | Revision Log
« 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/renderer/gpu/gpu_benchmarking_extension.h" 5 #include "content/renderer/gpu/gpu_benchmarking_extension.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 return v8::Undefined(); 217 return v8::Undefined();
218 218
219 WebView* web_view = web_frame->view(); 219 WebView* web_view = web_frame->view();
220 if (!web_view) 220 if (!web_view)
221 return v8::Undefined(); 221 return v8::Undefined();
222 222
223 WebViewBenchmarkSupport* benchmark_support = web_view->benchmarkSupport(); 223 WebViewBenchmarkSupport* benchmark_support = web_view->benchmarkSupport();
224 if (!benchmark_support) 224 if (!benchmark_support)
225 return v8::Undefined(); 225 return v8::Undefined();
226 226
227 FilePath dirpath; 227 FilePath dirpath(FilePath::StringType(*dirname,
228 dirpath = dirpath.AppendASCII(*dirname); 228 *dirname + dirname.length()));
229 if (!file_util::CreateDirectory(dirpath) || 229 if (!file_util::CreateDirectory(dirpath) ||
230 !file_util::PathIsWritable(dirpath)) { 230 !file_util::PathIsWritable(dirpath)) {
231 std::string msg("Path is not writable: "); 231 std::string msg("Path is not writable: ");
232 msg.append(dirpath.MaybeAsASCII()); 232 msg.append(dirpath.MaybeAsASCII());
233 return v8::ThrowException(v8::Exception::Error( 233 return v8::ThrowException(v8::Exception::Error(
234 v8::String::New(msg.c_str(), msg.length()))); 234 v8::String::New(msg.c_str(), msg.length())));
235 } 235 }
236 236
237 SkPictureRecorder recorder(dirpath); 237 SkPictureRecorder recorder(dirpath);
238 benchmark_support->paint(&recorder, 238 benchmark_support->paint(&recorder,
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 312
313 return results.results_array(); 313 return results.results_array();
314 } 314 }
315 }; 315 };
316 316
317 v8::Extension* GpuBenchmarkingExtension::Get() { 317 v8::Extension* GpuBenchmarkingExtension::Get() {
318 return new GpuBenchmarkingWrapper(); 318 return new GpuBenchmarkingWrapper();
319 } 319 }
320 320
321 } // namespace content 321 } // namespace content
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