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

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

Issue 2132673002: Adding Navigation Throttles to DevTools (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed frameID Created 4 years, 5 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 <memory> 9 #include <memory>
10 #include <vector> 10 #include <vector>
(...skipping 962 matching lines...) Expand 10 before | Expand all | Expand 10 after
973 // limit at 16M pixels, which is a desirable value since 4K*4K is a relatively 973 // limit at 16M pixels, which is a desirable value since 4K*4K is a relatively
974 // common texture size. 974 // common texture size.
975 return base::SysInfo::AmountOfPhysicalMemory() / 25; 975 return base::SysInfo::AmountOfPhysicalMemory() / 25;
976 #else 976 #else
977 return noDecodedImageByteLimit; 977 return noDecodedImageByteLimit;
978 #endif 978 #endif
979 } 979 }
980 980
981 uint32_t BlinkPlatformImpl::getUniqueIdForProcess() { 981 uint32_t BlinkPlatformImpl::getUniqueIdForProcess() {
982 // TODO(rickyz): Replace this with base::GetUniqueIdForProcess when that's 982 // TODO(rickyz): Replace this with base::GetUniqueIdForProcess when that's
983 // ready. 983 // ready. Keep PageNavigationThrottle::GetFrameId in sync with this.
dgozman 2016/07/08 19:20:00 Not relevant anymore.
alex clarke (OOO till 29th) 2016/07/08 20:55:37 Done.
984 return base::trace_event::TraceLog::GetInstance()->process_id(); 984 return base::trace_event::TraceLog::GetInstance()->process_id();
985 } 985 }
986 986
987 bool BlinkPlatformImpl::IsMainThread() const { 987 bool BlinkPlatformImpl::IsMainThread() const {
988 return main_thread_task_runner_.get() && 988 return main_thread_task_runner_.get() &&
989 main_thread_task_runner_->BelongsToCurrentThread(); 989 main_thread_task_runner_->BelongsToCurrentThread();
990 } 990 }
991 991
992 WebString BlinkPlatformImpl::domCodeStringFromEnum(int dom_code) { 992 WebString BlinkPlatformImpl::domCodeStringFromEnum(int dom_code) {
993 return WebString::fromUTF8(ui::KeycodeConverter::DomCodeToCodeString( 993 return WebString::fromUTF8(ui::KeycodeConverter::DomCodeToCodeString(
994 static_cast<ui::DomCode>(dom_code))); 994 static_cast<ui::DomCode>(dom_code)));
995 } 995 }
996 996
997 int BlinkPlatformImpl::domEnumFromCodeString(const WebString& code) { 997 int BlinkPlatformImpl::domEnumFromCodeString(const WebString& code) {
998 return static_cast<int>(ui::KeycodeConverter::CodeStringToDomCode( 998 return static_cast<int>(ui::KeycodeConverter::CodeStringToDomCode(
999 code.utf8())); 999 code.utf8()));
1000 } 1000 }
1001 1001
1002 WebString BlinkPlatformImpl::domKeyStringFromEnum(int dom_key) { 1002 WebString BlinkPlatformImpl::domKeyStringFromEnum(int dom_key) {
1003 return WebString::fromUTF8(ui::KeycodeConverter::DomKeyToKeyString( 1003 return WebString::fromUTF8(ui::KeycodeConverter::DomKeyToKeyString(
1004 static_cast<ui::DomKey>(dom_key))); 1004 static_cast<ui::DomKey>(dom_key)));
1005 } 1005 }
1006 1006
1007 int BlinkPlatformImpl::domKeyEnumFromString(const WebString& key_string) { 1007 int BlinkPlatformImpl::domKeyEnumFromString(const WebString& key_string) {
1008 return static_cast<int>( 1008 return static_cast<int>(
1009 ui::KeycodeConverter::KeyStringToDomKey(key_string.utf8())); 1009 ui::KeycodeConverter::KeyStringToDomKey(key_string.utf8()));
1010 } 1010 }
1011 1011
1012 } // namespace content 1012 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698