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

Side by Side Diff: ppapi/proxy/serialized_var_unittest.cc

Issue 915403003: Enable size_t to int truncation warnings in PPAPI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ppapi_unittests win x64 Created 5 years, 10 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 | « ppapi/proxy/raw_var_data_unittest.cc ('k') | ppapi/proxy/url_loader_resource.h » ('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 "ppapi/proxy/ppapi_proxy_test.h" 5 #include "ppapi/proxy/ppapi_proxy_test.h"
6 6
7 #include "ppapi/proxy/proxy_object_var.h" 7 #include "ppapi/proxy/proxy_object_var.h"
8 #include "ppapi/proxy/serialized_var.h" 8 #include "ppapi/proxy/serialized_var.h"
9 #include "ppapi/shared_impl/proxy_lock.h" 9 #include "ppapi/shared_impl/proxy_lock.h"
10 10
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 // ReceiveInputs keep the "track_with_no_reference_count" alive until 251 // ReceiveInputs keep the "track_with_no_reference_count" alive until
252 // they're destroyed. 252 // they're destroyed.
253 var_tracker().AddRefVar(plugin_objects[0]); 253 var_tracker().AddRefVar(plugin_objects[0]);
254 EXPECT_EQ(1, var_tracker().GetRefCountForObject(plugin_objects[0])); 254 EXPECT_EQ(1, var_tracker().GetRefCountForObject(plugin_objects[0]));
255 var_tracker().ReleaseVar(plugin_objects[0]); 255 var_tracker().ReleaseVar(plugin_objects[0]);
256 EXPECT_EQ(0, var_tracker().GetRefCountForObject(plugin_objects[0])); 256 EXPECT_EQ(0, var_tracker().GetRefCountForObject(plugin_objects[0]));
257 EXPECT_EQ(2u, sink().message_count()); 257 EXPECT_EQ(2u, sink().message_count());
258 258
259 // Take a reference to a string and then release it. Make sure no messages 259 // Take a reference to a string and then release it. Make sure no messages
260 // are sent. 260 // are sent.
261 uint32_t old_message_count = sink().message_count(); 261 uint32_t old_message_count = static_cast<uint32_t>(sink().message_count());
262 var_tracker().AddRefVar(plugin_objects[1]); 262 var_tracker().AddRefVar(plugin_objects[1]);
263 EXPECT_EQ(2, var_tracker().GetRefCountForObject(plugin_objects[1])); 263 EXPECT_EQ(2, var_tracker().GetRefCountForObject(plugin_objects[1]));
264 var_tracker().ReleaseVar(plugin_objects[1]); 264 var_tracker().ReleaseVar(plugin_objects[1]);
265 EXPECT_EQ(1, var_tracker().GetRefCountForObject(plugin_objects[1])); 265 EXPECT_EQ(1, var_tracker().GetRefCountForObject(plugin_objects[1]));
266 EXPECT_EQ(old_message_count, sink().message_count()); 266 EXPECT_EQ(old_message_count, sink().message_count());
267 } 267 }
268 268
269 // Since we didn't keep any refs to the objects or strings, so they should 269 // Since we didn't keep any refs to the objects or strings, so they should
270 // have been freed. 270 // have been freed.
271 EXPECT_EQ(-1, var_tracker().GetRefCountForObject(plugin_objects[0])); 271 EXPECT_EQ(-1, var_tracker().GetRefCountForObject(plugin_objects[0]));
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 } 378 }
379 379
380 // When the ReturnValue object goes out of scope, it should have sent a 380 // When the ReturnValue object goes out of scope, it should have sent a
381 // release message to the browser. 381 // release message to the browser.
382 EXPECT_EQ(-1, var_tracker().GetRefCountForObject(plugin_object)); 382 EXPECT_EQ(-1, var_tracker().GetRefCountForObject(plugin_object));
383 EXPECT_EQ(1u, sink().message_count()); 383 EXPECT_EQ(1u, sink().message_count());
384 } 384 }
385 385
386 } // namespace proxy 386 } // namespace proxy
387 } // namespace ppapi 387 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/raw_var_data_unittest.cc ('k') | ppapi/proxy/url_loader_resource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698