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

Side by Side Diff: base/file_util_posix.cc

Issue 119289: Enable zygote manager by default. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 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 | base/logging.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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "base/file_util.h" 5 #include "base/file_util.h"
6 6
7 #include <dirent.h> 7 #include <dirent.h>
8 #include <errno.h> 8 #include <errno.h>
9 #include <fcntl.h> 9 #include <fcntl.h>
10 #include <fnmatch.h> 10 #include <fnmatch.h>
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 } 626 }
627 627
628 bool MemoryMappedFile::MapFileToMemory(const FilePath& file_name) { 628 bool MemoryMappedFile::MapFileToMemory(const FilePath& file_name) {
629 file_ = -1; 629 file_ = -1;
630 #if defined(OS_LINUX) 630 #if defined(OS_LINUX)
631 base::ZygoteManager* zm = base::ZygoteManager::Get(); 631 base::ZygoteManager* zm = base::ZygoteManager::Get();
632 if (zm) { 632 if (zm) {
633 file_ = zm->OpenFile(file_name.value().c_str()); 633 file_ = zm->OpenFile(file_name.value().c_str());
634 if (file_ == -1) { 634 if (file_ == -1) {
635 LOG(INFO) << "Zygote manager can't open " << file_name.value() 635 LOG(INFO) << "Zygote manager can't open " << file_name.value()
636 << ", retrying locally"; 636 << ", retrying locally. (OK at start of ui_tests.)";
637 } 637 }
638 } 638 }
639 #endif // defined(OS_LINUX) 639 #endif // defined(OS_LINUX)
640 if (file_ == -1) 640 if (file_ == -1)
641 file_ = open(file_name.value().c_str(), O_RDONLY); 641 file_ = open(file_name.value().c_str(), O_RDONLY);
642 if (file_ == -1) { 642 if (file_ == -1) {
643 LOG(ERROR) << "Couldn't open " << file_name.value(); 643 LOG(ERROR) << "Couldn't open " << file_name.value();
644 return false; 644 return false;
645 } 645 }
646 646
(...skipping 17 matching lines...) Expand all
664 munmap(data_, length_); 664 munmap(data_, length_);
665 if (file_ != -1) 665 if (file_ != -1)
666 close(file_); 666 close(file_);
667 667
668 data_ = NULL; 668 data_ = NULL;
669 length_ = 0; 669 length_ = 0;
670 file_ = -1; 670 file_ = -1;
671 } 671 }
672 672
673 } // namespace file_util 673 } // namespace file_util
OLDNEW
« no previous file with comments | « no previous file | base/logging.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698