Moved trace function to adapter.js and removed from pc1 & multiple.html.
Review URL: https://webrtc-codereview.appspot.com/1156005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@3608 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/samples/js/base/adapter.js b/samples/js/base/adapter.js
index 5441a6c..4294f34 100644
--- a/samples/js/base/adapter.js
+++ b/samples/js/base/adapter.js
@@ -4,6 +4,14 @@
 var reattachMediaStream = null;
 var webrtcDetectedBrowser = null;
 
+function trace(text) {
+  // This function is used for logging.
+  if (text[text.length - 1] == '\n') {
+    text = text.substring(0, text.length - 1);
+  }
+  console.log((performance.now() / 1000).toFixed(3) + ": " + text);
+}
+
 if (navigator.mozGetUserMedia) {
   console.log("This appears to be Firefox");
 
diff --git a/samples/js/demos/html/multiple.html b/samples/js/demos/html/multiple.html
index 81d768e..e5b8a0b 100644
--- a/samples/js/demos/html/multiple.html
+++ b/samples/js/demos/html/multiple.html
@@ -44,14 +44,6 @@
                         'OfferToReceiveAudio':true, 
                         'OfferToReceiveVideo':true }};
 
-function trace(text) {
-  // This function is used for logging.
-  if (text[text.length - 1] == '\n') {
-    text = text.substring(0, text.length - 1);
-  }
-  console.log((performance.now() / 1000).toFixed(3) + ": " + text);
-}
-
 function gotStream(stream){
   trace("Received local stream");
   // Call the polyfill wrapper to attach the media stream to this element.
diff --git a/samples/js/demos/html/pc1.html b/samples/js/demos/html/pc1.html
index 0a3e81e..61dc6a9 100644
--- a/samples/js/demos/html/pc1.html
+++ b/samples/js/demos/html/pc1.html
@@ -43,13 +43,6 @@
 var sdpConstraints = {'mandatory': {
                         'OfferToReceiveAudio':true, 
                         'OfferToReceiveVideo':true }};
-function trace(text) {
-  // This function is used for logging.
-  if (text[text.length - 1] == '\n') {
-    text = text.substring(0, text.length - 1);
-  }
-  console.log((performance.now() / 1000).toFixed(3) + ": " + text);
-}
 
 function gotStream(stream){
   trace("Received local stream");