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 "components/devtools_remote_frontend/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"; | |
|
pfeldman
2013/06/20 12:37:11
I don't think such component should exist at all.
mnaganov (inactive)
2013/06/20 16:48:08
OK, removed.
| |
| 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"; | |
| 18 const char kServerSocketNameFormat[] = "%s_%s"; | |
| 19 | |
| 20 } | |
| 21 | |
| 22 namespace devtools_remote_frontend { | |
| 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 devtools_remote_frontend | |
| OLD | NEW |