| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |