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

Side by Side Diff: content/common/sandbox_mac_fontloading_unittest.mm

Issue 14081010: Cleanup: Remove unnecessary ".get()" from scoped_ptrs<>. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix some gtk issues 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
« no previous file with comments | « content/common/resource_messages.cc ('k') | content/common/sandbox_mac_unittest_helper.mm » ('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) 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 #import <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/mac/scoped_cftyperef.h" 9 #include "base/mac/scoped_cftyperef.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 26 matching lines...) Expand all
37 return false; 37 return false;
38 } 38 }
39 39
40 font_data_length_ = font_data.length(); 40 font_data_length_ = font_data.length();
41 if (font_data_length_ <= 0) { 41 if (font_data_length_ <= 0) {
42 LOG(ERROR) << "No font data: " << font_data_length_; 42 LOG(ERROR) << "No font data: " << font_data_length_;
43 return false; 43 return false;
44 } 44 }
45 45
46 font_shmem_.reset(new base::SharedMemory); 46 font_shmem_.reset(new base::SharedMemory);
47 if (!font_shmem_.get()) { 47 if (!font_shmem_) {
48 LOG(ERROR) << "Failed to create shared memory object."; 48 LOG(ERROR) << "Failed to create shared memory object.";
49 return false; 49 return false;
50 } 50 }
51 51
52 if (!font_shmem_->CreateAndMapAnonymous(font_data_length_)) { 52 if (!font_shmem_->CreateAndMapAnonymous(font_data_length_)) {
53 LOG(ERROR) << "SharedMemory::Create failed"; 53 LOG(ERROR) << "SharedMemory::Create failed";
54 return false; 54 return false;
55 } 55 }
56 56
57 memcpy(font_shmem_->memory(), font_data.c_str(), font_data_length_); 57 memcpy(font_shmem_->memory(), font_data.c_str(), font_data_length_);
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 static_cast<const char *>(result.font_data.memory()), 119 static_cast<const char *>(result.font_data.memory()),
120 result.font_data_size); 120 result.font_data_size);
121 121
122 ASSERT_TRUE(RunTestInSandbox(SANDBOX_TYPE_RENDERER, 122 ASSERT_TRUE(RunTestInSandbox(SANDBOX_TYPE_RENDERER,
123 "FontLoadingTestCase", temp_file_path.value().c_str())); 123 "FontLoadingTestCase", temp_file_path.value().c_str()));
124 temp_file_closer.reset(); 124 temp_file_closer.reset();
125 ASSERT_TRUE(file_util::Delete(temp_file_path, false)); 125 ASSERT_TRUE(file_util::Delete(temp_file_path, false));
126 } 126 }
127 127
128 } // namespace content 128 } // namespace content
OLDNEW
« no previous file with comments | « content/common/resource_messages.cc ('k') | content/common/sandbox_mac_unittest_helper.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698