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

Side by Side Diff: chromeos/dbus/session_manager_client.cc

Issue 184563006: Move WriteFile and WriteFileDescriptor from file_util to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 "chromeos/dbus/session_manager_client.h" 5 #include "chromeos/dbus/session_manager_client.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 callback.Run(true); 604 callback.Run(true);
605 } 605 }
606 virtual void SetFlagsForUser(const std::string& username, 606 virtual void SetFlagsForUser(const std::string& username,
607 const std::vector<std::string>& flags) OVERRIDE { 607 const std::vector<std::string>& flags) OVERRIDE {
608 } 608 }
609 609
610 static void StoreFileInBackground(const base::FilePath& path, 610 static void StoreFileInBackground(const base::FilePath& path,
611 const std::string& data) { 611 const std::string& data) {
612 const int size = static_cast<int>(data.size()); 612 const int size = static_cast<int>(data.size());
613 if (!base::CreateDirectory(path.DirName()) || 613 if (!base::CreateDirectory(path.DirName()) ||
614 file_util::WriteFile(path, data.data(), size) != size) { 614 base::WriteFile(path, data.data(), size) != size) {
615 LOG(WARNING) << "Failed to write policy key to " << path.value(); 615 LOG(WARNING) << "Failed to write policy key to " << path.value();
616 } 616 }
617 } 617 }
618 618
619 private: 619 private:
620 ObserverList<Observer> observers_; 620 ObserverList<Observer> observers_;
621 std::string device_policy_; 621 std::string device_policy_;
622 std::map<std::string, std::string> user_policies_; 622 std::map<std::string, std::string> user_policies_;
623 623
624 DISALLOW_COPY_AND_ASSIGN(SessionManagerClientStubImpl); 624 DISALLOW_COPY_AND_ASSIGN(SessionManagerClientStubImpl);
625 }; 625 };
626 626
627 SessionManagerClient::SessionManagerClient() { 627 SessionManagerClient::SessionManagerClient() {
628 } 628 }
629 629
630 SessionManagerClient::~SessionManagerClient() { 630 SessionManagerClient::~SessionManagerClient() {
631 } 631 }
632 632
633 SessionManagerClient* SessionManagerClient::Create( 633 SessionManagerClient* SessionManagerClient::Create(
634 DBusClientImplementationType type) { 634 DBusClientImplementationType type) {
635 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) 635 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION)
636 return new SessionManagerClientImpl(); 636 return new SessionManagerClientImpl();
637 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); 637 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type);
638 return new SessionManagerClientStubImpl(); 638 return new SessionManagerClientStubImpl();
639 } 639 }
640 640
641 } // namespace chromeos 641 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/cros_disks_client.cc ('k') | chromeos/process_proxy/process_output_watcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698