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

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

Issue 100573002: Move directory creation functions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 GpuBenchmarkingContext context; 440 GpuBenchmarkingContext context;
441 if (!context.Init(true)) 441 if (!context.Init(true))
442 return; 442 return;
443 443
444 const cc::Layer* root_layer = context.compositor()->GetRootLayer(); 444 const cc::Layer* root_layer = context.compositor()->GetRootLayer();
445 if (!root_layer) 445 if (!root_layer)
446 return; 446 return;
447 447
448 base::FilePath dirpath( 448 base::FilePath dirpath(
449 base::FilePath::StringType(*dirname, *dirname + dirname.length())); 449 base::FilePath::StringType(*dirname, *dirname + dirname.length()));
450 if (!file_util::CreateDirectory(dirpath) || 450 if (!base::CreateDirectory(dirpath) ||
451 !base::PathIsWritable(dirpath)) { 451 !base::PathIsWritable(dirpath)) {
452 std::string msg("Path is not writable: "); 452 std::string msg("Path is not writable: ");
453 msg.append(dirpath.MaybeAsASCII()); 453 msg.append(dirpath.MaybeAsASCII());
454 v8::Isolate* isolate = args.GetIsolate(); 454 v8::Isolate* isolate = args.GetIsolate();
455 isolate->ThrowException(v8::Exception::Error(v8::String::NewFromUtf8( 455 isolate->ThrowException(v8::Exception::Error(v8::String::NewFromUtf8(
456 isolate, msg.c_str(), v8::String::kNormalString, msg.length()))); 456 isolate, msg.c_str(), v8::String::kNormalString, msg.length())));
457 return; 457 return;
458 } 458 }
459 459
460 SkPictureSerializer serializer(dirpath); 460 SkPictureSerializer serializer(dirpath);
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 GpuChannelHost* gpu_channel = RenderThreadImpl::current()->GetGpuChannel(); 737 GpuChannelHost* gpu_channel = RenderThreadImpl::current()->GetGpuChannel();
738 args.GetReturnValue().Set(!!gpu_channel); 738 args.GetReturnValue().Set(!!gpu_channel);
739 } 739 }
740 }; 740 };
741 741
742 v8::Extension* GpuBenchmarkingExtension::Get() { 742 v8::Extension* GpuBenchmarkingExtension::Get() {
743 return new GpuBenchmarkingWrapper(); 743 return new GpuBenchmarkingWrapper();
744 } 744 }
745 745
746 } // namespace content 746 } // namespace content
OLDNEW
« no previous file with comments | « content/common/sandbox_mac_diraccess_unittest.mm ('k') | content/shell/browser/shell_browser_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698