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

Side by Side Diff: chrome/test/chromedriver/session_commands.cc

Issue 99923002: Move temp file 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
« no previous file with comments | « chrome/service/service_utility_process_host.cc ('k') | chrome/test/perf/memory_test.cc » ('j') | 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "chrome/test/chromedriver/session_commands.h" 5 #include "chrome/test/chromedriver/session_commands.h"
6 6
7 #include <list> 7 #include <list>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 return Status(kUnknownError, "missing or invalid 'file'"); 585 return Status(kUnknownError, "missing or invalid 'file'");
586 std::string zip_data; 586 std::string zip_data;
587 if (!Base64Decode(base64_zip_data, &zip_data)) 587 if (!Base64Decode(base64_zip_data, &zip_data))
588 return Status(kUnknownError, "unable to decode 'file'"); 588 return Status(kUnknownError, "unable to decode 'file'");
589 589
590 if (!session->temp_dir.IsValid()) { 590 if (!session->temp_dir.IsValid()) {
591 if (!session->temp_dir.CreateUniqueTempDir()) 591 if (!session->temp_dir.CreateUniqueTempDir())
592 return Status(kUnknownError, "unable to create temp dir"); 592 return Status(kUnknownError, "unable to create temp dir");
593 } 593 }
594 base::FilePath upload_dir; 594 base::FilePath upload_dir;
595 if (!file_util::CreateTemporaryDirInDir( 595 if (!base::CreateTemporaryDirInDir(session->temp_dir.path(),
596 session->temp_dir.path(), FILE_PATH_LITERAL("upload"), &upload_dir)) { 596 FILE_PATH_LITERAL("upload"),
597 &upload_dir)) {
597 return Status(kUnknownError, "unable to create temp dir"); 598 return Status(kUnknownError, "unable to create temp dir");
598 } 599 }
599 std::string error_msg; 600 std::string error_msg;
600 base::FilePath upload; 601 base::FilePath upload;
601 Status status = UnzipSoleFile(upload_dir, zip_data, &upload); 602 Status status = UnzipSoleFile(upload_dir, zip_data, &upload);
602 if (status.IsError()) 603 if (status.IsError())
603 return Status(kUnknownError, "unable to unzip 'file'", status); 604 return Status(kUnknownError, "unable to unzip 'file'", status);
604 605
605 value->reset(new base::StringValue(upload.value())); 606 value->reset(new base::StringValue(upload.value()));
606 return Status(kOk); 607 return Status(kOk);
607 } 608 }
OLDNEW
« no previous file with comments | « chrome/service/service_utility_process_host.cc ('k') | chrome/test/perf/memory_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698