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

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: Add \n 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 1237 matching lines...) Expand 10 before | Expand all | Expand 10 after
1365 return WebString::fromUTF8(ui::KeycodeConverter::DomCodeToCodeString( 1365 return WebString::fromUTF8(ui::KeycodeConverter::DomCodeToCodeString(
1366 static_cast<ui::DomCode>(dom_code))); 1366 static_cast<ui::DomCode>(dom_code)));
1367 } 1367 }
1368 1368
1369 int BlinkPlatformImpl::domEnumFromCodeString(const WebString& code) { 1369 int BlinkPlatformImpl::domEnumFromCodeString(const WebString& code) {
1370 return static_cast<int>(ui::KeycodeConverter::CodeStringToDomCode( 1370 return static_cast<int>(ui::KeycodeConverter::CodeStringToDomCode(
1371 code.utf8().data())); 1371 code.utf8().data()));
1372 } 1372 }
1373 1373
1374 } // namespace content 1374 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698