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

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

Issue 19052005: Move PathIsWritable, DirectoryExists, ContentsEqual, and TextContentsEqual to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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
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/base64.h" 9 #include "base/base64.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 if (!web_view) 341 if (!web_view)
342 return; 342 return;
343 343
344 WebViewBenchmarkSupport* benchmark_support = web_view->benchmarkSupport(); 344 WebViewBenchmarkSupport* benchmark_support = web_view->benchmarkSupport();
345 if (!benchmark_support) 345 if (!benchmark_support)
346 return; 346 return;
347 347
348 base::FilePath dirpath( 348 base::FilePath dirpath(
349 base::FilePath::StringType(*dirname, *dirname + dirname.length())); 349 base::FilePath::StringType(*dirname, *dirname + dirname.length()));
350 if (!file_util::CreateDirectory(dirpath) || 350 if (!file_util::CreateDirectory(dirpath) ||
351 !file_util::PathIsWritable(dirpath)) { 351 !base::PathIsWritable(dirpath)) {
352 std::string msg("Path is not writable: "); 352 std::string msg("Path is not writable: ");
353 msg.append(dirpath.MaybeAsASCII()); 353 msg.append(dirpath.MaybeAsASCII());
354 v8::ThrowException(v8::Exception::Error( 354 v8::ThrowException(v8::Exception::Error(
355 v8::String::New(msg.c_str(), msg.length()))); 355 v8::String::New(msg.c_str(), msg.length())));
356 return; 356 return;
357 } 357 }
358 358
359 SkPictureRecorder recorder(dirpath); 359 SkPictureRecorder recorder(dirpath);
360 benchmark_support->paint(&recorder, 360 benchmark_support->paint(&recorder,
361 WebViewBenchmarkSupport::PaintModeEverything); 361 WebViewBenchmarkSupport::PaintModeEverything);
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 const v8::FunctionCallbackInfo<v8::Value>& args) { 580 const v8::FunctionCallbackInfo<v8::Value>& args) {
581 WebImageCache::clear(); 581 WebImageCache::clear();
582 } 582 }
583 }; 583 };
584 584
585 v8::Extension* GpuBenchmarkingExtension::Get() { 585 v8::Extension* GpuBenchmarkingExtension::Get() {
586 return new GpuBenchmarkingWrapper(); 586 return new GpuBenchmarkingWrapper();
587 } 587 }
588 588
589 } // namespace content 589 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698