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

Side by Side Diff: remoting/host/win/elevated_controller.cc

Issue 13642007: Rewrite scoped_array<T> to scoped_ptr<T[]> in remoting/, Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Manually rewrite Win files. Created 7 years, 8 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 "remoting/host/win/elevated_controller.h" 5 #include "remoting/host/win/elevated_controller.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/file_version_info.h" 8 #include "base/file_version_info.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 FILE_FLAG_SEQUENTIAL_SCAN, 105 FILE_FLAG_SEQUENTIAL_SCAN,
106 NULL)); 106 NULL));
107 107
108 if (!file.IsValid()) { 108 if (!file.IsValid()) {
109 DWORD error = GetLastError(); 109 DWORD error = GetLastError();
110 LOG_GETLASTERROR(ERROR) 110 LOG_GETLASTERROR(ERROR)
111 << "Failed to open '" << filename.value() << "'"; 111 << "Failed to open '" << filename.value() << "'";
112 return HRESULT_FROM_WIN32(error); 112 return HRESULT_FROM_WIN32(error);
113 } 113 }
114 114
115 scoped_array<char> buffer(new char[kMaxConfigFileSize]); 115 scoped_ptr<char[]> buffer(new char[kMaxConfigFileSize]);
116 DWORD size = kMaxConfigFileSize; 116 DWORD size = kMaxConfigFileSize;
117 if (!::ReadFile(file, &buffer[0], size, &size, NULL)) { 117 if (!::ReadFile(file, &buffer[0], size, &size, NULL)) {
118 DWORD error = GetLastError(); 118 DWORD error = GetLastError();
119 LOG_GETLASTERROR(ERROR) 119 LOG_GETLASTERROR(ERROR)
120 << "Failed to read '" << filename.value() << "'"; 120 << "Failed to read '" << filename.value() << "'";
121 return HRESULT_FROM_WIN32(error); 121 return HRESULT_FROM_WIN32(error);
122 } 122 }
123 123
124 // Parse the JSON configuration, expecting it to contain a dictionary. 124 // Parse the JSON configuration, expecting it to contain a dictionary.
125 std::string file_content(buffer.get(), size); 125 std::string file_content(buffer.get(), size);
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 << "Failed to open to the '" << kWindowsServiceName << "' service"; 522 << "Failed to open to the '" << kWindowsServiceName << "' service";
523 523
524 return HRESULT_FROM_WIN32(error); 524 return HRESULT_FROM_WIN32(error);
525 } 525 }
526 526
527 service_out->Set(service.Take()); 527 service_out->Set(service.Take());
528 return S_OK; 528 return S_OK;
529 } 529 }
530 530
531 } // namespace remoting 531 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/verify_config_window_win.cc ('k') | remoting/host/win/launch_process_with_token.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698