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

Side by Side Diff: content/child/blink_platform_impl.cc

Issue 1308823002: Move Singleton and related structs to namespace base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ToT Created 5 years, 3 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/child/blink_platform_impl.h" 5 #include "content/child/blink_platform_impl.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 private: 107 private:
108 scoped_ptr<base::WaitableEvent> impl_; 108 scoped_ptr<base::WaitableEvent> impl_;
109 DISALLOW_COPY_AND_ASSIGN(WebWaitableEventImpl); 109 DISALLOW_COPY_AND_ASSIGN(WebWaitableEventImpl);
110 }; 110 };
111 111
112 // A simple class to cache the memory usage for a given amount of time. 112 // A simple class to cache the memory usage for a given amount of time.
113 class MemoryUsageCache { 113 class MemoryUsageCache {
114 public: 114 public:
115 // Retrieves the Singleton. 115 // Retrieves the Singleton.
116 static MemoryUsageCache* GetInstance() { 116 static MemoryUsageCache* GetInstance() {
117 return Singleton<MemoryUsageCache>::get(); 117 return base::Singleton<MemoryUsageCache>::get();
118 } 118 }
119 119
120 MemoryUsageCache() : memory_value_(0) { Init(); } 120 MemoryUsageCache() : memory_value_(0) { Init(); }
121 ~MemoryUsageCache() {} 121 ~MemoryUsageCache() {}
122 122
123 void Init() { 123 void Init() {
124 const unsigned int kCacheSeconds = 1; 124 const unsigned int kCacheSeconds = 1;
125 cache_valid_time_ = base::TimeDelta::FromSeconds(kCacheSeconds); 125 cache_valid_time_ = base::TimeDelta::FromSeconds(kCacheSeconds);
126 } 126 }
127 127
(...skipping 1240 matching lines...) Expand 10 before | Expand all | Expand 10 after
1368 return WebString::fromUTF8(ui::KeycodeConverter::DomCodeToCodeString( 1368 return WebString::fromUTF8(ui::KeycodeConverter::DomCodeToCodeString(
1369 static_cast<ui::DomCode>(dom_code))); 1369 static_cast<ui::DomCode>(dom_code)));
1370 } 1370 }
1371 1371
1372 int BlinkPlatformImpl::domEnumFromCodeString(const WebString& code) { 1372 int BlinkPlatformImpl::domEnumFromCodeString(const WebString& code) {
1373 return static_cast<int>(ui::KeycodeConverter::CodeStringToDomCode( 1373 return static_cast<int>(ui::KeycodeConverter::CodeStringToDomCode(
1374 code.utf8().data())); 1374 code.utf8().data()));
1375 } 1375 }
1376 1376
1377 } // namespace content 1377 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/zygote_host/zygote_host_impl_linux.cc ('k') | content/child/child_io_surface_manager_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698