Index: components/devtools_remote_frontend/devtools_remote_frontend_util.cc |
diff --git a/components/devtools_remote_frontend/devtools_remote_frontend_util.cc b/components/devtools_remote_frontend/devtools_remote_frontend_util.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..dae3873876a3e8fe101891d976ba99d8f682a750 |
--- /dev/null |
+++ b/components/devtools_remote_frontend/devtools_remote_frontend_util.cc |
@@ -0,0 +1,50 @@ |
+// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "components/devtools_remote_frontend/devtools_remote_frontend_util.h" |
+ |
+#include "base/strings/stringprintf.h" |
+#include "googleurl/src/gurl.h" |
+#include "webkit/common/user_agent/user_agent_util.h" |
+ |
+namespace { |
+ |
+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.
|
+const char kRemoteFrontendBaseURL[] = "https://%s/%s"; |
+const char kRemoteFrontendMainURL[] = "https://%s/serve_rev/%s/devtools.html"; |
+ |
+const char kServerSocketNameSuffix[] = "devtools_remote"; |
+const char kServerSocketNameFormat[] = "%s_%s"; |
+ |
+} |
+ |
+namespace devtools_remote_frontend { |
+ |
+std::string GetDevToolsFrontendResourceURL(const std::string& path) { |
+ return base::StringPrintf(kRemoteFrontendBaseURL, |
+ kRemoteFrontendDomain, |
+ path.c_str()); |
+} |
+ |
+std::string GetDevToolsFrontendMainResourceURL() { |
+ return base::StringPrintf(kRemoteFrontendMainURL, |
+ kRemoteFrontendDomain, |
+ webkit_glue::GetWebKitRevision().c_str()); |
+} |
+ |
+bool IsDevToolsFrontendHost(const GURL& url) { |
+ return url.host() == kRemoteFrontendDomain; |
+} |
+ |
+std::string GetDevToolsServerSocketName(const std::string& prefix) { |
+ return base::StringPrintf(kServerSocketNameFormat, |
+ prefix.c_str(), |
+ kServerSocketNameSuffix); |
+} |
+ |
+std::string GetDevToolsServerSocketSuffix() { |
+ return kServerSocketNameSuffix; |
+} |
+ |
+} // namespace devtools_remote_frontend |