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

Side by Side Diff: mojo/embedder/simple_platform_shared_buffer_win.cc

Issue 610083002: Mojo: Convert some scoped_ptr<...>(new ...) to make_scoped_ptr(new ...) in mojo/{embedder,system}. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: missed a few Created 6 years, 2 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
« no previous file with comments | « mojo/embedder/simple_platform_shared_buffer_posix.cc ('k') | mojo/embedder/test_embedder.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "mojo/embedder/simple_platform_shared_buffer.h" 5 #include "mojo/embedder/simple_platform_shared_buffer.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include <limits> 9 #include <limits>
10 10
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 FILE_MAP_READ | FILE_MAP_WRITE, 72 FILE_MAP_READ | FILE_MAP_WRITE,
73 0, 73 0,
74 static_cast<DWORD>(real_offset), 74 static_cast<DWORD>(real_offset),
75 real_length); 75 real_length);
76 if (!real_base) { 76 if (!real_base) {
77 PLOG(ERROR) << "MapViewOfFile"; 77 PLOG(ERROR) << "MapViewOfFile";
78 return scoped_ptr<PlatformSharedBufferMapping>(); 78 return scoped_ptr<PlatformSharedBufferMapping>();
79 } 79 }
80 80
81 void* base = static_cast<char*>(real_base) + offset_rounding; 81 void* base = static_cast<char*>(real_base) + offset_rounding;
82 return scoped_ptr<PlatformSharedBufferMapping>( 82 return make_scoped_ptr(new SimplePlatformSharedBufferMapping(
83 new SimplePlatformSharedBufferMapping( 83 base, length, real_base, real_length));
84 base, length, real_base, real_length));
85 } 84 }
86 85
87 // SimplePlatformSharedBufferMapping ------------------------------------------- 86 // SimplePlatformSharedBufferMapping -------------------------------------------
88 87
89 void SimplePlatformSharedBufferMapping::Unmap() { 88 void SimplePlatformSharedBufferMapping::Unmap() {
90 BOOL result = UnmapViewOfFile(real_base_); 89 BOOL result = UnmapViewOfFile(real_base_);
91 PLOG_IF(ERROR, !result) << "UnmapViewOfFile"; 90 PLOG_IF(ERROR, !result) << "UnmapViewOfFile";
92 } 91 }
93 92
94 } // namespace embedder 93 } // namespace embedder
95 } // namespace mojo 94 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/embedder/simple_platform_shared_buffer_posix.cc ('k') | mojo/embedder/test_embedder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698