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

Side by Side Diff: base/debug/activity_tracker_unittest.cc

Issue 2753573002: Remove 'global' user-data in favor of 'process' user-data. (Closed)
Patch Set: rebased Created 3 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
« no previous file with comments | « base/debug/activity_tracker.cc ('k') | chrome/browser/chrome_browser_field_trials_desktop.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "base/debug/activity_tracker.h" 5 #include "base/debug/activity_tracker.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/files/file.h" 10 #include "base/files/file.h"
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 299
300 300
301 // GlobalActivityTracker tests below. 301 // GlobalActivityTracker tests below.
302 302
303 TEST_F(ActivityTrackerTest, BasicTest) { 303 TEST_F(ActivityTrackerTest, BasicTest) {
304 GlobalActivityTracker::CreateWithLocalMemory(kMemorySize, 0, "", 3, 0); 304 GlobalActivityTracker::CreateWithLocalMemory(kMemorySize, 0, "", 3, 0);
305 GlobalActivityTracker* global = GlobalActivityTracker::Get(); 305 GlobalActivityTracker* global = GlobalActivityTracker::Get();
306 306
307 // Ensure the data repositories have backing store, indicated by non-zero ID. 307 // Ensure the data repositories have backing store, indicated by non-zero ID.
308 EXPECT_NE(0U, global->process_data().id()); 308 EXPECT_NE(0U, global->process_data().id());
309 EXPECT_NE(0U, global->global_data().id());
310 EXPECT_NE(global->process_data().id(), global->global_data().id());
311 } 309 }
312 310
313 class SimpleActivityThread : public SimpleThread { 311 class SimpleActivityThread : public SimpleThread {
314 public: 312 public:
315 SimpleActivityThread(const std::string& name, 313 SimpleActivityThread(const std::string& name,
316 const void* origin, 314 const void* origin,
317 Activity::Type activity, 315 Activity::Type activity,
318 const ActivityData& data) 316 const ActivityData& data)
319 : SimpleThread(name, Options()), 317 : SimpleThread(name, Options()),
320 origin_(origin), 318 origin_(origin),
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 global->allocator()->ChangeType( 491 global->allocator()->ChangeType(
494 tracker_ref, GlobalActivityTracker::kTypeIdActivityTracker, 492 tracker_ref, GlobalActivityTracker::kTypeIdActivityTracker,
495 GlobalActivityTracker::kTypeIdActivityTrackerFree, false); 493 GlobalActivityTracker::kTypeIdActivityTrackerFree, false);
496 global->allocator()->ChangeType( 494 global->allocator()->ChangeType(
497 user_data_ref, GlobalActivityTracker::kTypeIdUserDataRecord, 495 user_data_ref, GlobalActivityTracker::kTypeIdUserDataRecord,
498 GlobalActivityTracker::kTypeIdUserDataRecordFree, false); 496 GlobalActivityTracker::kTypeIdUserDataRecordFree, false);
499 } 497 }
500 498
501 } // namespace debug 499 } // namespace debug
502 } // namespace base 500 } // namespace base
OLDNEW
« no previous file with comments | « base/debug/activity_tracker.cc ('k') | chrome/browser/chrome_browser_field_trials_desktop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698