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

Side by Side Diff: content/common/host_discardable_shared_memory_manager.cc

Issue 1094433002: base: Rename DiscardableMemory::Memory() to ::data(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mojo unittest Created 5 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
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 "content/common/host_discardable_shared_memory_manager.h" 5 #include "content/common/host_discardable_shared_memory_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/atomic_sequence_num.h" 9 #include "base/atomic_sequence_num.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 is_locked_ = true; 45 is_locked_ = true;
46 return true; 46 return true;
47 } 47 }
48 void Unlock() override { 48 void Unlock() override {
49 DCHECK(is_locked_); 49 DCHECK(is_locked_);
50 50
51 shared_memory_->Unlock(0, 0); 51 shared_memory_->Unlock(0, 0);
52 is_locked_ = false; 52 is_locked_ = false;
53 } 53 }
54 void* Memory() const override { 54 void* data() const override {
55 DCHECK(is_locked_); 55 DCHECK(is_locked_);
56 return shared_memory_->memory(); 56 return shared_memory_->memory();
57 } 57 }
58 58
59 private: 59 private:
60 scoped_ptr<base::DiscardableSharedMemory> shared_memory_; 60 scoped_ptr<base::DiscardableSharedMemory> shared_memory_;
61 const base::Closure deleted_callback_; 61 const base::Closure deleted_callback_;
62 bool is_locked_; 62 bool is_locked_;
63 63
64 DISALLOW_COPY_AND_ASSIGN(DiscardableMemoryImpl); 64 DISALLOW_COPY_AND_ASSIGN(DiscardableMemoryImpl);
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 390
391 enforce_memory_policy_pending_ = true; 391 enforce_memory_policy_pending_ = true;
392 base::MessageLoop::current()->PostDelayedTask( 392 base::MessageLoop::current()->PostDelayedTask(
393 FROM_HERE, 393 FROM_HERE,
394 base::Bind(&HostDiscardableSharedMemoryManager::EnforceMemoryPolicy, 394 base::Bind(&HostDiscardableSharedMemoryManager::EnforceMemoryPolicy,
395 weak_ptr_factory_.GetWeakPtr()), 395 weak_ptr_factory_.GetWeakPtr()),
396 base::TimeDelta::FromMilliseconds(kEnforceMemoryPolicyDelayMs)); 396 base::TimeDelta::FromMilliseconds(kEnforceMemoryPolicyDelayMs));
397 } 397 }
398 398
399 } // namespace content 399 } // namespace content
OLDNEW
« no previous file with comments | « content/child/web_discardable_memory_impl.cc ('k') | mojo/services/html_viewer/discardable_memory_allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698