Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "content/public/browser/devtools_remote_frontend_util.h" | |
| 6 | |
| 7 #include "base/strings/stringprintf.h" | |
| 8 #include "googleurl/src/gurl.h" | |
| 9 #include "webkit/common/user_agent/user_agent_util.h" | |
| 10 | |
| 11 namespace { | |
| 12 | |
| 13 const char kRemoteFrontendDomain[] = "chrome-devtools-frontend.appspot.com"; | |
| 14 const char kRemoteFrontendBaseURL[] = "https://%s/%s"; | |
| 15 const char kRemoteFrontendMainURL[] = "https://%s/serve_rev/%s/devtools.html"; | |
| 16 | |
| 17 const char kServerSocketNameSuffix[] = "devtools_remote"; | |
|
pfeldman
2013/06/18 17:20:01
Does not belong to content imo.
mnaganov (inactive)
2013/06/19 10:53:55
OK, I've created a component for these functions a
| |
| 18 const char kServerSocketNameFormat[] = "%s_%s"; | |
| 19 | |
| 20 } | |
| 21 | |
| 22 namespace content { | |
| 23 | |
| 24 std::string GetDevToolsFrontendResourceURL(const std::string& path) { | |
| 25 return base::StringPrintf(kRemoteFrontendBaseURL, | |
| 26 kRemoteFrontendDomain, | |
| 27 path.c_str()); | |
| 28 } | |
| 29 | |
| 30 std::string GetDevToolsFrontendMainResourceURL() { | |
| 31 return base::StringPrintf(kRemoteFrontendMainURL, | |
| 32 kRemoteFrontendDomain, | |
| 33 webkit_glue::GetWebKitRevision().c_str()); | |
| 34 } | |
| 35 | |
| 36 bool IsDevToolsFrontendHost(const GURL& url) { | |
| 37 return url.host() == kRemoteFrontendDomain; | |
| 38 } | |
| 39 | |
| 40 std::string GetDevToolsServerSocketName(const std::string& prefix) { | |
| 41 return base::StringPrintf(kServerSocketNameFormat, | |
| 42 prefix.c_str(), | |
| 43 kServerSocketNameSuffix); | |
| 44 } | |
| 45 | |
| 46 std::string GetDevToolsServerSocketSuffix() { | |
| 47 return kServerSocketNameSuffix; | |
| 48 } | |
| 49 | |
| 50 } // namespace content | |
| OLD | NEW |