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

Side by Side Diff: chrome/nacl/nacl_ipc_adapter_unittest.cc

Issue 15836003: Update chrome/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 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 | « chrome/nacl/nacl_ipc_adapter.cc ('k') | chrome/renderer/extensions/chrome_v8_context.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) 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 "chrome/nacl/nacl_ipc_adapter.h" 5 #include "chrome/nacl/nacl_ipc_adapter.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 explicit MyThread(NaClIPCAdapter* adapter) 279 explicit MyThread(NaClIPCAdapter* adapter)
280 : SimpleThread("NaClIPCAdapterThread"), 280 : SimpleThread("NaClIPCAdapterThread"),
281 adapter_(adapter) {} 281 adapter_(adapter) {}
282 virtual void Run() OVERRIDE { 282 virtual void Run() OVERRIDE {
283 base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(1)); 283 base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(1));
284 adapter_->OnChannelError(); 284 adapter_->OnChannelError();
285 } 285 }
286 private: 286 private:
287 scoped_refptr<NaClIPCAdapter> adapter_; 287 scoped_refptr<NaClIPCAdapter> adapter_;
288 }; 288 };
289 MyThread thread(adapter_); 289 MyThread thread(adapter_.get());
290 290
291 // IMPORTANT: do not return early from here down (including ASSERT_*) because 291 // IMPORTANT: do not return early from here down (including ASSERT_*) because
292 // the thread needs to joined or it will assert. 292 // the thread needs to joined or it will assert.
293 thread.Start(); 293 thread.Start();
294 294
295 // Request data. This will normally (modulo races) block until data is 295 // Request data. This will normally (modulo races) block until data is
296 // received or there is an error, and the thread above will wake us up 296 // received or there is an error, and the thread above will wake us up
297 // after 1s. 297 // after 1s.
298 const int kBufSize = 64; 298 const int kBufSize = 64;
299 char buf[kBufSize]; 299 char buf[kBufSize];
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 // back NACL_ABI_O_READONLY 335 // back NACL_ABI_O_READONLY
336 EXPECT_EQ(NACL_ABI_O_RDONLY, 336 EXPECT_EQ(NACL_ABI_O_RDONLY,
337 TranslatePepperFileReadWriteOpenFlagsForTesting(PP_FILEOPENFLAG_CREATE)); 337 TranslatePepperFileReadWriteOpenFlagsForTesting(PP_FILEOPENFLAG_CREATE));
338 EXPECT_EQ(NACL_ABI_O_RDONLY, 338 EXPECT_EQ(NACL_ABI_O_RDONLY,
339 TranslatePepperFileReadWriteOpenFlagsForTesting( 339 TranslatePepperFileReadWriteOpenFlagsForTesting(
340 PP_FILEOPENFLAG_TRUNCATE)); 340 PP_FILEOPENFLAG_TRUNCATE));
341 EXPECT_EQ(NACL_ABI_O_RDONLY, 341 EXPECT_EQ(NACL_ABI_O_RDONLY,
342 TranslatePepperFileReadWriteOpenFlagsForTesting( 342 TranslatePepperFileReadWriteOpenFlagsForTesting(
343 PP_FILEOPENFLAG_EXCLUSIVE)); 343 PP_FILEOPENFLAG_EXCLUSIVE));
344 } 344 }
OLDNEW
« no previous file with comments | « chrome/nacl/nacl_ipc_adapter.cc ('k') | chrome/renderer/extensions/chrome_v8_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698