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

Side by Side Diff: third_party/WebKit/Source/core/inspector/IdentifiersFactory.cpp

Issue 2800213002: Avoid duplicate functions/code in core/inspector.
Patch Set: Manual inlined urlWithoutFragment Created 3 years, 4 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 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 return AddProcessIdPrefixTo(identifier); 47 return AddProcessIdPrefixTo(identifier);
48 } 48 }
49 49
50 // static 50 // static
51 String IdentifiersFactory::RequestId(unsigned long identifier) { 51 String IdentifiersFactory::RequestId(unsigned long identifier) {
52 return identifier ? AddProcessIdPrefixTo(identifier) : String(); 52 return identifier ? AddProcessIdPrefixTo(identifier) : String();
53 } 53 }
54 54
55 // static 55 // static
56 String IdentifiersFactory::FrameId(LocalFrame* frame) { 56 String IdentifiersFactory::FrameId(LocalFrame* frame) {
57 if (!frame)
58 return String();
57 return AddProcessIdPrefixTo(WeakIdentifierMap<LocalFrame>::Identifier(frame)); 59 return AddProcessIdPrefixTo(WeakIdentifierMap<LocalFrame>::Identifier(frame));
58 } 60 }
59 61
60 // static 62 // static
61 LocalFrame* IdentifiersFactory::FrameById(InspectedFrames* inspected_frames, 63 LocalFrame* IdentifiersFactory::FrameById(InspectedFrames* inspected_frames,
62 const String& frame_id) { 64 const String& frame_id) {
63 bool ok; 65 bool ok;
64 int id = RemoveProcessIdPrefixFrom(frame_id, &ok); 66 int id = RemoveProcessIdPrefixFrom(frame_id, &ok);
65 if (!ok) 67 if (!ok)
66 return nullptr; 68 return nullptr;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 size_t dot_index = id.find('.'); 107 size_t dot_index = id.find('.');
106 108
107 if (dot_index == kNotFound) { 109 if (dot_index == kNotFound) {
108 *ok = false; 110 *ok = false;
109 return 0; 111 return 0;
110 } 112 }
111 return id.Substring(dot_index + 1).ToInt(ok); 113 return id.Substring(dot_index + 1).ToInt(ok);
112 } 114 }
113 115
114 } // namespace blink 116 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/inspector/BUILD.gn ('k') | third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698